[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Packaging manual fix



かねこ@ひたちです。fix を流します。

ch-sharedlib
><!--
>Any package installing shared libraries in a directory that's listed in
><code>/etc/ld.so.conf</code> or in one of the default library
>directories of <kbd>ld.so</kbd> (currently, these are
><code>/usr/lib</code> and <code>/lib</code>) must call
><kbd>ldconfig</kbd> in its <kbd>postinst</kbd> script if and only if the
>first argument is `configure'. However, it is important not to call
><kbd>ldconfig</kbd> in the postrm or preinst scripts in the case where
>the package is being upgraded (see <A
>href="ch-maintainerscripts.html#s-unpackphase">Details of unpack phase
>of installation or upgrade, section 6.3</A>), as <kbd>ldconfig</kbd>
>will see the temporary names that <kbd>dpkg</kbd> uses for the files
>while it is installing them and will make the shared library links point
>to them, just before <kbd>dpkg</kbd> continues the installation and
>removes the links!<P>
>-->
>
>共有ライブラリを,<code>/etc/ld.so.conf</code>に書かれてあるディレ
>クトリか、<kbd>ld.so</kbd> によるデフォルトの検索ディレクトリ(現在
>のところ、<code>/usr/lib</code> と <code>/lib</code> です)の何れか
>にインストールするパッケージは,最初の引数が configure であったと
>き,かつそのときのみ postinst スクリプトの中で ldconfig を呼ばなけ
>ればなりません。けれども、パッケージの更新作業中に postrm や preinst スク
>リプトから <kbd>ldconfig</kbd> を呼出してはいけません。(中略)
>それは,その場合には ldconfig が dpkg がインストール時に使う一時的
>なファイル名を見てしまい,それらへの共有ライブラリに対するリンクポ
>イントをつくってしまうためです。そして,その直後,dpkg はインスト
>ールを続行し,そのリンク先を削除してしまいます !<p>

#中略、がのこってしまっています ;;;^^)

そしてパッケージをアップグレードしようとしたときに、postrm と preinst
の中で ldconfig を呼ばないようにすることも重要です。(install時、アップ
グレード時のパッケージ展開作業の詳細については<A href=
"ch-maintainerscripts.html#s-unpackphase"Section 6.3>を参照ください)

><!--
>For each shared library, <kbd>dpkg-shlibdeps</kbd> needs to know
>-->
>
>共有ライブラリそれぞれについて、<kbd>dpkg-shlibdeps</kbd> は以下の
>情報を必要とします。

各共有ライブラリに対して、<kbd>dpkg-shlibdeps</kbd> は以下の情報を把握する
必要があり、

>
><ul compact>
><!--
><li>the package containing the library, and<li>the library version number,</ul>
>-->
>
><li>ライブラリを含んでいるパッケージ、および<li>ライブラリのバージョン番号、</
>ul>
>
><!--
>it scans the following files in this order.
>-->
>
>また、以下のファイルを順に走査します。

そのために以下のファイルを記述順に走査します。

><!--
><li><code>/etc/dpkg/shlibs.default</code> - the maintainer of
>dpkg<li><code>/var/lib/dpkg/info/</code><var>package</var><code>.shlibs</code>
>- the maintainer of each
>package<li><code>/etc/dpkg/shlibs.override</code> - the local system
>administrator<li><code>debian/shlibs.local</code> - the maintainer of
>the package</ul>
>-->
>
><li><code>/etc/dpkg/shlibs.default</code> - dpkg の管理者
><li><code>/var/lib/dpkg/info/</code><var>package</var><code>.shlibs</code>
>- それぞれのパッケージ管理者
><li><code>/etc/dpkg/shlibs.override</code> - ローカルのシステム管理者
><li><code>debian/shlibs.local</code> - パッケージ管理者
></ul>

パッケージに関する限り、管理者よりメンテナのほうが Debian-JP では一般用語では。

><!--
>Let's assume you are packaging a binary <code>foo</code>. Your output in
>building the package might look like this.
>-->
>
>バイナリ <code>foo</code> をパッケージしているとします。パッケージの
>構築中のメッセージは例えばこんな具合になるかもしれません。

こんな具合であるとします。

><pre>$ ldd foo
>libbar.so.1 =&gt; /usr/X11R6/lib/libbar.so.1.0
>libc.so.5 =&gt; /lib/libc.so.5.2.18
>libX11.so.6 =&gt; /usr/X11R6/lib/libX11.so.6.0</pre>
>
><!--
>And when you ran <kbd>dpkg-shlibdeps</kbd>
>-->
>そして、 <kbd>dpkg-shlibdeps</kbd> を実行すると、

そして、 <kbd>dpkg-shlibdeps</kbd> を実行すると、以下のようになりました。

><pre>$ dpkg-shlibdeps -o foo
>dpkg-shlibdeps: warning: unable to find dependency information
>for shared library libbar
>(soname 1, path /usr/X11R6/lib/libbar.so.1.0, dependency field Depends)
>shlibs:Depends=elf-x11r6lib, libc5 (&gt;= 5.2.18)</pre>
>
><!--
>The <kbd>foo</kbd> binary depends on the <kbd>libbar</kbd> shared
>library, but no package seems to provide a <code>*.shlibs</code> file in
><code></code>var/lib/dpkg/info/.  Let's determine the package
>responsible:<P>
>-->
>
> <kbd>foo</kbd> バイナリは、<kbd>libbar</kbd> 共有ライブラリに依存してい
>ますが、<code>var/lib/dpkg/info/</code> に置いてある
><code>*.shlibs</code>のうちのどれも目的のパッケージを提供しているものは
>ないようです。さあ、対応するパッケージを決定しましょう:<p>

<kbd>foo</kbd> バイナリは、<kbd>libbar</kbd> 共有ライブラリに依存してい
ますが、<code>var/lib/dpkg/info/</code> にある<code>*.shlibs</code>には
このライブラリを提供したパッケージの名前はありません。
というわけで、責任元のパッケージを決定しましょう。

><pre>$ dpkg -S /usr/X11R6/lib/libbar.so.1.0
>bar1: /usr/X11R6/lib/libbar.so.1.0
>$ dpkg -s bar1 | grep Version
>Version: 1.0-1</pre>
>
><!--
>This tells us that the <kbd>bar1</kbd> package, version 1.0-1 is the one
>we are using. Now we can create our own <code>debian/shlibs.local</code> to
>temporarly fix the above problem. Include the following line into your
><code>debian/shlibs.local</code> file.
>-->
>
>これは、 <kbd>bar1</kbd> のバージョン 1.0-1 を現在我々が使用していると
>言っています。

どうやら、<kbd>bar1</kbd> のバージョン 1.0-1 が現在我々の使用しているもの
ということになります。

-----------------------------------------------------------------------
ch-maintainerscripts

><!--
>Programs called from maintainer scripts should not normally have a
>path prepended to them. Before installation is started <kbd>dpkg</kbd>
>checks to see if the programs <kbd>ldconfig</kbd>,
><kbd>start-stop-daemon</kbd>, <kbd>install-info</kbd>, and
><kbd>update-rc.d</kbd>
>can be found via the <code>PATH</code> environment variable. Those programs,
>and any other program that one would expect to on the <code>PATH</code>,
>should thus be invoked without an absolute pathname.
>-->
>管理スクリプトから呼ばれるプログラムは、通常、そのスクリプトにおいてプログラム
>
>前にパスをつけて呼び出してはいけません。インストールが始まる前に、
><kbd>dpkg</kbd> は <kbd>ldconfig</kbd>、<kbd>start-stop-daemon</kbd>、
><kbd>install-info</kbd>、<kbd>update-rc.d</kbd> が <code>PATH</code> 環境変数か
>
>発見できるかどうかをチェックします。ですから、これらのプログラムや、
><code>PATH</code> にあることが期待されるプログラムについては、
>絶対パス名をつけること無しに呼び出すことができます。

ですから、これらのプログラムや、<code>PATH</code> にあることを期待してもい
いようなプログラムについては、絶対パス名をつけずに呼び出すべきです。

><!--
>The procedure on installation/upgrade/overwrite/disappear (ie, when
>running <code>dpkg --unpack</code>, or the unpack stage of <code>dpkg
>--install</code>) is as follows.  In each case if an error occurs the
>actions in are general run backwards - this means that the maintainer
>scripts are run with different arguments in reverse order.  These are
>the `error unwind' calls listed below.
>-->
>インストール/アップグレード/上書き/消失(すなわち、<code>dpkg
>--unpack</code>
>が走っているとき、または <code>dpkg --install</code> の展開段階のとき)
>の手続きは以下の通りになります。どのような場合においても、もしエラーが起これば
>そこでの動作は、一般に逆方向へ走らされます。これは、管理スクリプトが異なる引数
>
>逆順に走らされるということです。これらは「エラー回復」呼び出しとして
>以下に挙げられています。

このような呼び出しは以下では「エラー回復」呼び出しと記されています。

><!--
>If a version the package is already
>installed, call
>-->
>もし対象となるパッケージのあるバージョンが既にインストールされている場合、
>次の呼び出しをします。

もし、対象となるパッケージの、あるバージョンが既にインストールされている
場合は次の呼び出しをします。

><!--
>It is an error for a package to contains files which are on the system
>in another package, unless <code>Replaces</code> is used
>-->
><code>Replaces</code> が使われていない場合に、他のパッケージのファイルが
>システム上に存在すれば、パッケージに対してエラーとなります。

あるパッケージが現在システムにある別のパッケージのファイルと同名のファイ
ルを含んでいる場合、<code>Replaces</code> が指定されていない場合にはエラー
になります。

>ディレクトリは、決してディレクトリへのシッンボリックリンクに置き換わってしまう
                                         ^^
><p><li>
><!--
>Any files which were in the old version of the package but not in the
>new are removed.
>-->
>古いバージョンのパッケージにはあって、新しいものには無いファイルを削除します。

削除されます。

><!--
>The new file list replaces the old.
>-->
>ファイルリストを古いものから新しいものに置き換えます。

ファイルリストが…置き換えられます。

><!--
>The new maintainer scripts replace the old.
>-->
>管理スクリプトを古いものから新しいものに置き換えます。

新しい管理スクリプト群が、古いものを置き換えます。

-----------------------------------------------------------------------
ch-alternatives
><!--
> When several packages all provide different versions of the same
>program or file it is useful to have the system select a default, but
>to allow the system administrator to change it and have their
>decisions respected.<P>
>-->
>
>いくつかのパッケージには、プログラム名又はファイル名は同じでも、バージョ
>ンの違うものが含まれることがあります。そのとき、システムで使用するデフォ
>ルトを選んでおくと便利です。ただし、システム管理者は、そのデフォルトを変
>更できなければいけません。また、システムによって、管理者によって選ばれた
>デフォルトプログラムが変更されるようなことがあってはいけません。

#ここは分からない。バージョンという言葉が混乱を招く以上説明してしまう
#べき、とおもう。最終文は原文にあるので残したが、くどい。とるべきか。

いくつかのパッケージが同じプログラム名又はファイル名の、互換では
あるが異なったプログラムやファイルを提供する場合があります。そん
なとき、システムで使用するデフォルトを選んでおくと便利です。ただ
システム管理者によるこれに対する変更を許さなければなりませんし、
以降の処理でもその判断に従うようにする必要があります。


><!--
>For example, there are several versions of the <kbd>vi</kbd> editor, and
>there is no reason to prevent all of them from being installed at
>once, each under their own name (<kbd>nvi</kbd>, <kbd>vim</kbd> or whatever).
>
>例えば、<kbd>vi</kbd> エディタにはいくつかのバージョンがあります。そして、
>それらを全部同時に、それらの名前(<kbd>nvi</kbd>, <kbd>vim</kbd>など)で、
>インストールしても何の問題もありません。

例えば、<kbd>vi</kbd> エディタにはいくつかの実装があります。そして、
これらをその固有の名前(<kbd>nvi</kbd>, <kbd>vim</kbd>等々)でインス
トールしてはならない理由は何もありません。

><!--
>Each package provides its own version under its own name, and calls
><kbd>update-alternatives</kbd> in its postinst to register its version
>(and again in its prerm to deregister it).<P>
>-->
>
> そのバージョンによって違う名前のプログラムを、各パッケージは含んでいま
>す。それらのバージョンを登録するには、インストール時に postinst スクリプ
>トから update-alternatives を呼び出します(削除するときは、prerm スクリプ
>トから <kbd>update-alternatives</kbd> をもう一度呼び出します)。

このような各パッケージは、その提供するプログラムやファイルを自分固
有の名前で提供し、そのパッケージが存在することをインストール時に
postinst スクリプトから update-alternatives を呼び出すことによって
登録します。

#ということが cooperate の実態だから、もとのように漠然と書くと誤解
#を招くと思う。上の私の訳文も「バージョン」の意味説明を回避するため
#嘘書いています。うまい逃げ方がここは思い付かない。



-----------------------------------------------------------------------
ch-conversion.txt
><!--
><li>Ensure that the package's Debian-specific and upstream changelogs are
>installed.
>-->
>
><li>そのパッケージのバージョンが上がった場合や Debian に独自の情報を含む、
>    changelog がインストールされているか確認します。
></ul>
><p>

元となったパッケージと、Debian 固有の修正に関する修正履歴がインストール
されるようにします。


-----------------------------------------------------------------------
ch-sourcepkgs
><!--
>To create a packed source archive it is typically invoked:
><pre>dpkg-source -b <var>package</var>-<var>version</var></pre>
>This will create the <code>.dsc</code>, <code>.tar.gz</code> and
><code>.diff.gz</code> (if
>appropriate) in the current directory.  <kbd>dpkg-source</kbd> does not
>clean the source tree first
>-->
>
>パックされたソースアーカイブを作るには次のように呼び出します。
><pre>dpkg-source -b <var>package</var>-<var>version</var></pre>
>これにより、<code>.dsc</code>、<code>.tar.gz</code> と <code>.diff.gz</code> が
>(もし適当なら)カレントディレクトリに作られます。
><kbd>dpkg-source</kbd> は最初にソースツリーをきれいにしません。

ソースツリーに clean をおこないません。

><!--
>This is usually done just before the files and directories in the
>temporary directory tree where the package is being built have their
>permissions and ownerships set and the package is constructed using
><kbd>dpkg-deb</kbd><A href="footnotes.html#4" name="fr4">[4]</A>.<P>
>-->
>
>これは通常、パッケージが構築されている一時的なディレクトリツリー中の
>ファイルやディレクトリの許可属性や所有権を設定され、
>パッケージが <kbd>dpkg-deb</kbd> を用いて構築される直前に行なわれます。
><A href="footnotes.html#4" name="fr4">[4]</A>。<P>

これは通常、パッケージが構築されている一時的なディレクトリツリー中の
ファイルやディレクトリの許可属性や所有権を設定したあと、
パッケージが <kbd>dpkg-deb</kbd> を用いて構築される直前に行なわれます。

# のように思える。

><A name="s3.2.2"><h3>
>3.2.2 <code>debian/control</code>
></h3></A>
>
><!--
>This file contains version-independent details about the source
>package and about the binary packages it creates.<P>
>-->
>
>ソース・パッケージとそれから生成されるバイナリ・パッケージについてのバー
>ジョン依存の詳細を含みます。<p>

「バージョン非依存の」

><!--
><var>distribution(s)</var> lists the distributions where
>this version should be installed when it is uploaded
>
><var>distribution(s)</var> には、このバージョンがアップロードされるとき
>にインストールされる配布範囲がリストされます - これらは、

配布範囲ではなく「ディストリビューション」です。


--
Seiji Kaneko                              seiji@xxxxxxxxxxxxxxxxxxx
-------------------------------------------------------------------