1 # Debian Developer's Reference (Japanese)
2 # Hideki Yamane (Debian-JP) <henrich@debian.or.jp>, 2008-2011.
6 "Project-Id-Version: developers-reference 3.4.5\n"
7 "POT-Creation-Date: 2011-09-10 16:28-0400\n"
8 "PO-Revision-Date: 2011-07-03 19:27+0900\n"
9 "Last-Translator: Hideki Yamane <henrich@debian.org>\n"
10 "Language-Team: Debian JP Project <debian-doc@debian.or.jp>\n"
11 "Language: Japanese\n"
13 "Content-Type: text/plain; charset=UTF-8\n"
14 "Content-Transfer-Encoding: 8bit\n"
16 # type: Content of: <chapter><title>
17 #. type: Content of: <chapter><title>
18 #: best-pkging-practices.dbk:7
19 msgid "Best Packaging Practices"
20 msgstr "パッケージ化のベストプラクティス"
22 # type: Content of: <chapter><para>
23 #. type: Content of: <chapter><para>
24 #: best-pkging-practices.dbk:9
27 "Debian's quality is largely due to the <ulink url=\"&url-debian-policy;"
28 "\">Debian Policy</ulink>, which defines explicit baseline requirements which "
29 "all Debian packages must fulfill. Yet there is also a shared history of "
30 "experience which goes beyond the Debian Policy, an accumulation of years of "
31 "experience in packaging. Many very talented people have created great "
32 "tools, tools which help you, the Debian maintainer, create and maintain "
35 "Debian の品質は、<ulink url=\"&url-debian-policy;\">Debian Policy</ulink> に"
36 "大きく依存しています。これは、全ての Debian パッケージが満たす必要がある基本"
38 "多くの非常に優秀な人々が素晴らしいツールを作っており、このツールがあなた、つまり Debian のメンテナが素晴らしいパッケージを作り、維持していくのを手助けしてくれます。"
40 # type: Content of: <chapter><para>
41 #. type: Content of: <chapter><para>
42 #: best-pkging-practices.dbk:18
45 "This chapter provides some best practices for Debian developers. All "
46 "recommendations are merely that, and are not requirements or policy. These "
47 "are just some subjective hints, advice and pointers collected from Debian "
48 "developers. Feel free to pick and choose whatever works best for you."
50 "この章では、Debian 開発者へのベストプラクティスをいくつか提供します。すべての"
51 "勧めは単なる勧めであり、要求事項やポリシーではありません。"
52 "あなたにとって一番うまくいくやり方を、どうぞご自由に選んでください。"
54 # type: Content of: <chapter><section><title>
55 #. type: Content of: <chapter><section><title>
56 #: best-pkging-practices.dbk:24
57 msgid "Best practices for <filename>debian/rules</filename>"
58 msgstr "<filename>debian/rules</filename> についてのベストプラクティス"
60 # type: Content of: <chapter><section><para>
61 #. type: Content of: <chapter><section><para>
62 #: best-pkging-practices.dbk:26
64 "The following recommendations apply to the <filename>debian/rules</filename> "
65 "file. Since <filename>debian/rules</filename> controls the build process "
66 "and selects the files which go into the package (directly or indirectly), "
67 "it's usually the file maintainers spend the most time on."
69 "以下の推奨事項は、<filename>debian/rules</filename> ファイルに適用されます。"
70 "<filename>debian/rules</filename> は、ビルド作業を管理し、(直接にせよ、そうでないに"
71 "せよ) パッケージにどのファイルが入るかを選択します。大抵の場合、メンテナが最も時間を費やす"
74 # type: Content of: <chapter><section><section><title>
75 #. type: Content of: <chapter><section><section><title>
76 #: best-pkging-practices.dbk:32
77 msgid "Helper scripts"
80 # type: Content of: <chapter><section><section><para>
81 #. type: Content of: <chapter><section><section><para>
82 #: best-pkging-practices.dbk:34
84 "The rationale for using helper scripts in <filename>debian/rules</filename> "
85 "is that they let maintainers use and share common logic among many "
86 "packages. Take for instance the question of installing menu entries: you "
87 "need to put the file into <filename>/usr/share/menu</filename> (or "
88 "<filename>/usr/lib/menu</filename> for executable binary menufiles, if this "
89 "is needed), and add commands to the maintainer scripts to register and "
90 "unregister the menu entries. Since this is a very common thing for packages "
91 "to do, why should each maintainer rewrite all this on their own, sometimes "
92 "with bugs? Also, supposing the menu directory changed, every package would "
95 "<filename>debian/rules</filename> でヘルパースクリプトを使う根拠は、多くの"
96 "パッケージ間でメンテナらに共通のロジックを利用・共有させるようになるからです。"
97 "メニューエントリのインストールについての問いを例にとってみましょう: ファイルを <filename>"
98 "/usr/share/menu</filename> (必要であれば、実行形式のバイナリのメニューファイル"
99 "の場合 <filename>/usr/lib/menu</filename>) に置き、メンテナスクリプトにメニュー"
100 "エントリを登録・解除するためのコマンドを追加する必要があります。これはパッケージ"
101 "が行う、非常に一般的なことです。なぜ個々のメンテナがこれらのすべてを自分で書き直し、"
102 "時にはバグを埋め込む必要があるでしょう? また、メニューディレクトリが変更された場合、"
103 "すべてのパッケージを変更する必要があります。"
105 # type: Content of: <chapter><section><section><para>
106 #. type: Content of: <chapter><section><section><para>
107 #: best-pkging-practices.dbk:45
109 "Helper scripts take care of these issues. Assuming you comply with the "
110 "conventions expected by the helper script, the helper takes care of all the "
111 "details. Changes in policy can be made in the helper script; then packages "
112 "just need to be rebuilt with the new version of the helper and no other "
115 "ヘルパースクリプトがこれらの問題を引き受けてくれます。ヘルパースクリプトの"
116 "期待するやり方に従っているならば、ヘルパースクリプトはすべての詳細について"
117 "考慮をします。ポリシーの変更はヘルパースクリプト中で行えます; そして、"
118 "パッケージを新しいバージョンのヘルパースクリプトでリビルドする必要がある"
119 "だけです。他に何の変更も必要ありません。"
121 # type: Content of: <chapter><section><section><para>
122 #. type: Content of: <chapter><section><section><para>
123 #: best-pkging-practices.dbk:52
125 "<xref linkend=\"tools\"/> contains a couple of different helpers. The most "
126 "common and best (in our opinion) helper system is <systemitem role=\"package"
127 "\">debhelper</systemitem>. Previous helper systems, such as <systemitem "
128 "role=\"package\">debmake</systemitem>, were monolithic: you couldn't pick "
129 "and choose which part of the helper you found useful, but had to use the "
130 "helper to do everything. <systemitem role=\"package\">debhelper</"
131 "systemitem>, however, is a number of separate little <command>dh_*</command> "
132 "programs. For instance, <command>dh_installman</command> installs and "
133 "compresses man pages, <command>dh_installmenu</command> installs menu files, "
134 "and so on. Thus, it offers enough flexibility to be able to use the little "
135 "helper scripts, where useful, in conjunction with hand-crafted commands in "
136 "<filename>debian/rules</filename>."
138 "<xref linkend=\"tools\"/> には、複数の異なったヘルパーが含まれています。"
139 "もっとも一般的で (我々の意見では) ベストなヘルパーシステムは <systemitem "
140 "role=\"package\">debhelper</systemitem> です。<systemitem role=\"package\">"
141 "debmake</systemitem> のような、以前のヘルパーシステムはモノリシックでした: "
142 "使えそうなヘルパーの一部を取り出して選ぶことはできず、何を行うにもヘルパー"
143 "を使う必要がありました。ですが、<systemitem role=\"package\">debhelper"
144 "</systemitem> は、いくつもの分割された小さな <command>dh_*</command> "
145 "プログラムです。たとえば、<command>dh_installman</command> は man ページを"
146 "インストールして圧縮し、<command>dh_installmenu</command> は menu ファイル"
147 "をインストールするなどします。つまり、<filename>debian/rules</filename> "
148 "内で使える部分では小さなヘルパースクリプトを使い、手製のコマンドを使うと"
151 #. type: Content of: <chapter><section><section><para>
152 #: best-pkging-practices.dbk:66
154 "You can get started with <systemitem role=\"package\">debhelper</systemitem> "
155 "by reading <citerefentry> <refentrytitle>debhelper</refentrytitle> "
156 "<manvolnum>1</manvolnum> </citerefentry>, and looking at the examples that "
157 "come with the package. <command>dh_make</command>, from the <systemitem "
158 "role=\"package\">dh-make</systemitem> package (see <xref linkend=\"dh-make\"/"
159 ">), can be used to convert a vanilla source package to a <systemitem role="
160 "\"package\">debhelper</systemitem>ized package. This shortcut, though, "
161 "should not convince you that you do not need to bother understanding the "
162 "individual <command>dh_*</command> helpers. If you are going to use a "
163 "helper, you do need to take the time to learn to use that helper, to learn "
164 "its expectations and behavior."
166 "<citerefentry> <refentrytitle>debhelper</refentrytitle> <manvolnum>1</manvolnum> "
167 "</citerefentry> を読んで、パッケージに付属している例を参照すれば、<systemitem "
168 "role=\"package\">debhelper</systemitem> を使い始めることができます。 <systemitem "
169 "role=\"package\">dh-make</systemitem> パッケージ (<xref linkend=\"dh-make\"/> "
170 "参照) の <command>dh_make</command> は、素のソースパッケージを <systemitem role="
171 "\"package\">debhelper</systemitem>化されたパッケージに変換するのに利用できます。"
172 "ですが、この近道では個々の <command>dh_*</command> ヘルパーをわざわざ理解する"
173 "必要がないので、満足できないでしょう。ヘルパースクリプトを使おうとするのであれば、"
174 "そのヘルパーを使うこと、つまり前提と動作を学ぶのに時間を割く必要があります。"
176 # type: Content of: <chapter><section><section><para>
177 #. type: Content of: <chapter><section><section><para>
178 #: best-pkging-practices.dbk:79
180 "Some people feel that vanilla <filename>debian/rules</filename> files are "
181 "better, since you don't have to learn the intricacies of any helper system. "
182 "This decision is completely up to you. Use what works for you. Many "
183 "examples of vanilla <filename>debian/rules</filename> files are available at "
184 "<ulink url=\"&url-rules-files;\"></ulink>."
186 "いかなるヘルパーシステムの複雑さも学ぶ必要がないので、素の <filename>debian"
187 "/rules</filename> ファイルのほうが良いと考える人もいます。この判断は完全に"
188 "あなた次第です。あなたに合っている方を選んでください。素の <filename>debian"
189 "/rules</filename> ファイルの多くの例は <ulink url=\"&url-rules-files;\">"
192 # type: Content of: <chapter><section><section><title>
193 #. type: Content of: <chapter><section><section><title>
194 #: best-pkging-practices.dbk:88
195 msgid "Separating your patches into multiple files"
196 msgstr "パッチを複数のファイルに分離する"
198 # type: Content of: <chapter><section><section><para>
199 #. type: Content of: <chapter><section><section><para>
200 #: best-pkging-practices.dbk:90
202 "Big, complex packages may have many bugs that you need to deal with. If you "
203 "correct a number of bugs directly in the source, and you're not careful, it "
204 "can get hard to differentiate the various patches that you applied. It can "
205 "get quite messy when you have to update the package to a new upstream "
206 "version which integrates some of the fixes (but not all). You can't take "
207 "the total set of diffs (e.g., from <filename>.diff.gz</filename>) and work "
208 "out which patch sets to back out as a unit as bugs are fixed upstream."
210 "巨大で複雑なパッケージには、対処が必要なたくさんのバグが含まれているかも"
211 "しれません。直接ソース中で大量のバグを修正し、あまり注意を払っていなかった"
212 "場合、適用した様々なパッチを識別するのは難しいことになるでしょう。"
213 "(全てではなく) 幾つか修正を取り入れた新しい開発元のバージョンへパッケージを"
214 "更新する必要が出た場合、とても悲惨なことになります。(例えば、<filename>.diff.gz"
215 "</filename> から) diff をすべて適用することもできませんし、開発元で"
216 "修正されたバグごとにどのパッチをバックアウトするようにすればよいのか"
219 #. type: Content of: <chapter><section><section><para>
220 #: best-pkging-practices.dbk:99
222 "Fortunately, with the source format “3.0 (quilt)” it is now possible to keep "
223 "patches separate without having to modify <filename>debian/rules</filename> "
224 "to setup a patch system. Patches are stored in <filename>debian/patches/</"
225 "filename> and when the source package is unpacked patches listed in "
226 "<filename>debian/patches/series</filename> are automatically applied. As "
227 "the name implies, patches can be managed with <command>quilt</command>."
229 "幸いなことに、ソースフォーマット“3.0 (quilt)”では、パッチシステムを設定するために "
230 "<filename>debian/rules</filename> を変更することなく、パッチを分割して保持できる"
231 "ようになっています。パッチは <filename>debian/patches/</filename> に保持され、"
232 "ソースパッケージが展開されるときに <filename>debian/patches/series</filename> "
233 "に記載されているパッチが自動的に適用されます。名前が指すように、パッチは "
234 "<command>quilt</command> で管理することができます。"
236 #. type: Content of: <chapter><section><section><para>
237 #: best-pkging-practices.dbk:107
239 "When using the older source “1.0”, it's also possible to separate patches "
240 "but a dedicated patch system must be used: the patch files are shipped "
241 "within the Debian patch file (<filename>.diff.gz</filename>), usually within "
242 "the <filename>debian/</filename> directory. The only difference is that they "
243 "aren't applied immediately by <command>dpkg-source</command>, but by the "
244 "<literal>build</literal> rule of <filename>debian/rules</filename>, through "
245 "a dependency on the <literal>patch</literal> rule. Conversely, they are "
246 "reverted in the <literal>clean</literal> rule, through a dependency on the "
247 "<literal>unpatch</literal> rule."
249 "より古いソースフォーマット“1.0”を使っている場合でも、パッチを分割することは"
250 "可能ですが、専用のパッチシステムを使う必要があります: パッチファイルは Debian "
251 "パッチファイル (<filename>.diff.gz</filename>) 内に組み込まれ、通常 <filename>"
252 "debian/</filename> ディレクトリ内にあります。違いは、すぐに <command>dpkg-source"
253 "</command> では適用されないが、<filename>debian/rules</filename> の <literal>"
254 "build</literal> ルールで <literal>patch</literal> ルールへの依存を通じて適用"
255 "されることだけです。逆に言うと、これらのパッチは <literal>unpatch</literal> "
256 "ルールへの依存を通じて <literal>clean</literal> ルールで外されます。"
258 #. type: Content of: <chapter><section><section><para>
259 #: best-pkging-practices.dbk:119
261 "<command>quilt</command> is the recommended tool for this. It does all of "
262 "the above, and also allows to manage patch series. See the <systemitem role="
263 "\"package\">quilt</systemitem> package for more information."
265 "<command>quilt</command> はこの作業にお勧めのツールです。上記の全てを行う上、"
266 "パッチ一覧の管理も可能です。詳細な情報は <systemitem role=\"package\">quilt"
267 "</systemitem> パッケージを参照してください。"
269 #. type: Content of: <chapter><section><section><para>
270 #: best-pkging-practices.dbk:125
272 "There are other tools to manage patches, like <command>dpatch</command>, and "
273 "the patch system integrated with <systemitem role=\"package\">cdbs</"
276 "他にもパッチを管理するツールはあります。<command>dpatch</command> や、パッチ"
277 "システムが統合されている <systemitem role=\"package\">cdbs</systemitem> などです。"
279 # type: Content of: <chapter><section><section><title>
280 #. type: Content of: <chapter><section><section><title>
281 #: best-pkging-practices.dbk:132
282 msgid "Multiple binary packages"
283 msgstr "複数のバイナリパッケージ"
285 # type: Content of: <chapter><section><section><para>
286 #. type: Content of: <chapter><section><section><para>
287 #: best-pkging-practices.dbk:134
290 "A single source package will often build several binary packages, either to "
291 "provide several flavors of the same software (e.g., the <systemitem role="
292 "\"package\">vim</systemitem> source package) or to make several small "
293 "packages instead of a big one (e.g., so the user can install only the subset "
294 "needed, and thus save some disk space)."
296 "単一のソースパッケージはしばしば複数のバイナリパッケージを生成します。それは、同じソフト"
297 "ウェアで複数のフレーバーを提供することであったり (例: <systemitem role=\"package\">"
298 "vim</systemitem> ソースパッケージ)、巨大なパッケージではなく複数の小さなパッケージを"
299 "作ったりします (例: ユーザがサブセットのみをインストールできるようにして、ディスク"
302 # type: Content of: <chapter><section><section><para>
303 #. type: Content of: <chapter><section><section><para>
304 #: best-pkging-practices.dbk:141
307 "The second case can be easily managed in <filename>debian/rules</filename>. "
308 "You just need to move the appropriate files from the build directory into "
309 "the package's temporary trees. You can do this using <command>install</"
310 "command> or <command>dh_install</command> from <systemitem role=\"package"
311 "\">debhelper</systemitem>. Be sure to check the different permutations of "
312 "the various packages, ensuring that you have the inter-package dependencies "
313 "set right in <filename>debian/control</filename>."
315 "二つ目の例は、<filename>debian/rules</filename> で簡単に扱うことができます。"
316 "ビルドディレクトリからパッケージの一時ツリーへ、適切なファイルを移動する必要があるだけです。"
317 "これは、<command>install</command> または <systemitem role=\"package\">"
318 "debhelper</systemitem> の <command>dh_install</command> を使ってできます。"
319 "パッケージ間の依存関係を <filename>debian/control</filename> 内で正しく設定したのを保証してください。"
321 # type: Content of: <chapter><section><section><para>
322 #. type: Content of: <chapter><section><section><para>
323 #: best-pkging-practices.dbk:150
325 "The first case is a bit more difficult since it involves multiple recompiles "
326 "of the same software but with different configuration options. The "
327 "<systemitem role=\"package\">vim</systemitem> source package is an example "
328 "of how to manage this using an hand-crafted <filename>debian/rules</"
331 "最初の例は、同じソフトウェアでありながら異なった設定オプションで複数回再コンパイルする"
332 "必要があるので、ちょっと難しくなります。<systemitem role=\"package\">vim</systemitem> "
333 "ソースパッケージは、手作りの<filename>debian/rules</filename> ファイルを使って"
334 "どのようにこの作業を扱うか、という例です。"
336 # type: Content of: <chapter><section><title>
337 #. type: Content of: <chapter><section><title>
338 #: best-pkging-practices.dbk:162
339 msgid "Best practices for <filename>debian/control</filename>"
340 msgstr "<filename>debian/control</filename> のベストプラクティス"
342 # type: Content of: <chapter><section><para>
343 #. type: Content of: <chapter><section><para>
344 #: best-pkging-practices.dbk:164
346 "The following practices are relevant to the <filename>debian/control</"
347 "filename> file. They supplement the <ulink url=\"&url-debian-policy;ch-"
348 "binary.html#s-descriptions\">Policy on package descriptions</ulink>."
351 # type: Content of: <chapter><section><para>
352 #. type: Content of: <chapter><section><para>
353 #: best-pkging-practices.dbk:170
355 "The description of the package, as defined by the corresponding field in the "
356 "<filename>control</filename> file, contains both the package synopsis and "
357 "the long description for the package. <xref linkend=\"bpp-desc-basics\"/> "
358 "describes common guidelines for both parts of the package description. "
359 "Following that, <xref linkend=\"bpp-pkg-synopsis\"/> provides guidelines "
360 "specific to the synopsis, and <xref linkend=\"bpp-pkg-desc\"/> contains "
361 "guidelines specific to the description."
364 # type: Content of: <chapter><section><section><title>
365 #. type: Content of: <chapter><section><section><title>
366 #: best-pkging-practices.dbk:179
367 msgid "General guidelines for package descriptions"
368 msgstr "パッケージ説明文の基本的なガイドライン"
370 # type: Content of: <chapter><section><section><para>
371 #. type: Content of: <chapter><section><section><para>
372 #: best-pkging-practices.dbk:181
374 "The package description should be written for the average likely user, the "
375 "average person who will use and benefit from the package. For instance, "
376 "development packages are for developers, and can be technical in their "
377 "language. More general-purpose applications, such as editors, should be "
378 "written for a less technical user."
381 # type: Content of: <chapter><section><section><para>
382 #. type: Content of: <chapter><section><section><para>
383 #: best-pkging-practices.dbk:188
385 "Our review of package descriptions lead us to conclude that most package "
386 "descriptions are technical, that is, are not written to make sense for non-"
387 "technical users. Unless your package really is only for technical users, "
391 # type: Content of: <chapter><section><section><para>
392 #. type: Content of: <chapter><section><section><para>
393 #: best-pkging-practices.dbk:194
395 "How do you write for non-technical users? Avoid jargon. Avoid referring to "
396 "other applications or frameworks that the user might not be familiar with — "
397 "GNOME or KDE is fine, since users are probably familiar with these terms, "
398 "but GTK+ is probably not. Try not to assume any knowledge at all. If you "
399 "must use technical terms, introduce them."
402 # type: Content of: <chapter><section><section><para>
403 #. type: Content of: <chapter><section><section><para>
404 #: best-pkging-practices.dbk:201
406 "Be objective. Package descriptions are not the place for advocating your "
407 "package, no matter how much you love it. Remember that the reader may not "
408 "care about the same things you care about."
411 # type: Content of: <chapter><section><section><para>
412 #. type: Content of: <chapter><section><section><para>
413 #: best-pkging-practices.dbk:206
415 "References to the names of any other software packages, protocol names, "
416 "standards, or specifications should use their canonical forms, if one "
417 "exists. For example, use X Window System, X11, or X; not X Windows, X-"
418 "Windows, or X Window. Use GTK+, not GTK or gtk. Use GNOME, not Gnome. Use "
419 "PostScript, not Postscript or postscript."
422 # type: Content of: <chapter><section><section><para>
423 #. type: Content of: <chapter><section><section><para>
424 #: best-pkging-practices.dbk:213
426 "If you are having problems writing your description, you may wish to send it "
427 "along to &email-debian-l10n-english; and request feedback."
430 # type: Content of: <chapter><section><section><title>
431 #. type: Content of: <chapter><section><section><title>
432 #: best-pkging-practices.dbk:219
433 msgid "The package synopsis, or short description"
436 #. type: Content of: <chapter><section><section><para>
437 #: best-pkging-practices.dbk:221
439 "Policy says the synopsis line (the short description) must be concise, not "
440 "repeating the package name, but also informative."
443 #. type: Content of: <chapter><section><section><para>
444 #: best-pkging-practices.dbk:225
446 "The synopsis functions as a phrase describing the package, not a complete "
447 "sentence, so sentential punctuation is inappropriate: it does not need extra "
448 "capital letters or a final period (full stop). It should also omit any "
449 "initial indefinite or definite article — \"a\", \"an\", or \"the\". Thus for "
453 #. type: Content of: <chapter><section><section><screen>
454 #: best-pkging-practices.dbk:231
458 "Description: exemplification support library\n"
461 "Description: exemplification support library\n"
463 #. type: Content of: <chapter><section><section><para>
464 #: best-pkging-practices.dbk:235
466 "Technically this is a noun phrase minus articles, as opposed to a verb "
467 "phrase. A good heuristic is that it should be possible to substitute the "
468 "package <replaceable>name</replaceable> and <replaceable>synopsis</"
469 "replaceable> into this formula:"
472 #. type: Content of: <chapter><section><section><para>
473 #: best-pkging-practices.dbk:240
475 "The package <replaceable>name</replaceable> provides {a,an,the,some} "
476 "<replaceable>synopsis</replaceable>."
479 #. type: Content of: <chapter><section><section><para>
480 #: best-pkging-practices.dbk:244
482 "Sets of related packages may use an alternative scheme that divides the "
483 "synopsis into two parts, the first a description of the whole suite and the "
484 "second a summary of the package's role within it:"
487 #. type: Content of: <chapter><section><section><screen>
488 #: best-pkging-practices.dbk:249
491 "Package: eg-tools\n"
492 "Description: simple exemplification system (utilities)\n"
495 "Description: simple exemplification system - documentation\n"
497 "Package: eg-tools\n"
498 "Description: simple exemplification system (utilities)\n"
501 "Description: simple exemplification system - documentation\n"
503 #. type: Content of: <chapter><section><section><para>
504 #: best-pkging-practices.dbk:256
506 "These synopses follow a modified formula. Where a package "
507 "\"<replaceable>name</replaceable>\" has a synopsis \"<replaceable>suite</"
508 "replaceable> (<replaceable>role</replaceable>)\" or \"<replaceable>suite</"
509 "replaceable> - <replaceable>role</replaceable>\", the elements should be "
510 "phrased so that they fit into the formula:"
513 #. type: Content of: <chapter><section><section><para>
514 #: best-pkging-practices.dbk:263
516 "The package <replaceable>name</replaceable> provides {a,an,the} "
517 "<replaceable>role</replaceable> for the <replaceable>suite</replaceable>."
520 # type: Content of: <chapter><section><section><title>
521 #. type: Content of: <chapter><section><section><title>
522 #: best-pkging-practices.dbk:269
523 msgid "The long description"
526 # type: Content of: <chapter><section><section><para>
527 #. type: Content of: <chapter><section><section><para>
528 #: best-pkging-practices.dbk:271
530 "The long description is the primary information available to the user about "
531 "a package before they install it. It should provide all the information "
532 "needed to let the user decide whether to install the package. Assume that "
533 "the user has already read the package synopsis."
536 # type: Content of: <chapter><section><section><para>
537 #. type: Content of: <chapter><section><section><para>
538 #: best-pkging-practices.dbk:277
539 msgid "The long description should consist of full and complete sentences."
542 # type: Content of: <chapter><section><section><para>
543 #. type: Content of: <chapter><section><section><para>
544 #: best-pkging-practices.dbk:280
546 "The first paragraph of the long description should answer the following "
547 "questions: what does the package do? what task does it help the user "
548 "accomplish? It is important to describe this in a non-technical way, unless "
549 "of course the audience for the package is necessarily technical."
552 # type: Content of: <chapter><section><section><para>
553 #. type: Content of: <chapter><section><section><para>
554 #: best-pkging-practices.dbk:286
556 "The following paragraphs should answer the following questions: Why do I as "
557 "a user need this package? What other features does the package have? What "
558 "outstanding features and deficiencies are there compared to other packages "
559 "(e.g., if you need X, use Y instead)? Is this package related to other "
560 "packages in some way that is not handled by the package manager (e.g., this "
561 "is the client for the foo server)?"
564 # type: Content of: <chapter><section><section><para>
565 #. type: Content of: <chapter><section><section><para>
566 #: best-pkging-practices.dbk:294
568 "Be careful to avoid spelling and grammar mistakes. Ensure that you spell-"
569 "check it. Both <command>ispell</command> and <command>aspell</command> have "
570 "special modes for checking <filename>debian/control</filename> files:"
573 #. type: Content of: <chapter><section><section><screen>
574 #: best-pkging-practices.dbk:299
576 msgid "ispell -d american -g debian/control\n"
577 msgstr "ispell -d american -g debian/control\n"
579 #. type: Content of: <chapter><section><section><screen>
580 #: best-pkging-practices.dbk:302
582 msgid "aspell -d en -D -c debian/control\n"
583 msgstr "aspell -d en -D -c debian/control\n"
585 # type: Content of: <chapter><section><section><para>
586 #. type: Content of: <chapter><section><section><para>
587 #: best-pkging-practices.dbk:305
589 "Users usually expect these questions to be answered in the package "
593 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
594 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
595 #: best-pkging-practices.dbk:310
597 "What does the package do? If it is an add-on to another package, then the "
598 "short description of the package we are an add-on to should be put in here."
601 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
602 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
603 #: best-pkging-practices.dbk:316
605 "Why should I want this package? This is related to the above, but not the "
606 "same (this is a mail user agent; this is cool, fast, interfaces with PGP and "
607 "LDAP and IMAP, has features X, Y, and Z)."
610 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
611 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
612 #: best-pkging-practices.dbk:323
614 "If this package should not be installed directly, but is pulled in by "
615 "another package, this should be mentioned."
618 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
619 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
620 #: best-pkging-practices.dbk:329
622 "If the package is <literal>experimental</literal>, or there are other "
623 "reasons it should not be used, if there are other packages that should be "
624 "used instead, it should be here as well."
627 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
628 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
629 #: best-pkging-practices.dbk:336
631 "How is this package different from the competition? Is it a better "
632 "implementation? more features? different features? Why should I choose this "
636 # type: Content of: <chapter><section><section><title>
637 #. type: Content of: <chapter><section><section><title>
638 #: best-pkging-practices.dbk:349
639 msgid "Upstream home page"
642 # type: Content of: <chapter><section><section><para>
643 #. type: Content of: <chapter><section><section><para>
644 #: best-pkging-practices.dbk:351
646 "We recommend that you add the URL for the package's home page in the "
647 "<literal>Homepage</literal> field of the <literal>Source</literal> section "
648 "in <filename>debian/control</filename>. Adding this information in the "
649 "package description itself is considered deprecated."
652 # type: Content of: <chapter><section><section><title>
653 #. type: Content of: <chapter><section><section><title>
654 #: best-pkging-practices.dbk:359
655 msgid "Version Control System location"
656 msgstr "バージョン管理システムの場所"
658 # type: Content of: <chapter><section><section><para>
659 #. type: Content of: <chapter><section><section><para>
660 #: best-pkging-practices.dbk:361
662 "There are additional fields for the location of the Version Control System "
663 "in <filename>debian/control</filename>."
666 # type: Content of: <chapter><section><section><section><title>
667 #. type: Content of: <chapter><section><section><section><title>
668 #: best-pkging-practices.dbk:365
672 # type: Content of: <chapter><section><section><section><para>
673 #. type: Content of: <chapter><section><section><section><para>
674 #: best-pkging-practices.dbk:367
676 "Value of this field should be a <literal>http://</literal> URL pointing to a "
677 "web-browsable copy of the Version Control System repository used to maintain "
678 "the given package, if available."
681 # type: Content of: <chapter><section><section><section><para>
682 #. type: Content of: <chapter><section><section><section><para>
683 #: best-pkging-practices.dbk:372
685 "The information is meant to be useful for the final user, willing to browse "
686 "the latest work done on the package (e.g. when looking for the patch fixing "
687 "a bug tagged as <literal>pending</literal> in the bug tracking system)."
690 # type: Content of: <chapter><section><section><section><title>
691 #. type: Content of: <chapter><section><section><section><title>
692 #: best-pkging-practices.dbk:379
696 # type: Content of: <chapter><section><section><section><para>
697 #. type: Content of: <chapter><section><section><section><para>
698 #: best-pkging-practices.dbk:381
700 "Value of this field should be a string identifying unequivocally the "
701 "location of the Version Control System repository used to maintain the given "
702 "package, if available. <literal>*</literal> identify the Version Control "
703 "System; currently the following systems are supported by the package "
704 "tracking system: <literal>arch</literal>, <literal>bzr</literal> (Bazaar), "
705 "<literal>cvs</literal>, <literal>darcs</literal>, <literal>git</literal>, "
706 "<literal>hg</literal> (Mercurial), <literal>mtn</literal> (Monotone), "
707 "<literal>svn</literal> (Subversion). It is allowed to specify different VCS "
708 "fields for the same package: they will all be shown in the PTS web interface."
711 # type: Content of: <chapter><section><section><section><para>
712 #. type: Content of: <chapter><section><section><section><para>
713 #: best-pkging-practices.dbk:392
715 "The information is meant to be useful for a user knowledgeable in the given "
716 "Version Control System and willing to build the current version of a package "
717 "from the VCS sources. Other uses of this information might include "
718 "automatic building of the latest VCS version of the given package. To this "
719 "end the location pointed to by the field should better be version agnostic "
720 "and point to the main branch (for VCSs supporting such a concept). Also, "
721 "the location pointed to should be accessible to the final user; fulfilling "
722 "this requirement might imply pointing to an anonymous access of the "
723 "repository instead of pointing to an SSH-accessible version of the same."
726 # type: Content of: <chapter><section><section><section><para>
727 #. type: Content of: <chapter><section><section><section><para>
728 #: best-pkging-practices.dbk:403
730 "In the following example, an instance of the field for a Subversion "
731 "repository of the <systemitem role=\"package\">vim</systemitem> package is "
732 "shown. Note how the URL is in the <literal>svn://</literal> scheme (instead "
733 "of <literal>svn+ssh://</literal>) and how it points to the <filename>trunk/</"
734 "filename> branch. The use of the <literal>Vcs-Browser</literal> and "
735 "<literal>Homepage</literal> fields described above is also shown."
738 # type: Content of: <chapter><section><section><section><screen>
739 #. type: Content of: <chapter><section><section><section><screen>
740 #: best-pkging-practices.dbk:412
744 " Section: editors\n"
745 " Priority: optional\n"
747 " Vcs-Svn: svn://svn.debian.org/svn/pkg-vim/trunk/packages/vim\n"
748 " Vcs-Browser: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim\n"
749 " Homepage: http://www.vim.org\n"
752 " Section: editors\n"
753 " Priority: optional\n"
755 " Vcs-Svn: svn://svn.debian.org/svn/pkg-vim/trunk/packages/vim\n"
756 " Vcs-Browser: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim\n"
757 " Homepage: http://www.vim.org\n"
759 # type: Content of: <chapter><section><title>
760 #. type: Content of: <chapter><section><title>
761 #: best-pkging-practices.dbk:427
762 msgid "Best practices for <filename>debian/changelog</filename>"
763 msgstr "<filename>debian/changelog</filename> のベストプラクティス"
765 # type: Content of: <chapter><section><para>
766 #. type: Content of: <chapter><section><para>
767 #: best-pkging-practices.dbk:429
769 "The following practices supplement the <ulink url=\"&url-debian-policy;ch-"
770 "docs.html#s-changelogs\">Policy on changelog files</ulink>."
773 # type: Content of: <chapter><section><section><title>
774 #. type: Content of: <chapter><section><section><title>
775 #: best-pkging-practices.dbk:434
776 msgid "Writing useful changelog entries"
777 msgstr "役立つ changelog のエントリを書く"
779 # type: Content of: <chapter><section><section><para>
780 #. type: Content of: <chapter><section><section><para>
781 #: best-pkging-practices.dbk:436
783 "The changelog entry for a package revision documents changes in that "
784 "revision, and only them. Concentrate on describing significant and user-"
785 "visible changes that were made since the last version."
788 # type: Content of: <chapter><section><section><para>
789 #. type: Content of: <chapter><section><section><para>
790 #: best-pkging-practices.dbk:441
792 "Focus on <emphasis>what</emphasis> was changed — who, how and when are "
793 "usually less important. Having said that, remember to politely attribute "
794 "people who have provided notable help in making the package (e.g., those who "
795 "have sent in patches)."
798 # type: Content of: <chapter><section><section><para>
799 #. type: Content of: <chapter><section><section><para>
800 #: best-pkging-practices.dbk:447
802 "There's no need to elaborate the trivial and obvious changes. You can also "
803 "aggregate several changes in one entry. On the other hand, don't be overly "
804 "terse if you have undertaken a major change. Be especially clear if there "
805 "are changes that affect the behaviour of the program. For further "
806 "explanations, use the <filename>README.Debian</filename> file."
809 # type: Content of: <chapter><section><section><para>
810 #. type: Content of: <chapter><section><section><para>
811 #: best-pkging-practices.dbk:454
813 "Use common English so that the majority of readers can comprehend it. Avoid "
814 "abbreviations, tech-speak and jargon when explaining changes that close "
815 "bugs, especially for bugs filed by users that did not strike you as "
816 "particularly technically savvy. Be polite, don't swear."
819 # type: Content of: <chapter><section><section><para>
820 #. type: Content of: <chapter><section><section><para>
821 #: best-pkging-practices.dbk:460
823 "It is sometimes desirable to prefix changelog entries with the names of the "
824 "files that were changed. However, there's no need to explicitly list each "
825 "and every last one of the changed files, especially if the change was small "
826 "or repetitive. You may use wildcards."
829 # type: Content of: <chapter><section><section><para>
830 #. type: Content of: <chapter><section><section><para>
831 #: best-pkging-practices.dbk:466
833 "When referring to bugs, don't assume anything. Say what the problem was, "
834 "how it was fixed, and append the closes: #nnnnn string. See <xref linkend="
835 "\"upload-bugfix\"/> for more information."
838 # type: Content of: <chapter><section><section><title>
839 #. type: Content of: <chapter><section><section><title>
840 #: best-pkging-practices.dbk:473
841 msgid "Common misconceptions about changelog entries"
844 # type: Content of: <chapter><section><section><para>
845 #. type: Content of: <chapter><section><section><para>
846 #: best-pkging-practices.dbk:475
848 "The changelog entries should <emphasis role=\"strong\">not</emphasis> "
849 "document generic packaging issues (Hey, if you're looking for foo.conf, it's "
850 "in /etc/blah/.), since administrators and users are supposed to be at least "
851 "remotely acquainted with how such things are generally arranged on Debian "
852 "systems. Do, however, mention if you change the location of a configuration "
856 #. type: Content of: <chapter><section><section><para>
857 #: best-pkging-practices.dbk:483
859 "The only bugs closed with a changelog entry should be those that are "
860 "actually fixed in the same package revision. Closing unrelated bugs in the "
861 "changelog is bad practice. See <xref linkend=\"upload-bugfix\"/>."
864 # type: Content of: <chapter><section><section><para>
865 #. type: Content of: <chapter><section><section><para>
866 #: best-pkging-practices.dbk:488
868 "The changelog entries should <emphasis role=\"strong\">not</emphasis> be "
869 "used for random discussion with bug reporters (I don't see segfaults when "
870 "starting foo with option bar; send in more info), general statements on "
871 "life, the universe and everything (sorry this upload took me so long, but I "
872 "caught the flu), or pleas for help (the bug list on this package is huge, "
873 "please lend me a hand). Such things usually won't be noticed by their "
874 "target audience, but may annoy people who wish to read information about "
875 "actual changes in the package. See <xref linkend=\"bug-answering\"/> for "
876 "more information on how to use the bug tracking system."
879 # type: Content of: <chapter><section><section><para>
880 #. type: Content of: <chapter><section><section><para>
881 #: best-pkging-practices.dbk:499
883 "It is an old tradition to acknowledge bugs fixed in non-maintainer uploads "
884 "in the first changelog entry of the proper maintainer upload. As we have "
885 "version tracking now, it is enough to keep the NMUed changelog entries and "
886 "just mention this fact in your own changelog entry."
889 # type: Content of: <chapter><section><section><title>
890 #. type: Content of: <chapter><section><section><title>
891 #: best-pkging-practices.dbk:507
892 msgid "Common errors in changelog entries"
893 msgstr "changelog のエントリ中のよくある間違い"
895 # type: Content of: <chapter><section><section><para>
896 #. type: Content of: <chapter><section><section><para>
897 #: best-pkging-practices.dbk:509
899 "The following examples demonstrate some common errors or examples of bad "
900 "style in changelog entries."
902 "以下の例で、changelog エントリ中のよくある間違いや間違ったスタイルの例を"
905 # type: Content of: <chapter><section><section><screen>
906 #. type: Content of: <chapter><section><section><screen>
907 #: best-pkging-practices.dbk:513
909 msgid " * Fixed all outstanding bugs.\n"
910 msgstr " * Fixed all outstanding bugs.\n"
912 # type: Content of: <chapter><section><section><para>
913 #. type: Content of: <chapter><section><section><para>
914 #: best-pkging-practices.dbk:516
915 msgid "This doesn't tell readers anything too useful, obviously."
916 msgstr "これは、全く読み手に何も有用なことを教えてくれません。"
918 # type: Content of: <chapter><section><section><screen>
919 #. type: Content of: <chapter><section><section><screen>
920 #: best-pkging-practices.dbk:519
922 msgid " * Applied patch from Jane Random.\n"
923 msgstr " * Applied patch from Jane Random.\n"
925 # type: Content of: <chapter><section><section><para>
926 #. type: Content of: <chapter><section><section><para>
927 #: best-pkging-practices.dbk:522
928 msgid "What was the patch about?"
929 msgstr "何についてのパッチですか?"
931 # type: Content of: <chapter><section><section><screen>
932 #. type: Content of: <chapter><section><section><screen>
933 #: best-pkging-practices.dbk:525
935 msgid " * Late night install target overhaul.\n"
936 msgstr " * Late night install target overhaul.\n"
938 # type: Content of: <chapter><section><section><para>
939 #. type: Content of: <chapter><section><section><para>
940 #: best-pkging-practices.dbk:528
942 "Overhaul which accomplished what? Is the mention of late night supposed to "
943 "remind us that we shouldn't trust that code?"
946 # type: Content of: <chapter><section><section><screen>
947 #. type: Content of: <chapter><section><section><screen>
948 #: best-pkging-practices.dbk:532
950 msgid " * Fix vsync FU w/ ancient CRTs.\n"
951 msgstr " * Fix vsync FU w/ ancient CRTs.\n"
953 # type: Content of: <chapter><section><section><para>
954 #. type: Content of: <chapter><section><section><para>
955 #: best-pkging-practices.dbk:535
958 "Too many acronyms, and it's not overly clear what the, uh, fsckup (oops, a "
959 "curse word!) was actually about, or how it was fixed."
963 # type: Content of: <chapter><section><section><screen>
964 #. type: Content of: <chapter><section><section><screen>
965 #: best-pkging-practices.dbk:539
967 msgid " * This is not a bug, closes: #nnnnnn.\n"
968 msgstr " * This is not a bug, closes: #nnnnnn.\n"
970 # type: Content of: <chapter><section><section><para>
971 #. type: Content of: <chapter><section><section><para>
972 #: best-pkging-practices.dbk:542
974 "First of all, there's absolutely no need to upload the package to convey "
975 "this information; instead, use the bug tracking system. Secondly, there's "
976 "no explanation as to why the report is not a bug."
979 # type: Content of: <chapter><section><section><screen>
980 #. type: Content of: <chapter><section><section><screen>
981 #: best-pkging-practices.dbk:547
983 msgid " * Has been fixed for ages, but I forgot to close; closes: #54321.\n"
984 msgstr " * Has been fixed for ages, but I forgot to close; closes: #54321.\n"
986 # type: Content of: <chapter><section><section><para>
987 #. type: Content of: <chapter><section><section><para>
988 #: best-pkging-practices.dbk:550
990 "If for some reason you didn't mention the bug number in a previous changelog "
991 "entry, there's no problem, just close the bug normally in the BTS. There's "
992 "no need to touch the changelog file, presuming the description of the fix is "
993 "already in (this applies to the fixes by the upstream authors/maintainers as "
994 "well, you don't have to track bugs that they fixed ages ago in your "
998 # type: Content of: <chapter><section><section><screen>
999 #. type: Content of: <chapter><section><section><screen>
1000 #: best-pkging-practices.dbk:557
1002 msgid " * Closes: #12345, #12346, #15432\n"
1003 msgstr " * Closes: #12345, #12346, #15432\n"
1005 # type: Content of: <chapter><section><section><para>
1006 #. type: Content of: <chapter><section><section><para>
1007 #: best-pkging-practices.dbk:560
1009 "Where's the description? If you can't think of a descriptive message, start "
1010 "by inserting the title of each different bug."
1012 "説明はどこ? 説明文を考えられないのなら、それぞれのバグのタイトルを入れるところ"
1015 #. type: Content of: <chapter><section><section><title>
1016 #: best-pkging-practices.dbk:566
1018 msgid "Supplementing changelogs with <filename>NEWS.Debian</filename> files"
1019 msgstr "<filename>NEWS.Debian</filename> ファイルで changelog を"
1021 #. type: Content of: <chapter><section><section><para>
1022 #: best-pkging-practices.dbk:568
1024 "Important news about changes in a package can also be put in <filename>NEWS."
1025 "Debian</filename> files. The news will be displayed by tools like "
1026 "<systemitem role=\"package\">apt-listchanges</systemitem>, before all the "
1027 "rest of the changelogs. This is the preferred means to let the user know "
1028 "about significant changes in a package. It is better than using <systemitem "
1029 "role=\"package\">debconf</systemitem> notes since it is less annoying and "
1030 "the user can go back and refer to the <filename>NEWS.Debian</filename> file "
1031 "after the install. And it's better than listing major changes in "
1032 "<filename>README.Debian</filename>, since the user can easily miss such "
1036 #. type: Content of: <chapter><section><section><para>
1037 #: best-pkging-practices.dbk:579
1039 "The file format is the same as a debian changelog file, but leave off the "
1040 "asterisks and describe each news item with a full paragraph when necessary "
1041 "rather than the more concise summaries that would go in a changelog. It's a "
1042 "good idea to run your file through <literal>dpkg-parsechangelog</literal> to "
1043 "check its formatting as it will not be automatically checked during build as "
1044 "the changelog is. Here is an example of a real <filename>NEWS.Debian</"
1048 # type: Content of: <chapter><section><section><screen>
1049 #. type: Content of: <chapter><section><section><screen>
1050 #: best-pkging-practices.dbk:588
1053 "cron (3.0pl1-74) unstable; urgency=low\n"
1055 " The checksecurity script is no longer included with the cron package:\n"
1056 " it now has its own package, checksecurity. If you liked the\n"
1057 " functionality provided with that script, please install the new\n"
1060 " -- Steve Greenland <stevegr@debian.org> Sat, 6 Sep 2003 17:15:03 -0500\n"
1062 "cron (3.0pl1-74) unstable; urgency=low\n"
1064 " The checksecurity script is no longer included with the cron package:\n"
1065 " it now has its own package, checksecurity. If you liked the\n"
1066 " functionality provided with that script, please install the new\n"
1069 " -- Steve Greenland <stevegr@debian.org> Sat, 6 Sep 2003 17:15:03 -0500\n"
1071 #. type: Content of: <chapter><section><section><para>
1072 #: best-pkging-practices.dbk:598
1074 "The <filename>NEWS.Debian</filename> file is installed as <filename>/usr/"
1075 "share/doc/<replaceable>package</replaceable>/NEWS.Debian.gz</filename>. It "
1076 "is compressed, and always has that name even in Debian native packages. If "
1077 "you use <literal>debhelper</literal>, <literal>dh_installchangelogs</"
1078 "literal> will install <filename>debian/NEWS</filename> files for you."
1081 # type: Content of: <chapter><section><section><para>
1082 #. type: Content of: <chapter><section><section><para>
1083 #: best-pkging-practices.dbk:605
1085 "Unlike changelog files, you need not update <filename>NEWS.Debian</filename> "
1086 "files with every release. Only update them if you have something "
1087 "particularly newsworthy that user should know about. If you have no news at "
1088 "all, there's no need to ship a <filename>NEWS.Debian</filename> file in your "
1089 "package. No news is good news!"
1092 # type: Content of: <chapter><section><title>
1093 #. type: Content of: <chapter><section><title>
1094 #: best-pkging-practices.dbk:627
1095 msgid "Best practices for maintainer scripts"
1096 msgstr "メンテナスクリプトのベストプラクティス"
1098 # type: Content of: <chapter><section><para>
1099 #. type: Content of: <chapter><section><para>
1100 #: best-pkging-practices.dbk:629
1102 "Maintainer scripts include the files <filename>debian/postinst</filename>, "
1103 "<filename>debian/preinst</filename>, <filename>debian/prerm</filename> and "
1104 "<filename>debian/postrm</filename>. These scripts take care of any package "
1105 "installation or deinstallation setup which isn't handled merely by the "
1106 "creation or removal of files and directories. The following instructions "
1107 "supplement the <ulink url=\"&url-debian-policy;\">Debian Policy</ulink>."
1110 # type: Content of: <chapter><section><para>
1111 #. type: Content of: <chapter><section><para>
1112 #: best-pkging-practices.dbk:637
1114 "Maintainer scripts must be idempotent. That means that you need to make "
1115 "sure nothing bad will happen if the script is called twice where it would "
1116 "usually be called once."
1119 # type: Content of: <chapter><section><para>
1120 #. type: Content of: <chapter><section><para>
1121 #: best-pkging-practices.dbk:642
1123 "Standard input and output may be redirected (e.g. into pipes) for logging "
1124 "purposes, so don't rely on them being a tty."
1127 # type: Content of: <chapter><section><para>
1128 #. type: Content of: <chapter><section><para>
1129 #: best-pkging-practices.dbk:646
1131 "All prompting or interactive configuration should be kept to a minimum. "
1132 "When it is necessary, you should use the <systemitem role=\"package"
1133 "\">debconf</systemitem> package for the interface. Remember that prompting "
1134 "in any case can only be in the <literal>configure</literal> stage of the "
1135 "<filename>postinst</filename> script."
1138 # type: Content of: <chapter><section><para>
1139 #. type: Content of: <chapter><section><para>
1140 #: best-pkging-practices.dbk:653
1142 "Keep the maintainer scripts as simple as possible. We suggest you use pure "
1143 "POSIX shell scripts. Remember, if you do need any bash features, the "
1144 "maintainer script must have a bash shebang line. POSIX shell or Bash are "
1145 "preferred to Perl, since they enable <systemitem role=\"package\">debhelper</"
1146 "systemitem> to easily add bits to the scripts."
1149 # type: Content of: <chapter><section><para>
1150 #. type: Content of: <chapter><section><para>
1151 #: best-pkging-practices.dbk:660
1153 "If you change your maintainer scripts, be sure to test package removal, "
1154 "double installation, and purging. Be sure that a purged package is "
1155 "completely gone, that is, it must remove any files created, directly or "
1156 "indirectly, in any maintainer script."
1159 # type: Content of: <chapter><section><para>
1160 #. type: Content of: <chapter><section><para>
1161 #: best-pkging-practices.dbk:666
1163 "If you need to check for the existence of a command, you should use "
1167 # type: Content of: <chapter><section><programlisting>
1168 #. type: Content of: <chapter><section><programlisting>
1169 #: best-pkging-practices.dbk:669
1171 msgid "if [ -x /usr/sbin/install-docs ]; then ..."
1172 msgstr "if [ -x /usr/sbin/install-docs ]; then ..."
1174 # type: Content of: <chapter><section><para>
1175 #. type: Content of: <chapter><section><para>
1176 #: best-pkging-practices.dbk:671
1178 "If you don't wish to hard-code the path of a command in your maintainer "
1179 "script, the following POSIX-compliant shell function may help:"
1182 #. type: Content of: <chapter><section><para>
1183 #: best-pkging-practices.dbk:676
1185 "You can use this function to search <varname>$PATH</varname> for a command "
1186 "name, passed as an argument. It returns true (zero) if the command was "
1187 "found, and false if not. This is really the most portable way, since "
1188 "<literal>command -v</literal>, <command>type</command>, and <command>which</"
1189 "command> are not POSIX."
1192 # type: Content of: <chapter><section><para>
1193 #. type: Content of: <chapter><section><para>
1194 #: best-pkging-practices.dbk:683
1196 "While <command>which</command> is an acceptable alternative, since it is "
1197 "from the required <systemitem role=\"package\">debianutils</systemitem> "
1198 "package, it's not on the root partition. That is, it's in <filename>/usr/"
1199 "bin</filename> rather than <filename>/bin</filename>, so one can't use it in "
1200 "scripts which are run before the <filename>/usr</filename> partition is "
1201 "mounted. Most scripts won't have this problem, though."
1204 # type: Content of: <chapter><section><title>
1205 #. type: Content of: <chapter><section><title>
1206 #: best-pkging-practices.dbk:693
1208 "Configuration management with <systemitem role=\"package\">debconf</"
1212 # type: Content of: <chapter><section><para>
1213 #. type: Content of: <chapter><section><para>
1214 #: best-pkging-practices.dbk:695
1216 "<systemitem role=\"package\">Debconf</systemitem> is a configuration "
1217 "management system which can be used by all the various packaging scripts "
1218 "(<filename>postinst</filename> mainly) to request feedback from the user "
1219 "concerning how to configure the package. Direct user interactions must now "
1220 "be avoided in favor of <systemitem role=\"package\">debconf</systemitem> "
1221 "interaction. This will enable non-interactive installations in the future."
1224 # type: Content of: <chapter><section><para>
1225 #. type: Content of: <chapter><section><para>
1226 #: best-pkging-practices.dbk:703
1228 "Debconf is a great tool but it is often poorly used. Many common mistakes "
1229 "are listed in the <citerefentry> <refentrytitle>debconf-devel</"
1230 "refentrytitle> <manvolnum>7</manvolnum> </citerefentry> man page. It is "
1231 "something that you must read if you decide to use debconf. Also, we "
1232 "document some best practices here."
1235 # type: Content of: <chapter><section><para>
1236 #. type: Content of: <chapter><section><para>
1237 #: best-pkging-practices.dbk:710
1239 "These guidelines include some writing style and typography recommendations, "
1240 "general considerations about debconf usage as well as more specific "
1241 "recommendations for some parts of the distribution (the installation system "
1245 # type: Content of: <chapter><section><section><title>
1246 #. type: Content of: <chapter><section><section><title>
1247 #: best-pkging-practices.dbk:716
1248 msgid "Do not abuse debconf"
1249 msgstr "debconf を乱用しない"
1251 # type: Content of: <chapter><section><section><para>
1252 #. type: Content of: <chapter><section><section><para>
1253 #: best-pkging-practices.dbk:718
1255 "Since debconf appeared in Debian, it has been widely abused and several "
1256 "criticisms received by the Debian distribution come from debconf abuse with "
1257 "the need of answering a wide bunch of questions before getting any little "
1261 #. type: Content of: <chapter><section><section><para>
1262 #: best-pkging-practices.dbk:724
1264 "Keep usage notes to what they belong: the <filename>NEWS.Debian</filename>, "
1265 "or <filename>README.Debian</filename> file. Only use notes for important "
1266 "notes which may directly affect the package usability. Remember that notes "
1267 "will always block the install until confirmed or bother the user by email."
1270 # type: Content of: <chapter><section><section><para>
1271 #. type: Content of: <chapter><section><section><para>
1272 #: best-pkging-practices.dbk:730
1274 "Carefully choose the questions priorities in maintainer scripts. See "
1275 "<citerefentry> <refentrytitle>debconf-devel</refentrytitle> <manvolnum>7</"
1276 "manvolnum> </citerefentry> for details about priorities. Most questions "
1277 "should use medium and low priorities."
1280 # type: Content of: <chapter><section><section><title>
1281 #. type: Content of: <chapter><section><section><title>
1282 #: best-pkging-practices.dbk:738
1283 msgid "General recommendations for authors and translators"
1286 # type: Content of: <chapter><section><section><section><title>
1287 #. type: Content of: <chapter><section><section><section><title>
1288 #: best-pkging-practices.dbk:740
1289 msgid "Write correct English"
1292 # type: Content of: <chapter><section><section><section><para>
1293 #. type: Content of: <chapter><section><section><section><para>
1294 #: best-pkging-practices.dbk:742
1296 "Most Debian package maintainers are not native English speakers. So, "
1297 "writing properly phrased templates may not be easy for them."
1300 # type: Content of: <chapter><section><section><section><para>
1301 #. type: Content of: <chapter><section><section><section><para>
1302 #: best-pkging-practices.dbk:746
1304 "Please use (and abuse) &email-debian-l10n-english; mailing list. Have your "
1305 "templates proofread."
1308 #. type: Content of: <chapter><section><section><section><para>
1309 #: best-pkging-practices.dbk:750
1311 "Badly written templates give a poor image of your package, of your work... "
1312 "or even of Debian itself."
1315 # type: Content of: <chapter><section><section><section><para>
1316 #. type: Content of: <chapter><section><section><section><para>
1317 #: best-pkging-practices.dbk:754
1319 "Avoid technical jargon as much as possible. If some terms sound common to "
1320 "you, they may be impossible to understand for others. If you cannot avoid "
1321 "them, try to explain them (use the extended description). When doing so, "
1322 "try to balance between verbosity and simplicity."
1325 # type: Content of: <chapter><section><section><section><title>
1326 #. type: Content of: <chapter><section><section><section><title>
1327 #: best-pkging-practices.dbk:762
1328 msgid "Be kind to translators"
1331 # type: Content of: <chapter><section><section><section><para>
1332 #. type: Content of: <chapter><section><section><section><para>
1333 #: best-pkging-practices.dbk:764
1335 "Debconf templates may be translated. Debconf, along with its sister package "
1336 "<command>po-debconf</command> offers a simple framework for getting "
1337 "templates translated by translation teams or even individuals."
1340 #. type: Content of: <chapter><section><section><section><para>
1341 #: best-pkging-practices.dbk:769
1343 "Please use gettext-based templates. Install <systemitem role=\"package\">po-"
1344 "debconf</systemitem> on your development system and read its documentation "
1345 "(<command>man po-debconf</command> is a good start)."
1348 #. type: Content of: <chapter><section><section><section><para>
1349 #: best-pkging-practices.dbk:774
1351 "Avoid changing templates too often. Changing templates text induces more "
1352 "work to translators which will get their translation fuzzied. A fuzzy "
1353 "translation is a string for which the original changed since it was "
1354 "translated, therefore requiring some update by a translator to be usable. "
1355 "When changes are small enough, the original translation is kept in PO files "
1356 "but marked as <literal>fuzzy</literal>."
1359 #. type: Content of: <chapter><section><section><section><para>
1360 #: best-pkging-practices.dbk:782
1362 "If you plan to do changes to your original templates, please use the "
1363 "notification system provided with the <systemitem role=\"package\">po-"
1364 "debconf</systemitem> package, namely the <command>podebconf-report-po</"
1365 "command>, to contact translators. Most active translators are very "
1366 "responsive and getting their work included along with your modified "
1367 "templates will save you additional uploads. If you use gettext-based "
1368 "templates, the translator's name and e-mail addresses are mentioned in the "
1369 "PO files headers and will be used by <command>podebconf-report-po</command>."
1372 #. type: Content of: <chapter><section><section><section><para>
1373 #: best-pkging-practices.dbk:794
1374 msgid "A recommended use of that utility is:"
1377 #. type: Content of: <chapter><section><section><section><programlisting>
1378 #: best-pkging-practices.dbk:796
1380 msgid "cd debian/po && podebconf-report-po --call --languageteam --withtranslators --deadline=\"+10 days\""
1383 #. type: Content of: <chapter><section><section><section><para>
1384 #: best-pkging-practices.dbk:798
1386 "This command will first synchronize the PO and POT files in <filename>debian/"
1387 "po</filename> with the templates files listed in <filename>debian/po/"
1388 "POTFILES.in</filename>. Then, it will send a call for new translations, in "
1389 "the &email-debian-i18n; mailing list. Finally, it will also send a call for "
1390 "translation updates to the language team (mentioned in the <literal>Language-"
1391 "Team</literal> field of each PO file) as well as the last translator "
1392 "(mentioned in <literal>Last-translator</literal>)."
1395 #. type: Content of: <chapter><section><section><section><para>
1396 #: best-pkging-practices.dbk:807
1398 "Giving a deadline to translators is always appreciated, so that they can "
1399 "organize their work. Please remember that some translation teams have a "
1400 "formalized translate/review process and a delay lower than 10 days is "
1401 "considered as unreasonable. A shorter delay puts too much pressure on "
1402 "translation teams and should be kept for very minor changes."
1405 # type: Content of: <chapter><section><section><section><para>
1406 #. type: Content of: <chapter><section><section><section><para>
1407 #: best-pkging-practices.dbk:814
1409 "If in doubt, you may also contact the translation team for a given language "
1410 "(debian-l10n-xxxxx@&lists-host;), or the &email-debian-i18n; mailing list."
1413 # type: Content of: <chapter><section><section><section><title>
1414 #. type: Content of: <chapter><section><section><section><title>
1415 #: best-pkging-practices.dbk:821
1416 msgid "Unfuzzy complete translations when correcting typos and spelling"
1419 #. type: Content of: <chapter><section><section><section><para>
1420 #: best-pkging-practices.dbk:823
1422 "When the text of a debconf template is corrected and you are <emphasis role="
1423 "\"strong\">sure</emphasis> that the change does <emphasis role=\"strong"
1424 "\">not</emphasis> affect translations, please be kind to translators and "
1425 "<emphasis>unfuzzy</emphasis> their translations."
1428 # type: Content of: <chapter><section><section><section><para>
1429 #. type: Content of: <chapter><section><section><section><para>
1430 #: best-pkging-practices.dbk:829
1432 "If you don't do so, the whole template will not be translated as long as a "
1433 "translator will send you an update."
1436 #. type: Content of: <chapter><section><section><section><para>
1437 #: best-pkging-practices.dbk:833
1439 "To <emphasis>unfuzzy</emphasis> translations, you can use two methods. The "
1440 "first method does <emphasis>preventive</emphasis> search and replace actions "
1441 "in the PO files. The latter uses <command>gettext</command> utilities to "
1442 "<emphasis>unfuzzy</emphasis> strings."
1445 #. type: Content of: <chapter><section><section><section><para>
1446 #: best-pkging-practices.dbk:839
1447 msgid "<emphasis>Preventive unfuzzy</emphasis> method:"
1450 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1451 #: best-pkging-practices.dbk:844
1453 "Try finding a complete translation file <emphasis role=\"strong\">before</"
1454 "emphasis> the change:"
1457 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1458 #: best-pkging-practices.dbk:847 best-pkging-practices.dbk:918
1460 msgid "for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done"
1463 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1464 #: best-pkging-practices.dbk:849
1466 "The file only showing <emphasis>translated</emphasis> items will be used as "
1467 "the reference file. If there is none (which should not happen if you take "
1468 "care to properly interact with translators), you should use the file with "
1469 "the most translated strings."
1472 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1473 #: best-pkging-practices.dbk:857
1475 "Identify the needed change. In this example, let's assume the change is "
1476 "about fixing a typo in the word <literal>typo</literal> which was "
1477 "inadvertently written as <literal>tpyo</literal>. Therefore, the change is "
1478 "<command>s/tpyo/typo</command>."
1481 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1482 #: best-pkging-practices.dbk:865
1484 "Check that this change is only applied to the place where you really intend "
1485 "to make it and <emphasis role=\"strong\">not</emphasis> in any other place "
1486 "where the original string is appropriate. This specifically applies to "
1487 "change in punctuation, for instance."
1490 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1491 #: best-pkging-practices.dbk:873
1493 "Modify all PO files by using <command>sed</command>. The use of that command "
1494 "is recommended over any text editor to guarantee that the files encoding "
1495 "will not be broken by the edit action:"
1498 # type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1499 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1500 #: best-pkging-practices.dbk:878
1504 "for i in *.po; do sed -i 's/tpyo/typo/g' $i; done\n"
1507 "for i in *.po; do sed -i 's/tpyo/typo/g' $i; done\n"
1509 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1510 #: best-pkging-practices.dbk:884
1511 msgid "Change the debconf template file to fix the typo."
1514 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1515 #: best-pkging-practices.dbk:889
1516 msgid "Run <command>debconf-updatepo</command>."
1517 msgstr "<command>debconf-updatepo</command> を実行する。"
1519 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1520 #: best-pkging-practices.dbk:894
1522 "Check the <filename>foo.po</filename> reference file. Its statistics should "
1526 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1527 #: best-pkging-practices.dbk:898
1529 msgid "msgfmt -o /dev/null --statistics debian/po/foo.po\n"
1530 msgstr "msgfmt -o /dev/null --statistics debian/po/foo.po\n"
1532 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1533 #: best-pkging-practices.dbk:903
1535 "If the file's statistics changed, you did something wrong. Try again or ask "
1536 "for help on the &email-debian-i18n; mailing list."
1539 #. type: Content of: <chapter><section><section><section><para>
1540 #: best-pkging-practices.dbk:909
1541 msgid "Gettext utilities method:"
1542 msgstr "gettext ユーティリティを使う方法:"
1544 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1545 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1546 #: best-pkging-practices.dbk:914
1548 "Put all incomplete PO files out of the way. You can check the completeness "
1549 "by using (needs the <systemitem role=\"package\">gettext</systemitem> "
1550 "package installed):"
1553 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1554 #: best-pkging-practices.dbk:922
1556 "Move all files which report either fuzzy strings to a temporary place. "
1557 "Files which report no fuzzy strings (only translated and untranslated) will "
1561 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1562 #: best-pkging-practices.dbk:929
1564 "Now <emphasis role=\"strong\">and now only</emphasis>, modify the template "
1565 "for the typos and check again that translation are not impacted (typos, "
1566 "spelling errors, sometimes typographical corrections are usually OK)."
1569 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1570 #: best-pkging-practices.dbk:936
1572 "Run <command>debconf-updatepo</command>. This will fuzzy all strings you "
1573 "modified in translations. You can see this by running the above again."
1576 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1577 #: best-pkging-practices.dbk:942
1578 msgid "Use the following command:"
1581 # type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1582 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1583 #: best-pkging-practices.dbk:944
1585 msgid "for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done"
1586 msgstr "for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done"
1588 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1589 #: best-pkging-practices.dbk:948
1591 "Move back to <filename>debian/po</filename> the files which showed fuzzy "
1592 "strings in the first step."
1595 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1596 #: best-pkging-practices.dbk:953
1597 msgid "Run <command>debconf-updatepo</command> again."
1600 # type: Content of: <chapter><section><section><section><title>
1601 #. type: Content of: <chapter><section><section><section><title>
1602 #: best-pkging-practices.dbk:960
1603 msgid "Do not make assumptions about interfaces"
1606 #. type: Content of: <chapter><section><section><section><para>
1607 #: best-pkging-practices.dbk:962
1609 "Templates text should not make reference to widgets belonging to some "
1610 "debconf interfaces. Sentences like <emphasis>If you answer Yes...</"
1611 "emphasis> have no meaning for users of graphical interfaces which use "
1612 "checkboxes for boolean questions."
1615 # type: Content of: <chapter><section><section><section><para>
1616 #. type: Content of: <chapter><section><section><section><para>
1617 #: best-pkging-practices.dbk:967
1619 "String templates should also avoid mentioning the default values in their "
1620 "description. First, because this is redundant with the values seen by the "
1621 "users. Also, because these default values may be different from the "
1622 "maintainer choices (for instance, when the debconf database was preseeded)."
1625 # type: Content of: <chapter><section><section><section><para>
1626 #. type: Content of: <chapter><section><section><section><para>
1627 #: best-pkging-practices.dbk:973
1629 "More generally speaking, try to avoid referring to user actions. Just give "
1633 # type: Content of: <chapter><section><section><section><title>
1634 #. type: Content of: <chapter><section><section><section><title>
1635 #: best-pkging-practices.dbk:979
1636 msgid "Do not use first person"
1639 #. type: Content of: <chapter><section><section><section><para>
1640 #: best-pkging-practices.dbk:981
1642 "You should avoid the use of first person (<emphasis>I will do this...</"
1643 "emphasis> or <emphasis>We recommend...</emphasis>). The computer is not a "
1644 "person and the Debconf templates do not speak for the Debian developers. "
1645 "You should use neutral construction. Those of you who already wrote "
1646 "scientific publications, just write your templates like you would write a "
1647 "scientific paper. However, try using active voice if still possible, like "
1648 "<emphasis>Enable this if ...</emphasis> instead of <emphasis>This can be "
1649 "enabled if...</emphasis>."
1652 # type: Content of: <chapter><section><section><section><title>
1653 #. type: Content of: <chapter><section><section><section><title>
1654 #: best-pkging-practices.dbk:991
1655 msgid "Be gender neutral"
1658 # type: Content of: <chapter><section><section><section><para>
1659 #. type: Content of: <chapter><section><section><section><para>
1660 #: best-pkging-practices.dbk:993
1662 "The world is made of men and women. Please use gender-neutral constructions "
1666 # type: Content of: <chapter><section><section><title>
1667 #. type: Content of: <chapter><section><section><title>
1668 #: best-pkging-practices.dbk:1001
1669 msgid "Templates fields definition"
1672 # type: Content of: <chapter><section><section><para>
1673 #. type: Content of: <chapter><section><section><para>
1674 #: best-pkging-practices.dbk:1003
1676 "This part gives some information which is mostly taken from the "
1677 "<citerefentry> <refentrytitle>debconf-devel</refentrytitle> <manvolnum>7</"
1678 "manvolnum> </citerefentry> manual page."
1681 # type: Content of: <chapter><section><section><section><title>
1682 #. type: Content of: <chapter><section><section><section><title>
1683 #: best-pkging-practices.dbk:1008
1687 #. type: Content of: <chapter><section><section><section><section><title>
1688 #: best-pkging-practices.dbk:1010
1692 # type: Content of: <chapter><section><section><section><section><para>
1693 #. type: Content of: <chapter><section><section><section><section><para>
1694 #: best-pkging-practices.dbk:1012
1696 "Results in a free-form input field that the user can type any string into."
1699 #. type: Content of: <chapter><section><section><section><section><title>
1700 #: best-pkging-practices.dbk:1017
1704 # type: Content of: <chapter><section><section><section><section><para>
1705 #. type: Content of: <chapter><section><section><section><section><para>
1706 #: best-pkging-practices.dbk:1019
1708 "Prompts the user for a password. Use this with caution; be aware that the "
1709 "password the user enters will be written to debconf's database. You should "
1710 "probably clean that value out of the database as soon as is possible."
1713 #. type: Content of: <chapter><section><section><section><section><title>
1714 #: best-pkging-practices.dbk:1026
1718 # type: Content of: <chapter><section><section><section><section><para>
1719 #. type: Content of: <chapter><section><section><section><section><para>
1720 #: best-pkging-practices.dbk:1028
1722 "A true/false choice. Remember: true/false, <emphasis role=\"strong\">not "
1723 "yes/no</emphasis>..."
1726 #. type: Content of: <chapter><section><section><section><section><title>
1727 #: best-pkging-practices.dbk:1034
1731 #. type: Content of: <chapter><section><section><section><section><para>
1732 #: best-pkging-practices.dbk:1036
1734 "A choice between one of a number of values. The choices must be specified "
1735 "in a field named 'Choices'. Separate the possible values with commas and "
1736 "spaces, like this: <literal>Choices: yes, no, maybe</literal>."
1739 #. type: Content of: <chapter><section><section><section><section><para>
1740 #: best-pkging-practices.dbk:1041
1742 "If choices are translatable strings, the 'Choices' field may be marked as "
1743 "translatable by using <literal>__Choices</literal>. The double underscore "
1744 "will split out each choice in a separate string."
1747 #. type: Content of: <chapter><section><section><section><section><para>
1748 #: best-pkging-practices.dbk:1046
1750 "The <command>po-debconf</command> system also offers interesting "
1751 "possibilities to only mark <emphasis role=\"strong\">some</emphasis> choices "
1752 "as translatable. Example:"
1755 #. type: Content of: <chapter><section><section><section><section><programlisting>
1756 #: best-pkging-practices.dbk:1051
1759 "Template: foo/bar\n"
1761 "#flag:translate:3\n"
1762 "__Choices: PAL, SECAM, Other\n"
1763 "_Description: TV standard:\n"
1764 " Please choose the TV standard used in your country.\n"
1766 "Template: foo/bar\n"
1768 "#flag:translate:3\n"
1769 "__Choices: PAL, SECAM, Other\n"
1770 "_Description: TV standard:\n"
1771 " Please choose the TV standard used in your country.\n"
1773 #. type: Content of: <chapter><section><section><section><section><para>
1774 #: best-pkging-practices.dbk:1059
1776 "In that example, only the 'Other' string is translatable while others are "
1777 "acronyms that should not be translated. The above allows only 'Other' to be "
1778 "included in PO and POT files."
1781 #. type: Content of: <chapter><section><section><section><section><para>
1782 #: best-pkging-practices.dbk:1064
1784 "The debconf templates flag system offers many such possibilities. The "
1785 "<citerefentry> <refentrytitle>po-debconf</refentrytitle> <manvolnum>7</"
1786 "manvolnum> </citerefentry> manual page lists all these possibilities."
1789 #. type: Content of: <chapter><section><section><section><section><title>
1790 #: best-pkging-practices.dbk:1072
1792 msgstr "multiselect"
1794 # type: Content of: <chapter><section><section><section><section><para>
1795 #. type: Content of: <chapter><section><section><section><section><para>
1796 #: best-pkging-practices.dbk:1074
1798 "Like the select data type, except the user can choose any number of items "
1799 "from the choices list (or chose none of them)."
1802 #. type: Content of: <chapter><section><section><section><section><title>
1803 #: best-pkging-practices.dbk:1080
1807 # type: Content of: <chapter><section><section><section><section><para>
1808 #. type: Content of: <chapter><section><section><section><section><para>
1809 #: best-pkging-practices.dbk:1082
1811 "Rather than being a question per se, this datatype indicates a note that can "
1812 "be displayed to the user. It should be used only for important notes that "
1813 "the user really should see, since debconf will go to great pains to make "
1814 "sure the user sees it; halting the install for them to press a key, and even "
1815 "mailing the note to them in some cases."
1818 #. type: Content of: <chapter><section><section><section><section><title>
1819 #: best-pkging-practices.dbk:1091
1823 # type: Content of: <chapter><section><section><section><section><para>
1824 #. type: Content of: <chapter><section><section><section><section><para>
1825 #: best-pkging-practices.dbk:1093
1826 msgid "This type is now considered obsolete: don't use it."
1829 #. type: Content of: <chapter><section><section><section><section><title>
1830 #: best-pkging-practices.dbk:1098
1834 # type: Content of: <chapter><section><section><section><section><para>
1835 #. type: Content of: <chapter><section><section><section><section><para>
1836 #: best-pkging-practices.dbk:1100
1838 "This type is designed to handle error messages. It is mostly similar to the "
1839 "note type. Frontends may present it differently (for instance, the dialog "
1840 "frontend of cdebconf draws a red screen instead of the usual blue one)."
1843 # type: Content of: <chapter><section><section><section><section><para>
1844 #. type: Content of: <chapter><section><section><section><section><para>
1845 #: best-pkging-practices.dbk:1105
1847 "It is recommended to use this type for any message that needs user attention "
1848 "for a correction of any kind."
1851 # type: Content of: <chapter><section><section><section><title>
1852 #. type: Content of: <chapter><section><section><section><title>
1853 #: best-pkging-practices.dbk:1113
1854 msgid "Description: short and extended description"
1857 # type: Content of: <chapter><section><section><section><para>
1858 #. type: Content of: <chapter><section><section><section><para>
1859 #: best-pkging-practices.dbk:1115
1861 "Template descriptions have two parts: short and extended. The short "
1862 "description is in the Description: line of the template."
1865 # type: Content of: <chapter><section><section><section><para>
1866 #. type: Content of: <chapter><section><section><section><para>
1867 #: best-pkging-practices.dbk:1119
1869 "The short description should be kept short (50 characters or so) so that it "
1870 "may be accommodated by most debconf interfaces. Keeping it short also helps "
1871 "translators, as usually translations tend to end up being longer than the "
1875 # type: Content of: <chapter><section><section><section><para>
1876 #. type: Content of: <chapter><section><section><section><para>
1877 #: best-pkging-practices.dbk:1125
1879 "The short description should be able to stand on its own. Some interfaces "
1880 "do not show the long description by default, or only if the user explicitely "
1881 "asks for it or even do not show it at all. Avoid things like What do you "
1885 # type: Content of: <chapter><section><section><section><para>
1886 #. type: Content of: <chapter><section><section><section><para>
1887 #: best-pkging-practices.dbk:1131
1889 "The short description does not necessarily have to be a full sentence. This "
1890 "is part of the keep it short and efficient recommendation."
1893 # type: Content of: <chapter><section><section><section><para>
1894 #. type: Content of: <chapter><section><section><section><para>
1895 #: best-pkging-practices.dbk:1135
1897 "The extended description should not repeat the short description word for "
1898 "word. If you can't think up a long description, then first, think some "
1899 "more. Post to debian-devel. Ask for help. Take a writing class! That "
1900 "extended description is important. If after all that you still can't come "
1901 "up with anything, leave it blank."
1904 # type: Content of: <chapter><section><section><section><para>
1905 #. type: Content of: <chapter><section><section><section><para>
1906 #: best-pkging-practices.dbk:1142
1908 "The extended description should use complete sentences. Paragraphs should "
1909 "be kept short for improved readability. Do not mix two ideas in the same "
1910 "paragraph but rather use another paragraph."
1913 # type: Content of: <chapter><section><section><section><para>
1914 #. type: Content of: <chapter><section><section><section><para>
1915 #: best-pkging-practices.dbk:1147
1917 "Don't be too verbose. User tend to ignore too long screens. 20 lines are "
1918 "by experience a border you shouldn't cross, because that means that in the "
1919 "classical dialog interface, people will need to scroll, and lot of people "
1920 "just don't do that."
1923 # type: Content of: <chapter><section><section><section><para>
1924 #. type: Content of: <chapter><section><section><section><para>
1925 #: best-pkging-practices.dbk:1153
1927 "The extended description should <emphasis role=\"strong\">never</emphasis> "
1928 "include a question."
1931 # type: Content of: <chapter><section><section><section><para>
1932 #. type: Content of: <chapter><section><section><section><para>
1933 #: best-pkging-practices.dbk:1157
1935 "For specific rules depending on templates type (string, boolean, etc.), "
1936 "please read below."
1939 # type: Content of: <chapter><section><section><section><title>
1940 #. type: Content of: <chapter><section><section><section><title>
1941 #: best-pkging-practices.dbk:1163
1945 #. type: Content of: <chapter><section><section><section><para>
1946 #: best-pkging-practices.dbk:1165
1948 "This field should be used for select and multiselect types. It contains the "
1949 "possible choices which will be presented to users. These choices should be "
1950 "separated by commas."
1953 # type: Content of: <chapter><section><section><section><title>
1954 #. type: Content of: <chapter><section><section><section><title>
1955 #: best-pkging-practices.dbk:1172
1959 # type: Content of: <chapter><section><section><section><para>
1960 #. type: Content of: <chapter><section><section><section><para>
1961 #: best-pkging-practices.dbk:1174
1963 "This field is optional. It contains the default answer for string, select "
1964 "and multiselect templates. For multiselect templates, it may contain a "
1965 "comma-separated list of choices."
1968 # type: Content of: <chapter><section><section><title>
1969 #. type: Content of: <chapter><section><section><title>
1970 #: best-pkging-practices.dbk:1183
1971 msgid "Templates fields specific style guide"
1974 # type: Content of: <chapter><section><section><section><title>
1975 #. type: Content of: <chapter><section><section><section><title>
1976 #: best-pkging-practices.dbk:1185
1980 # type: Content of: <chapter><section><section><section><para>
1981 #. type: Content of: <chapter><section><section><section><para>
1982 #: best-pkging-practices.dbk:1187
1984 "No specific indication except: use the appropriate type by referring to the "
1988 # type: Content of: <chapter><section><section><section><title>
1989 #. type: Content of: <chapter><section><section><section><title>
1990 #: best-pkging-practices.dbk:1193
1991 msgid "Description field"
1994 # type: Content of: <chapter><section><section><section><para>
1995 #. type: Content of: <chapter><section><section><section><para>
1996 #: best-pkging-practices.dbk:1195
1998 "Below are specific instructions for properly writing the Description (short "
1999 "and extended) depending on the template type."
2002 # type: Content of: <chapter><section><section><section><section><title>
2003 #. type: Content of: <chapter><section><section><section><section><title>
2004 #: best-pkging-practices.dbk:1199
2005 msgid "String/password templates"
2008 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2009 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2010 #: best-pkging-practices.dbk:1203
2012 "The short description is a prompt and <emphasis role=\"strong\">not</"
2013 "emphasis> a title. Avoid question style prompts (IP Address?) in favour of "
2014 "opened prompts (IP address:). The use of colons is recommended."
2017 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2018 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2019 #: best-pkging-practices.dbk:1210
2021 "The extended description is a complement to the short description. In the "
2022 "extended part, explain what is being asked, rather than ask the same "
2023 "question again using longer words. Use complete sentences. Terse writing "
2024 "style is strongly discouraged."
2027 # type: Content of: <chapter><section><section><section><section><title>
2028 #. type: Content of: <chapter><section><section><section><section><title>
2029 #: best-pkging-practices.dbk:1220
2030 msgid "Boolean templates"
2033 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2034 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2035 #: best-pkging-practices.dbk:1224
2037 "The short description should be phrased in the form of a question which "
2038 "should be kept short and should generally end with a question mark. Terse "
2039 "writing style is permitted and even encouraged if the question is rather "
2040 "long (remember that translations are often longer than original versions)."
2043 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2044 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2045 #: best-pkging-practices.dbk:1232
2047 "Again, please avoid referring to specific interface widgets. A common "
2048 "mistake for such templates is if you answer Yes-type constructions."
2051 # type: Content of: <chapter><section><section><section><section><title>
2052 #. type: Content of: <chapter><section><section><section><section><title>
2053 #: best-pkging-practices.dbk:1240
2054 msgid "Select/Multiselect"
2057 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2058 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2059 #: best-pkging-practices.dbk:1244
2061 "The short description is a prompt and <emphasis role=\"strong\">not</"
2062 "emphasis> a title. Do <emphasis role=\"strong\">not</emphasis> use useless "
2063 "Please choose... constructions. Users are clever enough to figure out they "
2064 "have to choose something...:)"
2067 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2068 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2069 #: best-pkging-practices.dbk:1252
2071 "The extended description will complete the short description. It may refer "
2072 "to the available choices. It may also mention that the user may choose more "
2073 "than one of the available choices, if the template is a multiselect one "
2074 "(although the interface often makes this clear)."
2077 # type: Content of: <chapter><section><section><section><section><title>
2078 #. type: Content of: <chapter><section><section><section><section><title>
2079 #: best-pkging-practices.dbk:1262
2083 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2084 #: best-pkging-practices.dbk:1266
2086 "The short description should be considered to be a <emphasis role=\"strong"
2087 "\">title</emphasis>."
2090 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2091 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2092 #: best-pkging-practices.dbk:1271
2094 "The extended description is what will be displayed as a more detailed "
2095 "explanation of the note. Phrases, no terse writing style."
2098 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2099 #: best-pkging-practices.dbk:1277
2101 "<emphasis role=\"strong\">Do not abuse debconf.</emphasis> Notes are the "
2102 "most common way to abuse debconf. As written in debconf-devel manual page: "
2103 "it's best to use them only for warning about very serious problems. The "
2104 "<filename>NEWS.Debian</filename> or <filename>README.Debian</filename> files "
2105 "are the appropriate location for a lot of notes. If, by reading this, you "
2106 "consider converting your Note type templates to entries in <filename>NEWS."
2107 "Debian</filename> or <filename>README.Debian</filename>, plus consider "
2108 "keeping existing translations for the future."
2111 # type: Content of: <chapter><section><section><section><title>
2112 #. type: Content of: <chapter><section><section><section><title>
2113 #: best-pkging-practices.dbk:1292
2114 msgid "Choices field"
2117 # type: Content of: <chapter><section><section><section><para>
2118 #. type: Content of: <chapter><section><section><section><para>
2119 #: best-pkging-practices.dbk:1294
2121 "If the Choices are likely to change often, please consider using the "
2122 "__Choices trick. This will split each individual choice into a single "
2123 "string, which will considerably help translators for doing their work."
2126 # type: Content of: <chapter><section><section><section><title>
2127 #. type: Content of: <chapter><section><section><section><title>
2128 #: best-pkging-practices.dbk:1301 best-pkging-practices.dbk:1339
2129 msgid "Default field"
2132 #. type: Content of: <chapter><section><section><section><para>
2133 #: best-pkging-practices.dbk:1303
2135 "If the default value, for a select template, is likely to vary depending on "
2136 "the user language (for instance, if the choice is a language choice), please "
2137 "use the _Default trick."
2140 #. type: Content of: <chapter><section><section><section><para>
2141 #: best-pkging-practices.dbk:1308
2143 "This special field allow translators to put the most appropriate choice "
2144 "according to their own language. It will become the default choice when "
2145 "their language is used while your own mentioned Default Choice will be used "
2146 "when using English."
2149 # type: Content of: <chapter><section><section><section><para>
2150 #. type: Content of: <chapter><section><section><section><para>
2151 #: best-pkging-practices.dbk:1314
2152 msgid "Example, taken from the geneweb package templates:"
2153 msgstr "geneweb パッケージのテンプレートを例にとってみましょう:"
2155 #. type: Content of: <chapter><section><section><section><screen>
2156 #: best-pkging-practices.dbk:1317
2159 "Template: geneweb/lang\n"
2161 "__Choices: Afrikaans (af), Bulgarian (bg), Catalan (ca), Chinese (zh), Czech (cs), Danish (da), Dutch (nl), English (en), Esperanto (eo), Estonian (et), Finnish (fi), French (fr), German (de), Hebrew (he), Icelandic (is), Italian (it), Latvian (lv), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv)\n"
2162 "# This is the default choice. Translators may put their own language here\n"
2163 "# instead of the default.\n"
2164 "# WARNING : you MUST use the ENGLISH NAME of your language\n"
2165 "# For instance, the french translator will need to put French (fr) here.\n"
2166 "_Default: English[ translators, please see comment in PO files]\n"
2167 "_Description: Geneweb default language:\n"
2169 "Template: geneweb/lang\n"
2171 "__Choices: Afrikaans (af), Bulgarian (bg), Catalan (ca), Chinese (zh), Czech (cs), Danish (da), Dutch (nl), English (en), Esperanto (eo), Estonian (et), Finnish (fi), French (fr), German (de), Hebrew (he), Icelandic (is), Italian (it), Latvian (lv), Norwegian (no), Polish (pl), Portuguese (pt), Romanian (ro), Russian (ru), Spanish (es), Swedish (sv)\n"
2172 "# This is the default choice. Translators may put their own language here\n"
2173 "# instead of the default.\n"
2174 "# WARNING : you MUST use the ENGLISH NAME of your language\n"
2175 "# For instance, the french translator will need to put French (fr) here.\n"
2176 "_Default: English[ translators, please see comment in PO files]\n"
2177 "_Description: Geneweb default language:\n"
2179 # type: Content of: <chapter><section><section><section><para>
2180 #. type: Content of: <chapter><section><section><section><para>
2181 #: best-pkging-practices.dbk:1328
2183 "Note the use of brackets which allow internal comments in debconf fields. "
2184 "Also note the use of comments which will show up in files the translators "
2188 #. type: Content of: <chapter><section><section><section><para>
2189 #: best-pkging-practices.dbk:1333
2191 "The comments are needed as the _Default trick is a bit confusing: the "
2192 "translators may put their own choice"
2195 # type: Content of: <chapter><section><section><section><para>
2196 #. type: Content of: <chapter><section><section><section><para>
2197 #: best-pkging-practices.dbk:1341
2199 "Do NOT use empty default field. If you don't want to use default values, do "
2200 "not use Default at all."
2203 #. type: Content of: <chapter><section><section><section><para>
2204 #: best-pkging-practices.dbk:1345
2206 "If you use po-debconf (and you <emphasis role=\"strong\">should</emphasis>, "
2207 "see <xref linkend=\"s6.5.2.2\"/>), consider making this field translatable, "
2208 "if you think it may be translated."
2211 #. type: Content of: <chapter><section><section><section><para>
2212 #: best-pkging-practices.dbk:1350
2214 "If the default value may vary depending on language/country (for instance "
2215 "the default value for a language choice), consider using the special "
2216 "_Default type documented in <citerefentry> <refentrytitle>po-debconf</"
2217 "refentrytitle> <manvolnum>7</manvolnum> </citerefentry>."
2220 # type: Content of: <chapter><section><title>
2221 #. type: Content of: <chapter><section><title>
2222 #: best-pkging-practices.dbk:1362
2223 msgid "Internationalization"
2226 #. type: Content of: <chapter><section><para>
2227 #: best-pkging-practices.dbk:1364
2229 "This section contains global information for developers to make translators' "
2230 "life easier. More information for translators and developers interrested in "
2231 "internationalization are available in the <ulink url=\"&url-i18n-l10n;"
2232 "\">Internationalisation and localisation in Debian</ulink> documentation."
2235 # type: Content of: <chapter><section><section><title>
2236 #. type: Content of: <chapter><section><section><title>
2237 #: best-pkging-practices.dbk:1371
2238 msgid "Handling debconf translations"
2239 msgstr "debconf の翻訳を取り扱う"
2241 # type: Content of: <chapter><section><section><para>
2242 #. type: Content of: <chapter><section><section><para>
2243 #: best-pkging-practices.dbk:1373
2245 "Like porters, translators have a difficult task. They work on many packages "
2246 "and must collaborate with many different maintainers. Moreover, most of the "
2247 "time, they are not native English speakers, so you may need to be "
2248 "particularly patient with them."
2251 # type: Content of: <chapter><section><section><para>
2252 #. type: Content of: <chapter><section><section><para>
2253 #: best-pkging-practices.dbk:1379
2255 "The goal of <systemitem role=\"package\">debconf</systemitem> was to make "
2256 "packages configuration easier for maintainers and for users. Originally, "
2257 "translation of debconf templates was handled with <command>debconf-"
2258 "mergetemplate</command>. However, that technique is now deprecated; the "
2259 "best way to accomplish <systemitem role=\"package\">debconf</systemitem> "
2260 "internationalization is by using the <systemitem role=\"package\">po-"
2261 "debconf</systemitem> package. This method is easier both for maintainer and "
2262 "translators; transition scripts are provided."
2265 #. type: Content of: <chapter><section><section><para>
2266 #: best-pkging-practices.dbk:1389
2268 "Using <systemitem role=\"package\">po-debconf</systemitem>, the translation "
2269 "is stored in <filename>.po</filename> files (drawing from <command>gettext</"
2270 "command> translation techniques). Special template files contain the "
2271 "original messages and mark which fields are translatable. When you change "
2272 "the value of a translatable field, by calling <command>debconf-updatepo</"
2273 "command>, the translation is marked as needing attention from the "
2274 "translators. Then, at build time, the <command>dh_installdebconf</command> "
2275 "program takes care of all the needed magic to add the template along with "
2276 "the up-to-date translations into the binary packages. Refer to the "
2277 "<citerefentry> <refentrytitle>po-debconf</refentrytitle> <manvolnum>7</"
2278 "manvolnum> </citerefentry> manual page for details."
2281 # type: Content of: <chapter><section><section><title>
2282 #. type: Content of: <chapter><section><section><title>
2283 #: best-pkging-practices.dbk:1405
2284 msgid "Internationalized documentation"
2287 # type: Content of: <chapter><section><section><para>
2288 #. type: Content of: <chapter><section><section><para>
2289 #: best-pkging-practices.dbk:1407
2291 "Internationalizing documentation is crucial for users, but a lot of labor. "
2292 "There's no way to eliminate all that work, but you can make things easier "
2296 #. type: Content of: <chapter><section><section><para>
2297 #: best-pkging-practices.dbk:1412
2299 "If you maintain documentation of any size, it is easier for translators if "
2300 "they have access to a source control system. That lets translators see the "
2301 "differences between two versions of the documentation, so, for instance, "
2302 "they can see what needs to be retranslated. It is recommended that the "
2303 "translated documentation maintain a note about what source control revision "
2304 "the translation is based on. An interesting system is provided by <ulink "
2305 "url=\"&url-i18n-doc-check;\">doc-check</ulink> in the <systemitem role="
2306 "\"package\">debian-installer</systemitem> package, which shows an overview "
2307 "of the translation status for any given language, using structured comments "
2308 "for the current revision of the file to be translated and, for a translated "
2309 "file, the revision of the original file the translation is based on. You "
2310 "might wish to adapt and provide that in your VCS area."
2313 # type: Content of: <chapter><section><section><para>
2314 #. type: Content of: <chapter><section><section><para>
2315 #: best-pkging-practices.dbk:1426
2317 "If you maintain XML or SGML documentation, we suggest that you isolate any "
2318 "language-independent information and define those as entities in a separate "
2319 "file which is included by all the different translations. This makes it "
2320 "much easier, for instance, to keep URLs up to date across multiple files."
2323 #. type: Content of: <chapter><section><section><para>
2324 #: best-pkging-practices.dbk:1432
2326 "Some tools (e.g. <systemitem role=\"package\">po4a</systemitem>, <systemitem "
2327 "role=\"package\">poxml</systemitem>, or the <systemitem role=\"package"
2328 "\">translate-toolkit</systemitem>) are specialized in extracting the "
2329 "translatable material from different formats. They produce PO files, a "
2330 "format quite common to translators, which permits to see what needs to be "
2331 "retranslated when the translated document is updated."
2334 # type: Content of: <chapter><section><title>
2335 #. type: Content of: <chapter><section><title>
2336 #: best-pkging-practices.dbk:1444
2337 msgid "Common packaging situations"
2340 # type: Content of: <chapter><section><section><title>
2341 #. type: Content of: <chapter><section><section><title>
2342 #: best-pkging-practices.dbk:1455
2343 msgid "Packages using <command>autoconf</command>/<command>automake</command>"
2345 "<command>autoconf</command>/<command>automake</command> を使っているパッケー"
2348 # type: Content of: <chapter><section><section><para>
2349 #. type: Content of: <chapter><section><section><para>
2350 #: best-pkging-practices.dbk:1457
2352 "Keeping <command>autoconf</command>'s <filename>config.sub</filename> and "
2353 "<filename>config.guess</filename> files up to date is critical for porters, "
2354 "especially on more volatile architectures. Some very good packaging "
2355 "practices for any package using <command>autoconf</command> and/or "
2356 "<command>automake</command> have been synthesized in &file-bpp-autotools; "
2357 "from the <systemitem role=\"package\">autotools-dev</systemitem> package. "
2358 "You're strongly encouraged to read this file and to follow the given "
2362 # type: Content of: <chapter><section><section><title>
2363 #. type: Content of: <chapter><section><section><title>
2364 #: best-pkging-practices.dbk:1469
2368 # type: Content of: <chapter><section><section><para>
2369 #. type: Content of: <chapter><section><section><para>
2370 #: best-pkging-practices.dbk:1471
2372 "Libraries are always difficult to package for various reasons. The policy "
2373 "imposes many constraints to ease their maintenance and to make sure upgrades "
2374 "are as simple as possible when a new upstream version comes out. Breakage "
2375 "in a library can result in dozens of dependent packages breaking."
2378 # type: Content of: <chapter><section><section><para>
2379 #. type: Content of: <chapter><section><section><para>
2380 #: best-pkging-practices.dbk:1477
2382 "Good practices for library packaging have been grouped in <ulink url=\"&url-"
2383 "libpkg-guide;\">the library packaging guide</ulink>."
2386 # type: Content of: <chapter><section><section><title>
2387 #. type: Content of: <chapter><section><section><title>
2388 #: best-pkging-practices.dbk:1484
2389 msgid "Documentation"
2392 # type: Content of: <chapter><section><section><para>
2393 #. type: Content of: <chapter><section><section><para>
2394 #: best-pkging-practices.dbk:1486
2396 "Be sure to follow the <ulink url=\"&url-debian-policy;ch-docs.html\">Policy "
2397 "on documentation</ulink>."
2400 # type: Content of: <chapter><section><section><para>
2401 #. type: Content of: <chapter><section><section><para>
2402 #: best-pkging-practices.dbk:1491
2404 "If your package contains documentation built from XML or SGML, we recommend "
2405 "you not ship the XML or SGML source in the binary package(s). If users want "
2406 "the source of the documentation, they should retrieve the source package."
2409 # type: Content of: <chapter><section><section><para>
2410 #. type: Content of: <chapter><section><section><para>
2411 #: best-pkging-practices.dbk:1496
2413 "Policy specifies that documentation should be shipped in HTML format. We "
2414 "also recommend shipping documentation in PDF and plain text format if "
2415 "convenient and if output of reasonable quality is possible. However, it is "
2416 "generally not appropriate to ship plain text versions of documentation whose "
2417 "source format is HTML."
2420 # type: Content of: <chapter><section><section><para>
2421 #. type: Content of: <chapter><section><section><para>
2422 #: best-pkging-practices.dbk:1503
2424 "Major shipped manuals should register themselves with <systemitem role="
2425 "\"package\">doc-base</systemitem> on installation. See the <systemitem role="
2426 "\"package\">doc-base</systemitem> package documentation for more information."
2429 #. type: Content of: <chapter><section><section><para>
2430 #: best-pkging-practices.dbk:1509
2432 "Debian policy (section 12.1) directs that manual pages should accompany "
2433 "every program, utility, and function, and suggests them for other objects "
2434 "like configuration files. If the work you are packaging does not have such "
2435 "manual pages, consider writing them for inclusion in your package, and "
2436 "submitting them upstream."
2439 #. type: Content of: <chapter><section><section><para>
2440 #: best-pkging-practices.dbk:1516
2442 "The manpages do not need to be written directly in the troff format. "
2443 "Popular source formats are Docbook, POD and reST, which can be converted "
2444 "using <command>xsltproc</command>, <command>pod2man</command> and "
2445 "<command>rst2man</command> respectively. To a lesser extent, the "
2446 "<command>help2man</command> program can also be used to write a stub."
2449 # type: Content of: <chapter><section><section><title>
2450 #. type: Content of: <chapter><section><section><title>
2451 #: best-pkging-practices.dbk:1525
2452 msgid "Specific types of packages"
2455 # type: Content of: <chapter><section><section><para>
2456 #. type: Content of: <chapter><section><section><para>
2457 #: best-pkging-practices.dbk:1527
2459 "Several specific types of packages have special sub-policies and "
2460 "corresponding packaging rules and practices:"
2463 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2464 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2465 #: best-pkging-practices.dbk:1533
2467 "Perl related packages have a <ulink url=\"&url-perl-policy;\">Perl policy</"
2468 "ulink>, some examples of packages following that policy are <systemitem role="
2469 "\"package\">libdbd-pg-perl</systemitem> (binary perl module) or <systemitem "
2470 "role=\"package\">libmldbm-perl</systemitem> (arch independent perl module)."
2473 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2474 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2475 #: best-pkging-practices.dbk:1542
2477 "Python related packages have their python policy; see &file-python-policy; "
2478 "in the <systemitem role=\"package\">python</systemitem> package."
2481 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2482 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2483 #: best-pkging-practices.dbk:1549
2485 "Emacs related packages have the <ulink url=\"&url-emacs-policy;\">emacs "
2489 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2490 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2491 #: best-pkging-practices.dbk:1556
2493 "Java related packages have their <ulink url=\"&url-java-policy;\">java "
2497 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2498 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2499 #: best-pkging-practices.dbk:1563
2501 "Ocaml related packages have their own policy, found in &file-ocaml-policy; "
2502 "from the <systemitem role=\"package\">ocaml</systemitem> package. A good "
2503 "example is the <systemitem role=\"package\">camlzip</systemitem> source "
2507 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2508 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2509 #: best-pkging-practices.dbk:1571
2511 "Packages providing XML or SGML DTDs should conform to the recommendations "
2512 "found in the <systemitem role=\"package\">sgml-base-doc</systemitem> package."
2515 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2516 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2517 #: best-pkging-practices.dbk:1577
2519 "Lisp packages should register themselves with <systemitem role=\"package"
2520 "\">common-lisp-controller</systemitem>, about which see &file-lisp-"
2524 # type: Content of: <chapter><section><section><title>
2525 #. type: Content of: <chapter><section><section><title>
2526 #: best-pkging-practices.dbk:1607
2527 msgid "Architecture-independent data"
2528 msgstr "アーキテクチャ非依存のデータ"
2530 # type: Content of: <chapter><section><section><para>
2531 #. type: Content of: <chapter><section><section><para>
2532 #: best-pkging-practices.dbk:1609
2534 "It is not uncommon to have a large amount of architecture-independent data "
2535 "packaged with a program. For example, audio files, a collection of icons, "
2536 "wallpaper patterns, or other graphic files. If the size of this data is "
2537 "negligible compared to the size of the rest of the package, it's probably "
2538 "best to keep it all in a single package."
2541 #. type: Content of: <chapter><section><section><para>
2542 #: best-pkging-practices.dbk:1616
2544 "However, if the size of the data is considerable, consider splitting it out "
2545 "into a separate, architecture-independent package (<filename>_all.deb</"
2546 "filename>). By doing this, you avoid needless duplication of the same data "
2547 "into eleven or more .debs, one per each architecture. While this adds some "
2548 "extra overhead into the <filename>Packages</filename> files, it saves a lot "
2549 "of disk space on Debian mirrors. Separating out architecture-independent "
2550 "data also reduces processing time of <command>lintian</command> (see <xref "
2551 "linkend=\"tools-lint\"/>) when run over the entire Debian archive."
2554 # type: Content of: <chapter><section><section><title>
2555 #. type: Content of: <chapter><section><section><title>
2556 #: best-pkging-practices.dbk:1628
2557 msgid "Needing a certain locale during build"
2560 # type: Content of: <chapter><section><section><para>
2561 #. type: Content of: <chapter><section><section><para>
2562 #: best-pkging-practices.dbk:1630
2564 "If you need a certain locale during build, you can create a temporary file "
2568 # type: Content of: <chapter><section><section><para>
2569 #. type: Content of: <chapter><section><section><para>
2570 #: best-pkging-practices.dbk:1634
2572 "If you set <varname>LOCPATH</varname> to the equivalent of <filename>/usr/"
2573 "lib/locale</filename>, and <varname>LC_ALL</varname> to the name of the "
2574 "locale you generate, you should get what you want without being root. "
2575 "Something like this:"
2578 # type: Content of: <chapter><section><section><screen>
2579 #. type: Content of: <chapter><section><section><screen>
2580 #: best-pkging-practices.dbk:1639
2583 "LOCALE_PATH=debian/tmpdir/usr/lib/locale\n"
2584 "LOCALE_NAME=en_IN\n"
2585 "LOCALE_CHARSET=UTF-8\n"
2587 "mkdir -p $LOCALE_PATH\n"
2588 "localedef -i $LOCALE_NAME.$LOCALE_CHARSET -f $LOCALE_CHARSET $LOCALE_PATH/$LOCALE_NAME.$LOCALE_CHARSET\n"
2590 "# Using the locale\n"
2591 "LOCPATH=$LOCALE_PATH LC_ALL=$LOCALE_NAME.$LOCALE_CHARSET date\n"
2593 "LOCALE_PATH=debian/tmpdir/usr/lib/locale\n"
2594 "LOCALE_NAME=en_IN\n"
2595 "LOCALE_CHARSET=UTF-8\n"
2597 "mkdir -p $LOCALE_PATH\n"
2598 "localedef -i $LOCALE_NAME.$LOCALE_CHARSET -f $LOCALE_CHARSET $LOCALE_PATH/$LOCALE_NAME.$LOCALE_CHARSET\n"
2601 "LOCPATH=$LOCALE_PATH LC_ALL=$LOCALE_NAME.$LOCALE_CHARSET date\n"
2603 # type: Content of: <chapter><section><section><title>
2604 #. type: Content of: <chapter><section><section><title>
2605 #: best-pkging-practices.dbk:1652
2606 msgid "Make transition packages deborphan compliant"
2609 # type: Content of: <chapter><section><section><para>
2610 #. type: Content of: <chapter><section><section><para>
2611 #: best-pkging-practices.dbk:1654
2613 "Deborphan is a program for helping users to detect which packages can safely "
2614 "be removed from the system, i.e. the ones that have no packages depending "
2615 "on them. The default operation is to search only within the libs and "
2616 "oldlibs sections, to hunt down unused libraries. But when passed the right "
2617 "argument, it tries to catch other useless packages."
2620 # type: Content of: <chapter><section><section><para>
2621 #. type: Content of: <chapter><section><section><para>
2622 #: best-pkging-practices.dbk:1661
2624 "For example, with <literal>--guess-dummy</literal>, <command>deborphan</"
2625 "command> tries to search all transitional packages which were needed for "
2626 "upgrade but which can now safely be removed. For that, it looks for the "
2627 "string dummy or transitional in their short description."
2630 # type: Content of: <chapter><section><section><para>
2631 #. type: Content of: <chapter><section><section><para>
2632 #: best-pkging-practices.dbk:1668
2634 "So, when you are creating such a package, please make sure to add this text "
2635 "to your short description. If you are looking for examples, just run: "
2636 "<command>apt-cache search .|grep dummy</command> or <command>apt-cache "
2637 "search .|grep transitional</command>."
2640 #. type: Content of: <chapter><section><section><para>
2641 #: best-pkging-practices.dbk:1674
2643 "Also, it is recommended to adjust its section to <literal>oldlibs</literal> "
2644 "and its priority to <literal>extra</literal> in order to ease "
2645 "<command>deborphan</command>'s job."
2648 # type: Content of: <chapter><section><title>
2649 #. type: Content of: <chapter><section><section><title>
2650 #: best-pkging-practices.dbk:1683
2651 msgid "Best practices for <filename>.orig.tar.{gz,bz2,lzma}</filename> files"
2653 "<filename>.orig.tar.{gz,bz2,lzma}</filename> についてのベストプラクティス"
2655 # type: Content of: <chapter><section><section><para>
2656 #. type: Content of: <chapter><section><section><para>
2657 #: best-pkging-practices.dbk:1685
2659 "There are two kinds of original source tarballs: Pristine source and "
2660 "repackaged upstream source."
2663 # type: Content of: <chapter><section><section><section><title>
2664 #. type: Content of: <chapter><section><section><section><title>
2665 #: best-pkging-practices.dbk:1689
2666 msgid "Pristine source"
2669 #. type: Content of: <chapter><section><section><section><para><footnote><para>
2670 #: best-pkging-practices.dbk:1693
2672 "We cannot prevent upstream authors from changing the tarball they distribute "
2673 "without also incrementing the version number, so there can be no guarantee "
2674 "that a pristine tarball is identical to what upstream <emphasis>currently</"
2675 "emphasis> distributing at any point in time. All that can be expected is "
2676 "that it is identical to something that upstream once <emphasis>did</"
2677 "emphasis> distribute. If a difference arises later (say, if upstream "
2678 "notices that he wasn't using maximal compression in his original "
2679 "distribution and then re-<command>gzip</command>s it), that's just too bad. "
2680 "Since there is no good way to upload a new <filename>.orig.tar.{gz,bz2,lzma}"
2681 "</filename> for the same version, there is not even any point in treating "
2682 "this situation as a bug."
2685 #. type: Content of: <chapter><section><section><section><para>
2686 #: best-pkging-practices.dbk:1691
2688 "The defining characteristic of a pristine source tarball is that the "
2689 "<filename>.orig.tar.{gz,bz2,lzma}</filename> file is byte-for-byte identical "
2690 "to a tarball officially distributed by the upstream author.<placeholder type="
2691 "\"footnote\" id=\"0\"/> This makes it possible to use checksums to easily "
2692 "verify that all changes between Debian's version and upstream's are "
2693 "contained in the Debian diff. Also, if the original source is huge, "
2694 "upstream authors and others who already have the upstream tarball can save "
2695 "download time if they want to inspect your packaging in detail."
2698 # type: Content of: <chapter><section><section><section><para>
2699 #. type: Content of: <chapter><section><section><section><para>
2700 #: best-pkging-practices.dbk:1711
2702 "There is no universally accepted guidelines that upstream authors follow "
2703 "regarding to the directory structure inside their tarball, but <command>dpkg-"
2704 "source</command> is nevertheless able to deal with most upstream tarballs as "
2705 "pristine source. Its strategy is equivalent to the following:"
2708 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2709 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2710 #: best-pkging-practices.dbk:1719
2711 msgid "It unpacks the tarball in an empty temporary directory by doing"
2714 # type: Content of: <chapter><section><section><section><orderedlist><listitem><screen>
2715 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><screen>
2716 #: best-pkging-practices.dbk:1722
2718 msgid "zcat path/to/<replaceable>packagename</replaceable>_<replaceable>upstream-version</replaceable>.orig.tar.gz | tar xf -\n"
2719 msgstr "zcat path/to/<replaceable>パッケージ名</replaceable>_<replaceable>upstream-version</replaceable>.orig.tar.gz | tar xf -\n"
2721 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2722 #: best-pkging-practices.dbk:1727
2724 "If, after this, the temporary directory contains nothing but one directory "
2725 "and no other files, <command>dpkg-source</command> renames that directory to "
2726 "<filename><replaceable>packagename</replaceable>-<replaceable>upstream-"
2727 "version</replaceable>(.orig)</filename>. The name of the top-level "
2728 "directory in the tarball does not matter, and is forgotten."
2731 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2732 #: best-pkging-practices.dbk:1736
2734 "Otherwise, the upstream tarball must have been packaged without a common top-"
2735 "level directory (shame on the upstream author!). In this case, "
2736 "<command>dpkg-source</command> renames the temporary directory "
2737 "<emphasis>itself</emphasis> to <filename><replaceable>packagename</"
2738 "replaceable>-<replaceable>upstream-version</replaceable>(.orig)</filename>."
2741 # type: Content of: <chapter><section><section><section><title>
2742 #. type: Content of: <chapter><section><section><section><title>
2743 #: best-pkging-practices.dbk:1747
2744 msgid "Repackaged upstream source"
2745 msgstr "upstream のソースをパッケージしなおす"
2747 # type: Content of: <chapter><section><section><section><para>
2748 #. type: Content of: <chapter><section><section><section><para>
2749 #: best-pkging-practices.dbk:1749
2751 "You <emphasis role=\"strong\">should</emphasis> upload packages with a "
2752 "pristine source tarball if possible, but there are various reasons why it "
2753 "might not be possible. This is the case if upstream does not distribute the "
2754 "source as gzipped tar at all, or if upstream's tarball contains non-DFSG-"
2755 "free material that you must remove before uploading."
2758 #. type: Content of: <chapter><section><section><section><para>
2759 #: best-pkging-practices.dbk:1756
2761 "In these cases the developer must construct a suitable <filename>.orig.tar."
2762 "{gz,bz2,lzma}</filename> file himself. We refer to such a tarball as a "
2763 "repackaged upstream source. Note that a repackaged upstream source is "
2764 "different from a Debian-native package. A repackaged source still comes "
2765 "with Debian-specific changes in a separate <filename>.diff.gz</filename> or "
2766 "<filename>.debian.tar.{gz,bz2,lzma}</filename> and still has a version "
2767 "number composed of <replaceable>upstream-version</replaceable> and "
2768 "<replaceable>debian-version</replaceable>."
2771 #. type: Content of: <chapter><section><section><section><para>
2772 #: best-pkging-practices.dbk:1765
2774 "There may be cases where it is desirable to repackage the source even though "
2775 "upstream distributes a <filename>.tar.{gz,bz2,lzma}</filename> that could in "
2776 "principle be used in its pristine form. The most obvious is if "
2777 "<emphasis>significant</emphasis> space savings can be achieved by "
2778 "recompressing the tar archive or by removing genuinely useless cruft from "
2779 "the upstream archive. Use your own discretion here, but be prepared to "
2780 "defend your decision if you repackage source that could have been pristine."
2783 #. type: Content of: <chapter><section><section><section><para>
2784 #: best-pkging-practices.dbk:1774
2785 msgid "A repackaged <filename>.orig.tar.{gz,bz2,lzma}</filename>"
2788 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2789 #: best-pkging-practices.dbk:1779
2791 "<emphasis role=\"strong\">should</emphasis> be documented in the resulting "
2792 "source package. Detailed information on how the repackaged source was "
2793 "obtained, and on how this can be reproduced should be provided in "
2794 "<filename>debian/copyright</filename>. It is also a good idea to provide a "
2795 "<literal>get-orig-source</literal> target in your <filename>debian/rules</"
2796 "filename> file that repeats the process, as described in the Policy Manual, "
2797 "<ulink url=\"&url-debian-policy;ch-source.html#s-debianrules\">Main building "
2798 "script: <filename>debian/rules</filename></ulink>."
2801 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para><footnote><para>
2802 #: best-pkging-practices.dbk:1794
2804 "As a special exception, if the omission of non-free files would lead to the "
2805 "source failing to build without assistance from the Debian diff, it might be "
2806 "appropriate to instead edit the files, omitting only the non-free parts of "
2807 "them, and/or explain the situation in a <filename>README.source</filename> "
2808 "file in the root of the source tree. But in that case please also urge the "
2809 "upstream author to make the non-free components easier separable from the "
2810 "rest of the source."
2813 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2814 #: best-pkging-practices.dbk:1792
2816 "<emphasis role=\"strong\">should not</emphasis> contain any file that does "
2817 "not come from the upstream author(s), or whose contents has been changed by "
2818 "you.<placeholder type=\"footnote\" id=\"0\"/>"
2821 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2822 #: best-pkging-practices.dbk:1805
2824 "<emphasis role=\"strong\">should</emphasis>, except where impossible for "
2825 "legal reasons, preserve the entire building and portablility infrastructure "
2826 "provided by the upstream author. For example, it is not a sufficient reason "
2827 "for omitting a file that it is used only when building on MS-DOS. "
2828 "Similarly, a <filename>Makefile</filename> provided by upstream should not "
2829 "be omitted even if the first thing your <filename>debian/rules</filename> "
2830 "does is to overwrite it by running a configure script."
2833 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2834 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2835 #: best-pkging-practices.dbk:1814
2837 "(<emphasis>Rationale:</emphasis> It is common for Debian users who need to "
2838 "build software for non-Debian platforms to fetch the source from a Debian "
2839 "mirror rather than trying to locate a canonical upstream distribution point)."
2842 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2843 #: best-pkging-practices.dbk:1821
2845 "<emphasis role=\"strong\">should</emphasis> use "
2846 "<filename><replaceable>packagename</replaceable>-<replaceable>upstream-"
2847 "version</replaceable>.orig</filename> as the name of the top-level directory "
2848 "in its tarball. This makes it possible to distinguish pristine tarballs "
2849 "from repackaged ones."
2852 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2853 #: best-pkging-practices.dbk:1829
2855 "<emphasis role=\"strong\">should</emphasis> be gzipped or bzipped with "
2856 "maximal compression."
2859 #. type: Content of: <chapter><section><section><section><title>
2860 #: best-pkging-practices.dbk:1836
2861 msgid "Changing binary files"
2864 #. type: Content of: <chapter><section><section><section><para>
2865 #: best-pkging-practices.dbk:1838
2867 "Sometimes it is necessary to change binary files contained in the original "
2868 "tarball, or to add binary files that are not in it. This is fully supported "
2869 "when using source packages in “3.0 (quilt)” format, see the "
2870 "<citerefentry><refentrytitle>dpkg-source</refentrytitle><manvolnum>1</"
2871 "manvolnum></citerefentry> manual page for details. When using the older "
2872 "format “1.0”, binary files can't be stored in the <filename>.diff.gz</"
2873 "filename> so you must store an <command>uuencode</command>d (or similar) "
2874 "version of the file(s) and decode it at build time in <filename>debian/"
2875 "rules</filename> (and move it in its official location)."
2878 # type: Content of: <chapter><section><section><title>
2879 #. type: Content of: <chapter><section><section><title>
2880 #: best-pkging-practices.dbk:1853
2881 msgid "Best practices for debug packages"
2884 #. type: Content of: <chapter><section><section><para>
2885 #: best-pkging-practices.dbk:1855
2887 "A debug package is a package with a name ending in -dbg, that contains "
2888 "additional information that <command>gdb</command> can use. Since Debian "
2889 "binaries are stripped by default, debugging information, including function "
2890 "names and line numbers, is otherwise not available when running "
2891 "<command>gdb</command> on Debian binaries. Debug packages allow users who "
2892 "need this additional debugging information to install it, without bloating a "
2893 "regular system with the information."
2896 # type: Content of: <chapter><section><section><para>
2897 #. type: Content of: <chapter><section><section><para>
2898 #: best-pkging-practices.dbk:1863
2900 "It is up to a package's maintainer whether to create a debug package or "
2901 "not. Maintainers are encouraged to create debug packages for library "
2902 "packages, since this can aid in debugging many programs linked to a "
2903 "library. In general, debug packages do not need to be added for all "
2904 "programs; doing so would bloat the archive. But if a maintainer finds that "
2905 "users often need a debugging version of a program, it can be worthwhile to "
2906 "make a debug package for it. Programs that are core infrastructure, such as "
2907 "apache and the X server are also good candidates for debug packages."
2910 #. type: Content of: <chapter><section><section><para>
2911 #: best-pkging-practices.dbk:1873
2913 "Some debug packages may contain an entire special debugging build of a "
2914 "library or other binary, but most of them can save space and build time by "
2915 "instead containing separated debugging symbols that <command>gdb</command> "
2916 "can find and load on the fly when debugging a program or library. The "
2917 "convention in Debian is to keep these symbols in <filename>/usr/lib/debug/"
2918 "<replaceable>path</replaceable></filename>, where <replaceable>path</"
2919 "replaceable> is the path to the executable or library. For example, "
2920 "debugging symbols for <filename>/usr/bin/foo</filename> go in <filename>/usr/"
2921 "lib/debug/usr/bin/foo</filename>, and debugging symbols for <filename>/usr/"
2922 "lib/libfoo.so.1</filename> go in <filename>/usr/lib/debug/usr/lib/libfoo."
2926 #. type: Content of: <chapter><section><section><para>
2927 #: best-pkging-practices.dbk:1885
2929 "The debugging symbols can be extracted from an object file using "
2930 "<command>objcopy --only-keep-debug</command>. Then the object file can be "
2931 "stripped, and <command>objcopy --add-gnu-debuglink</command> used to specify "
2932 "the path to the debugging symbol file. <citerefentry> "
2933 "<refentrytitle>objcopy</refentrytitle> <manvolnum>1</manvolnum> </"
2934 "citerefentry> explains in detail how this works."
2937 #. type: Content of: <chapter><section><section><para>
2938 #: best-pkging-practices.dbk:1893
2940 "The <command>dh_strip</command> command in <systemitem role=\"package"
2941 "\">debhelper</systemitem> supports creating debug packages, and can take "
2942 "care of using <command>objcopy</command> to separate out the debugging "
2943 "symbols for you. If your package uses <systemitem role=\"package"
2944 "\">debhelper</systemitem>, all you need to do is call <command>dh_strip --"
2945 "dbg-package=libfoo-dbg</command>, and add an entry to <filename>debian/"
2946 "control</filename> for the debug package."
2949 #. type: Content of: <chapter><section><section><para>
2950 #: best-pkging-practices.dbk:1900
2952 "Note that the debug package should depend on the package that it provides "
2953 "debugging symbols for, and this dependency should be versioned. For example:"
2956 # type: Content of: <chapter><section><section><screen>
2957 #. type: Content of: <chapter><section><section><screen>
2958 #: best-pkging-practices.dbk:1904
2960 msgid "Depends: libfoo (= ${binary:Version})\n"
2961 msgstr "Depends: libfoo (= ${binary:Version})\n"
2963 # type: Content of: <chapter><section><title>
2964 #. type: Content of: <chapter><section><section><title>
2965 #: best-pkging-practices.dbk:1908
2967 #| msgid "Best practices for maintainer scripts"
2968 msgid "Best practices for meta-packages"
2969 msgstr "メンテナスクリプトのベストプラクティス"
2971 #. type: Content of: <chapter><section><section><para>
2972 #: best-pkging-practices.dbk:1910
2974 "A meta-package is a mostly empty package that makes it easy to install a "
2975 "coherent set of packages that can evolve over time. It achieves this by "
2976 "depending on all the packages of the set. Thanks to the power of APT, the "
2977 "meta-package maintainer can adjust the dependencies and the user's system "
2978 "will automatically get the supplementary packages. The dropped packages that "
2979 "were automatically installed will be also be marked as removal candidates "
2980 "(and are even automatically removed by <command>aptitude</command>). "
2981 "<systemitem role=\"package\">gnome</systemitem> and <systemitem role="
2982 "\"package\">linux-image-amd64</systemitem> are two examples of meta-packages "
2983 "(built by the source packages <systemitem role=\"package\">meta-gnome2</"
2984 "systemitem> and <systemitem role=\"package\">linux-latest</systemitem>)."
2987 #. type: Content of: <chapter><section><section><para>
2988 #: best-pkging-practices.dbk:1924
2990 "The long description of the meta-package must clearly document its purpose "
2991 "so that the user knows what he will lose if he removes the package. Being "
2992 "explicit about the consequences is recommended. This is particularly "
2993 "important for meta-packages which are installed during initial installation "
2994 "and that have not been explicitly installed by the user. Those tend to be "
2995 "important to ensure smooth system upgrades and the user should be "
2996 "discouraged from uninstalling them to avoid potential breakages."