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.4\n"
7 "POT-Creation-Date: 2010-06-20 09:22-0400\n"
8 "PO-Revision-Date: 2011-02-28 02:27+0900\n"
9 "Last-Translator: Hideki Yamane (Debian-JP) <henrich@debian.or.jp>\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 パッケージが満たす必要がある基本的要求"
39 # type: Content of: <chapter><para>
40 #. type: Content of: <chapter><para>
41 #: best-pkging-practices.dbk:18
43 "This chapter provides some best practices for Debian developers. All "
44 "recommendations are merely that, and are not requirements or policy. These "
45 "are just some subjective hints, advice and pointers collected from Debian "
46 "developers. Feel free to pick and choose whatever works best for you."
49 # type: Content of: <chapter><section><title>
50 #. type: Content of: <chapter><section><title>
51 #: best-pkging-practices.dbk:24
52 msgid "Best practices for <filename>debian/rules</filename>"
53 msgstr "<filename>debian/rules</filename> についてのベストプラクティス"
55 # type: Content of: <chapter><section><para>
56 #. type: Content of: <chapter><section><para>
57 #: best-pkging-practices.dbk:26
59 "The following recommendations apply to the <filename>debian/rules</filename> "
60 "file. Since <filename>debian/rules</filename> controls the build process "
61 "and selects the files which go into the package (directly or indirectly), "
62 "it's usually the file maintainers spend the most time on."
65 # type: Content of: <chapter><section><section><title>
66 #. type: Content of: <chapter><section><section><title>
67 #: best-pkging-practices.dbk:32
68 msgid "Helper scripts"
71 # type: Content of: <chapter><section><section><para>
72 #. type: Content of: <chapter><section><section><para>
73 #: best-pkging-practices.dbk:34
75 "The rationale for using helper scripts in <filename>debian/rules</filename> "
76 "is that they let maintainers use and share common logic among many "
77 "packages. Take for instance the question of installing menu entries: you "
78 "need to put the file into <filename>/usr/share/menu</filename> (or "
79 "<filename>/usr/lib/menu</filename> for executable binary menufiles, if this "
80 "is needed), and add commands to the maintainer scripts to register and "
81 "unregister the menu entries. Since this is a very common thing for packages "
82 "to do, why should each maintainer rewrite all this on their own, sometimes "
83 "with bugs? Also, supposing the menu directory changed, every package would "
87 # type: Content of: <chapter><section><section><para>
88 #. type: Content of: <chapter><section><section><para>
89 #: best-pkging-practices.dbk:45
91 "Helper scripts take care of these issues. Assuming you comply with the "
92 "conventions expected by the helper script, the helper takes care of all the "
93 "details. Changes in policy can be made in the helper script; then packages "
94 "just need to be rebuilt with the new version of the helper and no other "
98 # type: Content of: <chapter><section><section><para>
99 #. type: Content of: <chapter><section><section><para>
100 #: best-pkging-practices.dbk:52
102 "<xref linkend=\"tools\"/> contains a couple of different helpers. The most "
103 "common and best (in our opinion) helper system is <systemitem role=\"package"
104 "\">debhelper</systemitem>. Previous helper systems, such as <systemitem "
105 "role=\"package\">debmake</systemitem>, were monolithic: you couldn't pick "
106 "and choose which part of the helper you found useful, but had to use the "
107 "helper to do everything. <systemitem role=\"package\">debhelper</"
108 "systemitem>, however, is a number of separate little <command>dh_*</command> "
109 "programs. For instance, <command>dh_installman</command> installs and "
110 "compresses man pages, <command>dh_installmenu</command> installs menu files, "
111 "and so on. Thus, it offers enough flexibility to be able to use the little "
112 "helper scripts, where useful, in conjunction with hand-crafted commands in "
113 "<filename>debian/rules</filename>."
116 #. type: Content of: <chapter><section><section><para>
117 #: best-pkging-practices.dbk:66
119 "You can get started with <systemitem role=\"package\">debhelper</systemitem> "
120 "by reading <citerefentry> <refentrytitle>debhelper</refentrytitle> "
121 "<manvolnum>1</manvolnum> </citerefentry>, and looking at the examples that "
122 "come with the package. <command>dh_make</command>, from the <systemitem "
123 "role=\"package\">dh-make</systemitem> package (see <xref linkend=\"dh-make\"/"
124 ">), can be used to convert a vanilla source package to a <systemitem role="
125 "\"package\">debhelper</systemitem>ized package. This shortcut, though, "
126 "should not convince you that you do not need to bother understanding the "
127 "individual <command>dh_*</command> helpers. If you are going to use a "
128 "helper, you do need to take the time to learn to use that helper, to learn "
129 "its expectations and behavior."
132 # type: Content of: <chapter><section><section><para>
133 #. type: Content of: <chapter><section><section><para>
134 #: best-pkging-practices.dbk:79
136 "Some people feel that vanilla <filename>debian/rules</filename> files are "
137 "better, since you don't have to learn the intricacies of any helper system. "
138 "This decision is completely up to you. Use what works for you. Many "
139 "examples of vanilla <filename>debian/rules</filename> files are available at "
140 "<ulink url=\"&url-rules-files;\"></ulink>."
143 # type: Content of: <chapter><section><section><title>
144 #. type: Content of: <chapter><section><section><title>
145 #: best-pkging-practices.dbk:88
146 msgid "Separating your patches into multiple files"
147 msgstr "パッチを複数のファイルに分離する"
149 # type: Content of: <chapter><section><section><para>
150 #. type: Content of: <chapter><section><section><para>
151 #: best-pkging-practices.dbk:90
153 "Big, complex packages may have many bugs that you need to deal with. If you "
154 "correct a number of bugs directly in the source, and you're not careful, it "
155 "can get hard to differentiate the various patches that you applied. It can "
156 "get quite messy when you have to update the package to a new upstream "
157 "version which integrates some of the fixes (but not all). You can't take "
158 "the total set of diffs (e.g., from <filename>.diff.gz</filename>) and work "
159 "out which patch sets to back out as a unit as bugs are fixed upstream."
162 #. type: Content of: <chapter><section><section><para>
163 #: best-pkging-practices.dbk:99
165 "Fortunately, with the source format “3.0 (quilt)” it is now possible to keep "
166 "patches separate without having to modify <filename>debian/rules</filename> "
167 "to setup a patch system. Patches are stored in <filename>debian/patches/</"
168 "filename> and when the source package is unpacked patches listed in "
169 "<filename>debian/patches/series</filename> are automatically applied. As "
170 "the name implies, patches can be managed with <command>quilt</command>."
173 #. type: Content of: <chapter><section><section><para>
174 #: best-pkging-practices.dbk:107
176 "When using the older source “1.0”, it's also possible to separate patches "
177 "but a dedicated patch system must be used: the patch files are shipped "
178 "within the Debian patch file (<filename>.diff.gz</filename>), usually within "
179 "the <filename>debian/</filename> directory. The only difference is that they "
180 "aren't applied immediately by <command>dpkg-source</command>, but by the "
181 "<literal>build</literal> rule of <filename>debian/rules</filename>, through "
182 "a dependency on the <literal>patch</literal> rule. Conversely, they are "
183 "reverted in the <literal>clean</literal> rule, through a dependency on the "
184 "<literal>unpatch</literal> rule."
187 #. type: Content of: <chapter><section><section><para>
188 #: best-pkging-practices.dbk:119
190 "<command>quilt</command> is the recommended tool for this. It does all of "
191 "the above, and also allows to manage patch series. See the <systemitem role="
192 "\"package\">quilt</systemitem> package for more information."
195 #. type: Content of: <chapter><section><section><para>
196 #: best-pkging-practices.dbk:125
198 "There are other tools to manage patches, like <command>dpatch</command>, and "
199 "the patch system integrated with <systemitem role=\"package\">cdbs</"
203 # type: Content of: <chapter><section><section><title>
204 #. type: Content of: <chapter><section><section><title>
205 #: best-pkging-practices.dbk:132
206 msgid "Multiple binary packages"
207 msgstr "複数のバイナリパッケージ"
209 # type: Content of: <chapter><section><section><para>
210 #. type: Content of: <chapter><section><section><para>
211 #: best-pkging-practices.dbk:134
213 "A single source package will often build several binary packages, either to "
214 "provide several flavors of the same software (e.g., the <systemitem role="
215 "\"package\">vim</systemitem> source package) or to make several small "
216 "packages instead of a big one (e.g., so the user can install only the subset "
217 "needed, and thus save some disk space)."
220 # type: Content of: <chapter><section><section><para>
221 #. type: Content of: <chapter><section><section><para>
222 #: best-pkging-practices.dbk:141
224 "The second case can be easily managed in <filename>debian/rules</filename>. "
225 "You just need to move the appropriate files from the build directory into "
226 "the package's temporary trees. You can do this using <command>install</"
227 "command> or <command>dh_install</command> from <systemitem role=\"package"
228 "\">debhelper</systemitem>. Be sure to check the different permutations of "
229 "the various packages, ensuring that you have the inter-package dependencies "
230 "set right in <filename>debian/control</filename>."
233 # type: Content of: <chapter><section><section><para>
234 #. type: Content of: <chapter><section><section><para>
235 #: best-pkging-practices.dbk:150
237 "The first case is a bit more difficult since it involves multiple recompiles "
238 "of the same software but with different configuration options. The "
239 "<systemitem role=\"package\">vim</systemitem> source package is an example "
240 "of how to manage this using an hand-crafted <filename>debian/rules</"
244 # type: Content of: <chapter><section><title>
245 #. type: Content of: <chapter><section><title>
246 #: best-pkging-practices.dbk:162
247 msgid "Best practices for <filename>debian/control</filename>"
248 msgstr "<filename>debian/control</filename> のベストプラクティス"
250 # type: Content of: <chapter><section><para>
251 #. type: Content of: <chapter><section><para>
252 #: best-pkging-practices.dbk:164
254 "The following practices are relevant to the <filename>debian/control</"
255 "filename> file. They supplement the <ulink url=\"&url-debian-policy;ch-"
256 "binary.html#s-descriptions\">Policy on package descriptions</ulink>."
259 # type: Content of: <chapter><section><para>
260 #. type: Content of: <chapter><section><para>
261 #: best-pkging-practices.dbk:170
263 "The description of the package, as defined by the corresponding field in the "
264 "<filename>control</filename> file, contains both the package synopsis and "
265 "the long description for the package. <xref linkend=\"bpp-desc-basics\"/> "
266 "describes common guidelines for both parts of the package description. "
267 "Following that, <xref linkend=\"bpp-pkg-synopsis\"/> provides guidelines "
268 "specific to the synopsis, and <xref linkend=\"bpp-pkg-desc\"/> contains "
269 "guidelines specific to the description."
272 # type: Content of: <chapter><section><section><title>
273 #. type: Content of: <chapter><section><section><title>
274 #: best-pkging-practices.dbk:179
275 msgid "General guidelines for package descriptions"
276 msgstr "パッケージ説明文の基本的なガイドライン"
278 # type: Content of: <chapter><section><section><para>
279 #. type: Content of: <chapter><section><section><para>
280 #: best-pkging-practices.dbk:181
282 "The package description should be written for the average likely user, the "
283 "average person who will use and benefit from the package. For instance, "
284 "development packages are for developers, and can be technical in their "
285 "language. More general-purpose applications, such as editors, should be "
286 "written for a less technical user."
289 # type: Content of: <chapter><section><section><para>
290 #. type: Content of: <chapter><section><section><para>
291 #: best-pkging-practices.dbk:188
293 "Our review of package descriptions lead us to conclude that most package "
294 "descriptions are technical, that is, are not written to make sense for non-"
295 "technical users. Unless your package really is only for technical users, "
299 # type: Content of: <chapter><section><section><para>
300 #. type: Content of: <chapter><section><section><para>
301 #: best-pkging-practices.dbk:194
303 "How do you write for non-technical users? Avoid jargon. Avoid referring to "
304 "other applications or frameworks that the user might not be familiar with — "
305 "GNOME or KDE is fine, since users are probably familiar with these terms, "
306 "but GTK+ is probably not. Try not to assume any knowledge at all. If you "
307 "must use technical terms, introduce them."
310 # type: Content of: <chapter><section><section><para>
311 #. type: Content of: <chapter><section><section><para>
312 #: best-pkging-practices.dbk:201
314 "Be objective. Package descriptions are not the place for advocating your "
315 "package, no matter how much you love it. Remember that the reader may not "
316 "care about the same things you care about."
319 # type: Content of: <chapter><section><section><para>
320 #. type: Content of: <chapter><section><section><para>
321 #: best-pkging-practices.dbk:206
323 "References to the names of any other software packages, protocol names, "
324 "standards, or specifications should use their canonical forms, if one "
325 "exists. For example, use X Window System, X11, or X; not X Windows, X-"
326 "Windows, or X Window. Use GTK+, not GTK or gtk. Use GNOME, not Gnome. Use "
327 "PostScript, not Postscript or postscript."
330 # type: Content of: <chapter><section><section><para>
331 #. type: Content of: <chapter><section><section><para>
332 #: best-pkging-practices.dbk:213
334 "If you are having problems writing your description, you may wish to send it "
335 "along to &email-debian-l10n-english; and request feedback."
338 # type: Content of: <chapter><section><section><title>
339 #. type: Content of: <chapter><section><section><title>
340 #: best-pkging-practices.dbk:219
341 msgid "The package synopsis, or short description"
344 #. type: Content of: <chapter><section><section><para>
345 #: best-pkging-practices.dbk:221
347 "Policy says the synopsis line (the short description) must be concise, not "
348 "repeating the package name, but also informative."
351 #. type: Content of: <chapter><section><section><para>
352 #: best-pkging-practices.dbk:225
354 "The synopsis functions as a phrase describing the package, not a complete "
355 "sentence, so sentential punctuation is inappropriate: it does not need extra "
356 "capital letters or a final period (full stop). It should also omit any "
357 "initial indefinite or definite article — \"a\", \"an\", or \"the\". Thus for "
361 #. type: Content of: <chapter><section><section><screen>
362 #: best-pkging-practices.dbk:231
366 "Description: exemplification support library\n"
369 "Description: exemplification support library\n"
371 #. type: Content of: <chapter><section><section><para>
372 #: best-pkging-practices.dbk:235
374 "Technically this is a noun phrase minus articles, as opposed to a verb "
375 "phrase. A good heuristic is that it should be possible to substitute the "
376 "package <replaceable>name</replaceable> and <replaceable>synopsis</"
377 "replaceable> into this formula:"
380 #. type: Content of: <chapter><section><section><para>
381 #: best-pkging-practices.dbk:240
383 "The package <replaceable>name</replaceable> provides {a,an,the,some} "
384 "<replaceable>synopsis</replaceable>."
387 #. type: Content of: <chapter><section><section><para>
388 #: best-pkging-practices.dbk:244
390 "Sets of related packages may use an alternative scheme that divides the "
391 "synopsis into two parts, the first a description of the whole suite and the "
392 "second a summary of the package's role within it:"
395 #. type: Content of: <chapter><section><section><screen>
396 #: best-pkging-practices.dbk:249
399 "Package: eg-tools\n"
400 "Description: simple exemplification system (utilities)\n"
403 "Description: simple exemplification system - documentation\n"
405 "Package: eg-tools\n"
406 "Description: simple exemplification system (utilities)\n"
409 "Description: simple exemplification system - documentation\n"
411 #. type: Content of: <chapter><section><section><para>
412 #: best-pkging-practices.dbk:256
414 "These synopses follow a modified formula. Where a package "
415 "\"<replaceable>name</replaceable>\" has a synopsis \"<replaceable>suite</"
416 "replaceable> (<replaceable>role</replaceable>)\" or \"<replaceable>suite</"
417 "replaceable> - <replaceable>role</replaceable>\", the elements should be "
418 "phrased so that they fit into the formula:"
421 #. type: Content of: <chapter><section><section><para>
422 #: best-pkging-practices.dbk:263
424 "The package <replaceable>name</replaceable> provides {a,an,the} "
425 "<replaceable>role</replaceable> for the <replaceable>suite</replaceable>."
428 # type: Content of: <chapter><section><section><title>
429 #. type: Content of: <chapter><section><section><title>
430 #: best-pkging-practices.dbk:269
431 msgid "The long description"
434 # type: Content of: <chapter><section><section><para>
435 #. type: Content of: <chapter><section><section><para>
436 #: best-pkging-practices.dbk:271
438 "The long description is the primary information available to the user about "
439 "a package before they install it. It should provide all the information "
440 "needed to let the user decide whether to install the package. Assume that "
441 "the user has already read the package synopsis."
444 # type: Content of: <chapter><section><section><para>
445 #. type: Content of: <chapter><section><section><para>
446 #: best-pkging-practices.dbk:277
447 msgid "The long description should consist of full and complete sentences."
450 # type: Content of: <chapter><section><section><para>
451 #. type: Content of: <chapter><section><section><para>
452 #: best-pkging-practices.dbk:280
454 "The first paragraph of the long description should answer the following "
455 "questions: what does the package do? what task does it help the user "
456 "accomplish? It is important to describe this in a non-technical way, unless "
457 "of course the audience for the package is necessarily technical."
460 # type: Content of: <chapter><section><section><para>
461 #. type: Content of: <chapter><section><section><para>
462 #: best-pkging-practices.dbk:286
464 "The following paragraphs should answer the following questions: Why do I as "
465 "a user need this package? What other features does the package have? What "
466 "outstanding features and deficiencies are there compared to other packages "
467 "(e.g., if you need X, use Y instead)? Is this package related to other "
468 "packages in some way that is not handled by the package manager (e.g., this "
469 "is the client for the foo server)?"
472 # type: Content of: <chapter><section><section><para>
473 #. type: Content of: <chapter><section><section><para>
474 #: best-pkging-practices.dbk:294
476 "Be careful to avoid spelling and grammar mistakes. Ensure that you spell-"
477 "check it. Both <command>ispell</command> and <command>aspell</command> have "
478 "special modes for checking <filename>debian/control</filename> files:"
481 #. type: Content of: <chapter><section><section><screen>
482 #: best-pkging-practices.dbk:299
484 msgid "ispell -d american -g debian/control\n"
485 msgstr "ispell -d american -g debian/control\n"
487 #. type: Content of: <chapter><section><section><screen>
488 #: best-pkging-practices.dbk:302
490 msgid "aspell -d en -D -c debian/control\n"
491 msgstr "aspell -d en -D -c debian/control\n"
493 # type: Content of: <chapter><section><section><para>
494 #. type: Content of: <chapter><section><section><para>
495 #: best-pkging-practices.dbk:305
497 "Users usually expect these questions to be answered in the package "
501 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
502 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
503 #: best-pkging-practices.dbk:310
505 "What does the package do? If it is an add-on to another package, then the "
506 "short description of the package we are an add-on to should be put in here."
509 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
510 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
511 #: best-pkging-practices.dbk:316
513 "Why should I want this package? This is related to the above, but not the "
514 "same (this is a mail user agent; this is cool, fast, interfaces with PGP and "
515 "LDAP and IMAP, has features X, Y, and Z)."
518 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
519 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
520 #: best-pkging-practices.dbk:323
522 "If this package should not be installed directly, but is pulled in by "
523 "another package, this should be mentioned."
526 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
527 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
528 #: best-pkging-practices.dbk:329
530 "If the package is <literal>experimental</literal>, or there are other "
531 "reasons it should not be used, if there are other packages that should be "
532 "used instead, it should be here as well."
535 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
536 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
537 #: best-pkging-practices.dbk:336
539 "How is this package different from the competition? Is it a better "
540 "implementation? more features? different features? Why should I choose this "
544 # type: Content of: <chapter><section><section><title>
545 #. type: Content of: <chapter><section><section><title>
546 #: best-pkging-practices.dbk:349
547 msgid "Upstream home page"
550 # type: Content of: <chapter><section><section><para>
551 #. type: Content of: <chapter><section><section><para>
552 #: best-pkging-practices.dbk:351
554 "We recommend that you add the URL for the package's home page in the "
555 "<literal>Homepage</literal> field of the <literal>Source</literal> section "
556 "in <filename>debian/control</filename>. Adding this information in the "
557 "package description itself is considered deprecated."
560 # type: Content of: <chapter><section><section><title>
561 #. type: Content of: <chapter><section><section><title>
562 #: best-pkging-practices.dbk:359
563 msgid "Version Control System location"
564 msgstr "バージョン管理システムの場所"
566 # type: Content of: <chapter><section><section><para>
567 #. type: Content of: <chapter><section><section><para>
568 #: best-pkging-practices.dbk:361
570 "There are additional fields for the location of the Version Control System "
571 "in <filename>debian/control</filename>."
574 # type: Content of: <chapter><section><section><section><title>
575 #. type: Content of: <chapter><section><section><section><title>
576 #: best-pkging-practices.dbk:365
580 # type: Content of: <chapter><section><section><section><para>
581 #. type: Content of: <chapter><section><section><section><para>
582 #: best-pkging-practices.dbk:367
584 "Value of this field should be a <literal>http://</literal> URL pointing to a "
585 "web-browsable copy of the Version Control System repository used to maintain "
586 "the given package, if available."
589 # type: Content of: <chapter><section><section><section><para>
590 #. type: Content of: <chapter><section><section><section><para>
591 #: best-pkging-practices.dbk:372
593 "The information is meant to be useful for the final user, willing to browse "
594 "the latest work done on the package (e.g. when looking for the patch fixing "
595 "a bug tagged as <literal>pending</literal> in the bug tracking system)."
598 # type: Content of: <chapter><section><section><section><title>
599 #. type: Content of: <chapter><section><section><section><title>
600 #: best-pkging-practices.dbk:379
604 # type: Content of: <chapter><section><section><section><para>
605 #. type: Content of: <chapter><section><section><section><para>
606 #: best-pkging-practices.dbk:381
608 "Value of this field should be a string identifying unequivocally the "
609 "location of the Version Control System repository used to maintain the given "
610 "package, if available. <literal>*</literal> identify the Version Control "
611 "System; currently the following systems are supported by the package "
612 "tracking system: <literal>arch</literal>, <literal>bzr</literal> (Bazaar), "
613 "<literal>cvs</literal>, <literal>darcs</literal>, <literal>git</literal>, "
614 "<literal>hg</literal> (Mercurial), <literal>mtn</literal> (Monotone), "
615 "<literal>svn</literal> (Subversion). It is allowed to specify different VCS "
616 "fields for the same package: they will all be shown in the PTS web interface."
619 # type: Content of: <chapter><section><section><section><para>
620 #. type: Content of: <chapter><section><section><section><para>
621 #: best-pkging-practices.dbk:392
623 "The information is meant to be useful for a user knowledgeable in the given "
624 "Version Control System and willing to build the current version of a package "
625 "from the VCS sources. Other uses of this information might include "
626 "automatic building of the latest VCS version of the given package. To this "
627 "end the location pointed to by the field should better be version agnostic "
628 "and point to the main branch (for VCSs supporting such a concept). Also, "
629 "the location pointed to should be accessible to the final user; fulfilling "
630 "this requirement might imply pointing to an anonymous access of the "
631 "repository instead of pointing to an SSH-accessible version of the same."
634 # type: Content of: <chapter><section><section><section><para>
635 #. type: Content of: <chapter><section><section><section><para>
636 #: best-pkging-practices.dbk:403
638 "In the following example, an instance of the field for a Subversion "
639 "repository of the <systemitem role=\"package\">vim</systemitem> package is "
640 "shown. Note how the URL is in the <literal>svn://</literal> scheme (instead "
641 "of <literal>svn+ssh://</literal>) and how it points to the <filename>trunk/</"
642 "filename> branch. The use of the <literal>Vcs-Browser</literal> and "
643 "<literal>Homepage</literal> fields described above is also shown."
646 # type: Content of: <chapter><section><section><section><screen>
647 #. type: Content of: <chapter><section><section><section><screen>
648 #: best-pkging-practices.dbk:412
652 " Section: editors\n"
653 " Priority: optional\n"
655 " Vcs-Svn: svn://svn.debian.org/svn/pkg-vim/trunk/packages/vim\n"
656 " Vcs-Browser: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim\n"
657 " Homepage: http://www.vim.org\n"
661 " Section: editors\n"
662 " Priority: optional\n"
664 " Vcs-Svn: svn://svn.debian.org/svn/pkg-vim/trunk/packages/vim\n"
665 " Vcs-Browser: http://svn.debian.org/wsvn/pkg-vim/trunk/packages/vim\n"
666 " Homepage: http://www.vim.org\n"
668 # type: Content of: <chapter><section><title>
669 #. type: Content of: <chapter><section><title>
670 #: best-pkging-practices.dbk:427
671 msgid "Best practices for <filename>debian/changelog</filename>"
672 msgstr "<filename>debian/changelog</filename> のベストプラクティス"
674 # type: Content of: <chapter><section><para>
675 #. type: Content of: <chapter><section><para>
676 #: best-pkging-practices.dbk:429
678 "The following practices supplement the <ulink url=\"&url-debian-policy;ch-"
679 "docs.html#s-changelogs\">Policy on changelog files</ulink>."
682 # type: Content of: <chapter><section><section><title>
683 #. type: Content of: <chapter><section><section><title>
684 #: best-pkging-practices.dbk:434
685 msgid "Writing useful changelog entries"
688 # type: Content of: <chapter><section><section><para>
689 #. type: Content of: <chapter><section><section><para>
690 #: best-pkging-practices.dbk:436
692 "The changelog entry for a package revision documents changes in that "
693 "revision, and only them. Concentrate on describing significant and user-"
694 "visible changes that were made since the last version."
697 # type: Content of: <chapter><section><section><para>
698 #. type: Content of: <chapter><section><section><para>
699 #: best-pkging-practices.dbk:441
701 "Focus on <emphasis>what</emphasis> was changed — who, how and when are "
702 "usually less important. Having said that, remember to politely attribute "
703 "people who have provided notable help in making the package (e.g., those who "
704 "have sent in patches)."
707 # type: Content of: <chapter><section><section><para>
708 #. type: Content of: <chapter><section><section><para>
709 #: best-pkging-practices.dbk:447
711 "There's no need to elaborate the trivial and obvious changes. You can also "
712 "aggregate several changes in one entry. On the other hand, don't be overly "
713 "terse if you have undertaken a major change. Be especially clear if there "
714 "are changes that affect the behaviour of the program. For further "
715 "explanations, use the <filename>README.Debian</filename> file."
718 # type: Content of: <chapter><section><section><para>
719 #. type: Content of: <chapter><section><section><para>
720 #: best-pkging-practices.dbk:454
722 "Use common English so that the majority of readers can comprehend it. Avoid "
723 "abbreviations, tech-speak and jargon when explaining changes that close "
724 "bugs, especially for bugs filed by users that did not strike you as "
725 "particularly technically savvy. Be polite, don't swear."
728 # type: Content of: <chapter><section><section><para>
729 #. type: Content of: <chapter><section><section><para>
730 #: best-pkging-practices.dbk:460
732 "It is sometimes desirable to prefix changelog entries with the names of the "
733 "files that were changed. However, there's no need to explicitly list each "
734 "and every last one of the changed files, especially if the change was small "
735 "or repetitive. You may use wildcards."
738 # type: Content of: <chapter><section><section><para>
739 #. type: Content of: <chapter><section><section><para>
740 #: best-pkging-practices.dbk:466
742 "When referring to bugs, don't assume anything. Say what the problem was, "
743 "how it was fixed, and append the closes: #nnnnn string. See <xref linkend="
744 "\"upload-bugfix\"/> for more information."
747 # type: Content of: <chapter><section><section><title>
748 #. type: Content of: <chapter><section><section><title>
749 #: best-pkging-practices.dbk:473
750 msgid "Common misconceptions about changelog entries"
753 # type: Content of: <chapter><section><section><para>
754 #. type: Content of: <chapter><section><section><para>
755 #: best-pkging-practices.dbk:475
757 "The changelog entries should <emphasis role=\"strong\">not</emphasis> "
758 "document generic packaging issues (Hey, if you're looking for foo.conf, it's "
759 "in /etc/blah/.), since administrators and users are supposed to be at least "
760 "remotely acquainted with how such things are generally arranged on Debian "
761 "systems. Do, however, mention if you change the location of a configuration "
765 #. type: Content of: <chapter><section><section><para>
766 #: best-pkging-practices.dbk:483
768 "The only bugs closed with a changelog entry should be those that are "
769 "actually fixed in the same package revision. Closing unrelated bugs in the "
770 "changelog is bad practice. See <xref linkend=\"upload-bugfix\"/>."
773 # type: Content of: <chapter><section><section><para>
774 #. type: Content of: <chapter><section><section><para>
775 #: best-pkging-practices.dbk:488
777 "The changelog entries should <emphasis role=\"strong\">not</emphasis> be "
778 "used for random discussion with bug reporters (I don't see segfaults when "
779 "starting foo with option bar; send in more info), general statements on "
780 "life, the universe and everything (sorry this upload took me so long, but I "
781 "caught the flu), or pleas for help (the bug list on this package is huge, "
782 "please lend me a hand). Such things usually won't be noticed by their "
783 "target audience, but may annoy people who wish to read information about "
784 "actual changes in the package. See <xref linkend=\"bug-answering\"/> for "
785 "more information on how to use the bug tracking system."
788 # type: Content of: <chapter><section><section><para>
789 #. type: Content of: <chapter><section><section><para>
790 #: best-pkging-practices.dbk:499
792 "It is an old tradition to acknowledge bugs fixed in non-maintainer uploads "
793 "in the first changelog entry of the proper maintainer upload. As we have "
794 "version tracking now, it is enough to keep the NMUed changelog entries and "
795 "just mention this fact in your own changelog entry."
798 # type: Content of: <chapter><section><section><title>
799 #. type: Content of: <chapter><section><section><title>
800 #: best-pkging-practices.dbk:507
801 msgid "Common errors in changelog entries"
804 # type: Content of: <chapter><section><section><para>
805 #. type: Content of: <chapter><section><section><para>
806 #: best-pkging-practices.dbk:509
808 "The following examples demonstrate some common errors or examples of bad "
809 "style in changelog entries."
812 # type: Content of: <chapter><section><section><screen>
813 #. type: Content of: <chapter><section><section><screen>
814 #: best-pkging-practices.dbk:513
816 msgid " * Fixed all outstanding bugs.\n"
817 msgstr " * Fixed all outstanding bugs.\n"
819 # type: Content of: <chapter><section><section><para>
820 #. type: Content of: <chapter><section><section><para>
821 #: best-pkging-practices.dbk:516
822 msgid "This doesn't tell readers anything too useful, obviously."
825 # type: Content of: <chapter><section><section><screen>
826 #. type: Content of: <chapter><section><section><screen>
827 #: best-pkging-practices.dbk:519
829 msgid " * Applied patch from Jane Random.\n"
830 msgstr " * Applied patch from Jane Random.\n"
832 # type: Content of: <chapter><section><section><para>
833 #. type: Content of: <chapter><section><section><para>
834 #: best-pkging-practices.dbk:522
835 msgid "What was the patch about?"
838 # type: Content of: <chapter><section><section><screen>
839 #. type: Content of: <chapter><section><section><screen>
840 #: best-pkging-practices.dbk:525
842 msgid " * Late night install target overhaul.\n"
843 msgstr " * Late night install target overhaul.\n"
845 # type: Content of: <chapter><section><section><para>
846 #. type: Content of: <chapter><section><section><para>
847 #: best-pkging-practices.dbk:528
849 "Overhaul which accomplished what? Is the mention of late night supposed to "
850 "remind us that we shouldn't trust that code?"
853 # type: Content of: <chapter><section><section><screen>
854 #. type: Content of: <chapter><section><section><screen>
855 #: best-pkging-practices.dbk:532
857 msgid " * Fix vsync FU w/ ancient CRTs.\n"
858 msgstr " * Fix vsync FU w/ ancient CRTs.\n"
860 # type: Content of: <chapter><section><section><para>
861 #. type: Content of: <chapter><section><section><para>
862 #: best-pkging-practices.dbk:535
864 "Too many acronyms, and it's not overly clear what the, uh, fsckup (oops, a "
865 "curse word!) was actually about, or how it was fixed."
868 # type: Content of: <chapter><section><section><screen>
869 #. type: Content of: <chapter><section><section><screen>
870 #: best-pkging-practices.dbk:539
872 msgid " * This is not a bug, closes: #nnnnnn.\n"
873 msgstr " * This is not a bug, closes: #nnnnnn.\n"
875 # type: Content of: <chapter><section><section><para>
876 #. type: Content of: <chapter><section><section><para>
877 #: best-pkging-practices.dbk:542
879 "First of all, there's absolutely no need to upload the package to convey "
880 "this information; instead, use the bug tracking system. Secondly, there's "
881 "no explanation as to why the report is not a bug."
884 # type: Content of: <chapter><section><section><screen>
885 #. type: Content of: <chapter><section><section><screen>
886 #: best-pkging-practices.dbk:547
888 msgid " * Has been fixed for ages, but I forgot to close; closes: #54321.\n"
889 msgstr " * Has been fixed for ages, but I forgot to close; closes: #54321.\n"
891 # type: Content of: <chapter><section><section><para>
892 #. type: Content of: <chapter><section><section><para>
893 #: best-pkging-practices.dbk:550
895 "If for some reason you didn't mention the bug number in a previous changelog "
896 "entry, there's no problem, just close the bug normally in the BTS. There's "
897 "no need to touch the changelog file, presuming the description of the fix is "
898 "already in (this applies to the fixes by the upstream authors/maintainers as "
899 "well, you don't have to track bugs that they fixed ages ago in your "
903 # type: Content of: <chapter><section><section><screen>
904 #. type: Content of: <chapter><section><section><screen>
905 #: best-pkging-practices.dbk:557
907 msgid " * Closes: #12345, #12346, #15432\n"
908 msgstr " * Closes: #12345, #12346, #15432\n"
910 # type: Content of: <chapter><section><section><para>
911 #. type: Content of: <chapter><section><section><para>
912 #: best-pkging-practices.dbk:560
914 "Where's the description? If you can't think of a descriptive message, start "
915 "by inserting the title of each different bug."
918 #. type: Content of: <chapter><section><section><title>
919 #: best-pkging-practices.dbk:566
920 msgid "Supplementing changelogs with <filename>NEWS.Debian</filename> files"
923 #. type: Content of: <chapter><section><section><para>
924 #: best-pkging-practices.dbk:568
926 "Important news about changes in a package can also be put in <filename>NEWS."
927 "Debian</filename> files. The news will be displayed by tools like "
928 "<systemitem role=\"package\">apt-listchanges</systemitem>, before all the "
929 "rest of the changelogs. This is the preferred means to let the user know "
930 "about significant changes in a package. It is better than using <systemitem "
931 "role=\"package\">debconf</systemitem> notes since it is less annoying and "
932 "the user can go back and refer to the <filename>NEWS.Debian</filename> file "
933 "after the install. And it's better than listing major changes in "
934 "<filename>README.Debian</filename>, since the user can easily miss such "
938 #. type: Content of: <chapter><section><section><para>
939 #: best-pkging-practices.dbk:579
941 "The file format is the same as a debian changelog file, but leave off the "
942 "asterisks and describe each news item with a full paragraph when necessary "
943 "rather than the more concise summaries that would go in a changelog. It's a "
944 "good idea to run your file through <literal>dpkg-parsechangelog</literal> to "
945 "check its formatting as it will not be automatically checked during build as "
946 "the changelog is. Here is an example of a real <filename>NEWS.Debian</"
950 # type: Content of: <chapter><section><section><screen>
951 #. type: Content of: <chapter><section><section><screen>
952 #: best-pkging-practices.dbk:588
955 "cron (3.0pl1-74) unstable; urgency=low\n"
957 " The checksecurity script is no longer included with the cron package:\n"
958 " it now has its own package, checksecurity. If you liked the\n"
959 " functionality provided with that script, please install the new\n"
962 " -- Steve Greenland <stevegr@debian.org> Sat, 6 Sep 2003 17:15:03 -0500\n"
964 "cron (3.0pl1-74) unstable; urgency=low\n"
966 " The checksecurity script is no longer included with the cron package:\n"
967 " it now has its own package, checksecurity. If you liked the\n"
968 " functionality provided with that script, please install the new\n"
971 " -- Steve Greenland <stevegr@debian.org> Sat, 6 Sep 2003 17:15:03 -0500\n"
973 #. type: Content of: <chapter><section><section><para>
974 #: best-pkging-practices.dbk:598
976 "The <filename>NEWS.Debian</filename> file is installed as <filename>/usr/"
977 "share/doc/<replaceable>package</replaceable>/NEWS.Debian.gz</filename>. It "
978 "is compressed, and always has that name even in Debian native packages. If "
979 "you use <literal>debhelper</literal>, <literal>dh_installchangelogs</"
980 "literal> will install <filename>debian/NEWS</filename> files for you."
983 # type: Content of: <chapter><section><section><para>
984 #. type: Content of: <chapter><section><section><para>
985 #: best-pkging-practices.dbk:605
987 "Unlike changelog files, you need not update <filename>NEWS.Debian</filename> "
988 "files with every release. Only update them if you have something "
989 "particularly newsworthy that user should know about. If you have no news at "
990 "all, there's no need to ship a <filename>NEWS.Debian</filename> file in your "
991 "package. No news is good news!"
994 # type: Content of: <chapter><section><title>
995 #. type: Content of: <chapter><section><title>
996 #: best-pkging-practices.dbk:627
997 msgid "Best practices for maintainer scripts"
998 msgstr "メンテナスクリプトのベストプラクティス"
1000 # type: Content of: <chapter><section><para>
1001 #. type: Content of: <chapter><section><para>
1002 #: best-pkging-practices.dbk:629
1004 "Maintainer scripts include the files <filename>debian/postinst</filename>, "
1005 "<filename>debian/preinst</filename>, <filename>debian/prerm</filename> and "
1006 "<filename>debian/postrm</filename>. These scripts take care of any package "
1007 "installation or deinstallation setup which isn't handled merely by the "
1008 "creation or removal of files and directories. The following instructions "
1009 "supplement the <ulink url=\"&url-debian-policy;\">Debian Policy</ulink>."
1012 # type: Content of: <chapter><section><para>
1013 #. type: Content of: <chapter><section><para>
1014 #: best-pkging-practices.dbk:637
1016 "Maintainer scripts must be idempotent. That means that you need to make "
1017 "sure nothing bad will happen if the script is called twice where it would "
1018 "usually be called once."
1021 # type: Content of: <chapter><section><para>
1022 #. type: Content of: <chapter><section><para>
1023 #: best-pkging-practices.dbk:642
1025 "Standard input and output may be redirected (e.g. into pipes) for logging "
1026 "purposes, so don't rely on them being a tty."
1029 # type: Content of: <chapter><section><para>
1030 #. type: Content of: <chapter><section><para>
1031 #: best-pkging-practices.dbk:646
1033 "All prompting or interactive configuration should be kept to a minimum. "
1034 "When it is necessary, you should use the <systemitem role=\"package"
1035 "\">debconf</systemitem> package for the interface. Remember that prompting "
1036 "in any case can only be in the <literal>configure</literal> stage of the "
1037 "<filename>postinst</filename> script."
1040 # type: Content of: <chapter><section><para>
1041 #. type: Content of: <chapter><section><para>
1042 #: best-pkging-practices.dbk:653
1044 "Keep the maintainer scripts as simple as possible. We suggest you use pure "
1045 "POSIX shell scripts. Remember, if you do need any bash features, the "
1046 "maintainer script must have a bash shebang line. POSIX shell or Bash are "
1047 "preferred to Perl, since they enable <systemitem role=\"package\">debhelper</"
1048 "systemitem> to easily add bits to the scripts."
1051 # type: Content of: <chapter><section><para>
1052 #. type: Content of: <chapter><section><para>
1053 #: best-pkging-practices.dbk:660
1055 "If you change your maintainer scripts, be sure to test package removal, "
1056 "double installation, and purging. Be sure that a purged package is "
1057 "completely gone, that is, it must remove any files created, directly or "
1058 "indirectly, in any maintainer script."
1061 # type: Content of: <chapter><section><para>
1062 #. type: Content of: <chapter><section><para>
1063 #: best-pkging-practices.dbk:666
1065 "If you need to check for the existence of a command, you should use "
1069 # type: Content of: <chapter><section><programlisting>
1070 #. type: Content of: <chapter><section><programlisting>
1071 #: best-pkging-practices.dbk:669
1073 msgid "if [ -x /usr/sbin/install-docs ]; then ..."
1074 msgstr "if [ -x /usr/sbin/install-docs ]; then ..."
1076 # type: Content of: <chapter><section><para>
1077 #. type: Content of: <chapter><section><para>
1078 #: best-pkging-practices.dbk:671
1080 "If you don't wish to hard-code the path of a command in your maintainer "
1081 "script, the following POSIX-compliant shell function may help:"
1084 #. type: Content of: <chapter><section><para>
1085 #: best-pkging-practices.dbk:676
1087 "You can use this function to search <varname>$PATH</varname> for a command "
1088 "name, passed as an argument. It returns true (zero) if the command was "
1089 "found, and false if not. This is really the most portable way, since "
1090 "<literal>command -v</literal>, <command>type</command>, and <command>which</"
1091 "command> are not POSIX."
1094 # type: Content of: <chapter><section><para>
1095 #. type: Content of: <chapter><section><para>
1096 #: best-pkging-practices.dbk:683
1098 "While <command>which</command> is an acceptable alternative, since it is "
1099 "from the required <systemitem role=\"package\">debianutils</systemitem> "
1100 "package, it's not on the root partition. That is, it's in <filename>/usr/"
1101 "bin</filename> rather than <filename>/bin</filename>, so one can't use it in "
1102 "scripts which are run before the <filename>/usr</filename> partition is "
1103 "mounted. Most scripts won't have this problem, though."
1106 # type: Content of: <chapter><section><title>
1107 #. type: Content of: <chapter><section><title>
1108 #: best-pkging-practices.dbk:693
1110 "Configuration management with <systemitem role=\"package\">debconf</"
1114 # type: Content of: <chapter><section><para>
1115 #. type: Content of: <chapter><section><para>
1116 #: best-pkging-practices.dbk:695
1118 "<systemitem role=\"package\">Debconf</systemitem> is a configuration "
1119 "management system which can be used by all the various packaging scripts "
1120 "(<filename>postinst</filename> mainly) to request feedback from the user "
1121 "concerning how to configure the package. Direct user interactions must now "
1122 "be avoided in favor of <systemitem role=\"package\">debconf</systemitem> "
1123 "interaction. This will enable non-interactive installations in the future."
1126 # type: Content of: <chapter><section><para>
1127 #. type: Content of: <chapter><section><para>
1128 #: best-pkging-practices.dbk:703
1130 "Debconf is a great tool but it is often poorly used. Many common mistakes "
1131 "are listed in the <citerefentry> <refentrytitle>debconf-devel</"
1132 "refentrytitle> <manvolnum>7</manvolnum> </citerefentry> man page. It is "
1133 "something that you must read if you decide to use debconf. Also, we "
1134 "document some best practices here."
1137 # type: Content of: <chapter><section><para>
1138 #. type: Content of: <chapter><section><para>
1139 #: best-pkging-practices.dbk:710
1141 "These guidelines include some writing style and typography recommendations, "
1142 "general considerations about debconf usage as well as more specific "
1143 "recommendations for some parts of the distribution (the installation system "
1147 # type: Content of: <chapter><section><section><title>
1148 #. type: Content of: <chapter><section><section><title>
1149 #: best-pkging-practices.dbk:716
1150 msgid "Do not abuse debconf"
1151 msgstr "debconf を乱用しない"
1153 # type: Content of: <chapter><section><section><para>
1154 #. type: Content of: <chapter><section><section><para>
1155 #: best-pkging-practices.dbk:718
1157 "Since debconf appeared in Debian, it has been widely abused and several "
1158 "criticisms received by the Debian distribution come from debconf abuse with "
1159 "the need of answering a wide bunch of questions before getting any little "
1163 #. type: Content of: <chapter><section><section><para>
1164 #: best-pkging-practices.dbk:724
1166 "Keep usage notes to what they belong: the <filename>NEWS.Debian</filename>, "
1167 "or <filename>README.Debian</filename> file. Only use notes for important "
1168 "notes which may directly affect the package usability. Remember that notes "
1169 "will always block the install until confirmed or bother the user by email."
1172 # type: Content of: <chapter><section><section><para>
1173 #. type: Content of: <chapter><section><section><para>
1174 #: best-pkging-practices.dbk:730
1176 "Carefully choose the questions priorities in maintainer scripts. See "
1177 "<citerefentry> <refentrytitle>debconf-devel</refentrytitle> <manvolnum>7</"
1178 "manvolnum> </citerefentry> for details about priorities. Most questions "
1179 "should use medium and low priorities."
1182 # type: Content of: <chapter><section><section><title>
1183 #. type: Content of: <chapter><section><section><title>
1184 #: best-pkging-practices.dbk:738
1185 msgid "General recommendations for authors and translators"
1188 # type: Content of: <chapter><section><section><section><title>
1189 #. type: Content of: <chapter><section><section><section><title>
1190 #: best-pkging-practices.dbk:740
1191 msgid "Write correct English"
1194 # type: Content of: <chapter><section><section><section><para>
1195 #. type: Content of: <chapter><section><section><section><para>
1196 #: best-pkging-practices.dbk:742
1198 "Most Debian package maintainers are not native English speakers. So, "
1199 "writing properly phrased templates may not be easy for them."
1202 # type: Content of: <chapter><section><section><section><para>
1203 #. type: Content of: <chapter><section><section><section><para>
1204 #: best-pkging-practices.dbk:746
1206 "Please use (and abuse) &email-debian-l10n-english; mailing list. Have your "
1207 "templates proofread."
1210 #. type: Content of: <chapter><section><section><section><para>
1211 #: best-pkging-practices.dbk:750
1213 "Badly written templates give a poor image of your package, of your work... "
1214 "or even of Debian itself."
1217 # type: Content of: <chapter><section><section><section><para>
1218 #. type: Content of: <chapter><section><section><section><para>
1219 #: best-pkging-practices.dbk:754
1221 "Avoid technical jargon as much as possible. If some terms sound common to "
1222 "you, they may be impossible to understand for others. If you cannot avoid "
1223 "them, try to explain them (use the extended description). When doing so, "
1224 "try to balance between verbosity and simplicity."
1227 # type: Content of: <chapter><section><section><section><title>
1228 #. type: Content of: <chapter><section><section><section><title>
1229 #: best-pkging-practices.dbk:762
1230 msgid "Be kind to translators"
1233 # type: Content of: <chapter><section><section><section><para>
1234 #. type: Content of: <chapter><section><section><section><para>
1235 #: best-pkging-practices.dbk:764
1237 "Debconf templates may be translated. Debconf, along with its sister package "
1238 "<command>po-debconf</command> offers a simple framework for getting "
1239 "templates translated by translation teams or even individuals."
1242 #. type: Content of: <chapter><section><section><section><para>
1243 #: best-pkging-practices.dbk:769
1245 "Please use gettext-based templates. Install <systemitem role=\"package\">po-"
1246 "debconf</systemitem> on your development system and read its documentation "
1247 "(<command>man po-debconf</command> is a good start)."
1250 #. type: Content of: <chapter><section><section><section><para>
1251 #: best-pkging-practices.dbk:774
1253 "Avoid changing templates too often. Changing templates text induces more "
1254 "work to translators which will get their translation fuzzied. A fuzzy "
1255 "translation is a string for which the original changed since it was "
1256 "translated, therefore requiring some update by a translator to be usable. "
1257 "When changes are small enough, the original translation is kept in PO files "
1258 "but marked as <literal>fuzzy</literal>."
1261 #. type: Content of: <chapter><section><section><section><para>
1262 #: best-pkging-practices.dbk:782
1264 "If you plan to do changes to your original templates, please use the "
1265 "notification system provided with the <systemitem role=\"package\">po-"
1266 "debconf</systemitem> package, namely the <command>podebconf-report-po</"
1267 "command>, to contact translators. Most active translators are very "
1268 "responsive and getting their work included along with your modified "
1269 "templates will save you additional uploads. If you use gettext-based "
1270 "templates, the translator's name and e-mail addresses are mentioned in the "
1271 "PO files headers and will be used by <command>podebconf-report-po</command>."
1274 #. type: Content of: <chapter><section><section><section><para>
1275 #: best-pkging-practices.dbk:794
1276 msgid "A recommended use of that utility is:"
1279 #. type: Content of: <chapter><section><section><section><programlisting>
1280 #: best-pkging-practices.dbk:796
1282 msgid "cd debian/po && podebconf-report-po --call --languageteam --withtranslators --deadline=\"+10 days\""
1285 #. type: Content of: <chapter><section><section><section><para>
1286 #: best-pkging-practices.dbk:798
1288 "This command will first synchronize the PO and POT files in <filename>debian/"
1289 "po</filename> with the templates files listed in <filename>debian/po/"
1290 "POTFILES.in</filename>. Then, it will send a call for new translations, in "
1291 "the &email-debian-i18n; mailing list. Finally, it will also send a call for "
1292 "translation updates to the language team (mentioned in the <literal>Language-"
1293 "Team</literal> field of each PO file) as well as the last translator "
1294 "(mentioned in <literal>Last-translator</literal>)."
1297 #. type: Content of: <chapter><section><section><section><para>
1298 #: best-pkging-practices.dbk:807
1300 "Giving a deadline to translators is always appreciated, so that they can "
1301 "organize their work. Please remember that some translation teams have a "
1302 "formalized translate/review process and a delay lower than 10 days is "
1303 "considered as unreasonable. A shorter delay puts too much pressure on "
1304 "translation teams and should be kept for very minor changes."
1307 # type: Content of: <chapter><section><section><section><para>
1308 #. type: Content of: <chapter><section><section><section><para>
1309 #: best-pkging-practices.dbk:814
1311 "If in doubt, you may also contact the translation team for a given language "
1312 "(debian-l10n-xxxxx@&lists-host;), or the &email-debian-i18n; mailing list."
1315 # type: Content of: <chapter><section><section><section><title>
1316 #. type: Content of: <chapter><section><section><section><title>
1317 #: best-pkging-practices.dbk:821
1318 msgid "Unfuzzy complete translations when correcting typos and spelling"
1321 #. type: Content of: <chapter><section><section><section><para>
1322 #: best-pkging-practices.dbk:823
1324 "When the text of a debconf template is corrected and you are <emphasis role="
1325 "\"strong\">sure</emphasis> that the change does <emphasis role=\"strong"
1326 "\">not</emphasis> affect translations, please be kind to translators and "
1327 "<emphasis>unfuzzy</emphasis> their translations."
1330 # type: Content of: <chapter><section><section><section><para>
1331 #. type: Content of: <chapter><section><section><section><para>
1332 #: best-pkging-practices.dbk:829
1334 "If you don't do so, the whole template will not be translated as long as a "
1335 "translator will send you an update."
1338 #. type: Content of: <chapter><section><section><section><para>
1339 #: best-pkging-practices.dbk:833
1341 "To <emphasis>unfuzzy</emphasis> translations, you can use two methods. The "
1342 "first method does <emphasis>preventive</emphasis> search and replace actions "
1343 "in the PO files. The latter uses <command>gettext</command> utilities to "
1344 "<emphasis>unfuzzy</emphasis> strings."
1347 #. type: Content of: <chapter><section><section><section><para>
1348 #: best-pkging-practices.dbk:839
1349 msgid "<emphasis>Preventive unfuzzy</emphasis> method:"
1352 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1353 #: best-pkging-practices.dbk:844
1355 "Try finding a complete translation file <emphasis role=\"strong\">before</"
1356 "emphasis> the change:"
1359 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1360 #: best-pkging-practices.dbk:847 best-pkging-practices.dbk:918
1362 msgid "for i in debian/po/*po; do echo -n $i: ; msgfmt -o /dev/null --statistics $i; done"
1365 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1366 #: best-pkging-practices.dbk:849
1368 "The file only showing <emphasis>translated</emphasis> items will be used as "
1369 "the reference file. If there is none (which should not happen if you take "
1370 "care to properly interact with translators), you should use the file with "
1371 "the most translated strings."
1374 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1375 #: best-pkging-practices.dbk:857
1377 "Identify the needed change. In this example, let's assume the change is "
1378 "about fixing a typo in the word <literal>typo</literal> which was "
1379 "inadvertently written as <literal>tpyo</literal>. Therefore, the change is "
1380 "<command>s/tpyo/typo</command>."
1383 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1384 #: best-pkging-practices.dbk:865
1386 "Check that this change is only applied to the place where you really intend "
1387 "to make it and <emphasis role=\"strong\">not</emphasis> in any other place "
1388 "where the original string is appropriate. This specifically applies to "
1389 "change in punctuation, for instance."
1392 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1393 #: best-pkging-practices.dbk:873
1395 "Modify all PO files by using <command>sed</command>. The use of that command "
1396 "is recommended over any text editor to guarantee that the files encoding "
1397 "will not be broken by the edit action:"
1400 # type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1401 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1402 #: best-pkging-practices.dbk:878
1406 "for i in *.po; do sed -i 's/tpyo/typo/g' $i; done\n"
1409 "for i in *.po; do sed -i 's/tpyo/typo/g' $i; done\n"
1411 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1412 #: best-pkging-practices.dbk:884
1413 msgid "Change the debconf template file to fix the typo."
1416 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1417 #: best-pkging-practices.dbk:889
1418 msgid "Run <command>debconf-updatepo</command>."
1419 msgstr "<command>debconf-updatepo</command> を実行する。"
1421 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1422 #: best-pkging-practices.dbk:894
1424 "Check the <filename>foo.po</filename> reference file. Its statistics should "
1428 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1429 #: best-pkging-practices.dbk:898
1431 msgid "msgfmt -o /dev/null --statistics debian/po/foo.po\n"
1432 msgstr "msgfmt -o /dev/null --statistics debian/po/foo.po\n"
1434 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1435 #: best-pkging-practices.dbk:903
1437 "If the file's statistics changed, you did something wrong. Try again or ask "
1438 "for help on the &email-debian-i18n; mailing list."
1441 #. type: Content of: <chapter><section><section><section><para>
1442 #: best-pkging-practices.dbk:909
1443 msgid "Gettext utilities method:"
1444 msgstr "gettext ユーティリティを使う方法:"
1446 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1447 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1448 #: best-pkging-practices.dbk:914
1450 "Put all incomplete PO files out of the way. You can check the completeness "
1451 "by using (needs the <systemitem role=\"package\">gettext</systemitem> "
1452 "package installed):"
1455 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1456 #: best-pkging-practices.dbk:922
1458 "Move all files which report either fuzzy strings to a temporary place. "
1459 "Files which report no fuzzy strings (only translated and untranslated) will "
1463 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1464 #: best-pkging-practices.dbk:929
1466 "Now <emphasis role=\"strong\">and now only</emphasis>, modify the template "
1467 "for the typos and check again that translation are not impacted (typos, "
1468 "spelling errors, sometimes typographical corrections are usually OK)."
1471 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1472 #: best-pkging-practices.dbk:936
1474 "Run <command>debconf-updatepo</command>. This will fuzzy all strings you "
1475 "modified in translations. You can see this by running the above again."
1478 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1479 #: best-pkging-practices.dbk:942
1480 msgid "Use the following command:"
1483 # type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1484 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><programlisting>
1485 #: best-pkging-practices.dbk:944
1487 msgid "for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done"
1488 msgstr "for i in debian/po/*po; do msgattrib --output-file=$i --clear-fuzzy $i; done"
1490 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1491 #: best-pkging-practices.dbk:948
1493 "Move back to <filename>debian/po</filename> the files which showed fuzzy "
1494 "strings in the first step."
1497 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
1498 #: best-pkging-practices.dbk:953
1499 msgid "Run <command>debconf-updatepo</command> again."
1502 # type: Content of: <chapter><section><section><section><title>
1503 #. type: Content of: <chapter><section><section><section><title>
1504 #: best-pkging-practices.dbk:960
1505 msgid "Do not make assumptions about interfaces"
1508 #. type: Content of: <chapter><section><section><section><para>
1509 #: best-pkging-practices.dbk:962
1511 "Templates text should not make reference to widgets belonging to some "
1512 "debconf interfaces. Sentences like <emphasis>If you answer Yes...</"
1513 "emphasis> have no meaning for users of graphical interfaces which use "
1514 "checkboxes for boolean questions."
1517 # type: Content of: <chapter><section><section><section><para>
1518 #. type: Content of: <chapter><section><section><section><para>
1519 #: best-pkging-practices.dbk:967
1521 "String templates should also avoid mentioning the default values in their "
1522 "description. First, because this is redundant with the values seen by the "
1523 "users. Also, because these default values may be different from the "
1524 "maintainer choices (for instance, when the debconf database was preseeded)."
1527 # type: Content of: <chapter><section><section><section><para>
1528 #. type: Content of: <chapter><section><section><section><para>
1529 #: best-pkging-practices.dbk:973
1531 "More generally speaking, try to avoid referring to user actions. Just give "
1535 # type: Content of: <chapter><section><section><section><title>
1536 #. type: Content of: <chapter><section><section><section><title>
1537 #: best-pkging-practices.dbk:979
1538 msgid "Do not use first person"
1541 #. type: Content of: <chapter><section><section><section><para>
1542 #: best-pkging-practices.dbk:981
1544 "You should avoid the use of first person (<emphasis>I will do this...</"
1545 "emphasis> or <emphasis>We recommend...</emphasis>). The computer is not a "
1546 "person and the Debconf templates do not speak for the Debian developers. "
1547 "You should use neutral construction. Those of you who already wrote "
1548 "scientific publications, just write your templates like you would write a "
1549 "scientific paper. However, try using active voice if still possible, like "
1550 "<emphasis>Enable this if ...</emphasis> instead of <emphasis>This can be "
1551 "enabled if...</emphasis>."
1554 # type: Content of: <chapter><section><section><section><title>
1555 #. type: Content of: <chapter><section><section><section><title>
1556 #: best-pkging-practices.dbk:991
1557 msgid "Be gender neutral"
1560 # type: Content of: <chapter><section><section><section><para>
1561 #. type: Content of: <chapter><section><section><section><para>
1562 #: best-pkging-practices.dbk:993
1564 "The world is made of men and women. Please use gender-neutral constructions "
1568 # type: Content of: <chapter><section><section><title>
1569 #. type: Content of: <chapter><section><section><title>
1570 #: best-pkging-practices.dbk:1001
1571 msgid "Templates fields definition"
1574 # type: Content of: <chapter><section><section><para>
1575 #. type: Content of: <chapter><section><section><para>
1576 #: best-pkging-practices.dbk:1003
1578 "This part gives some information which is mostly taken from the "
1579 "<citerefentry> <refentrytitle>debconf-devel</refentrytitle> <manvolnum>7</"
1580 "manvolnum> </citerefentry> manual page."
1583 # type: Content of: <chapter><section><section><section><title>
1584 #. type: Content of: <chapter><section><section><section><title>
1585 #: best-pkging-practices.dbk:1008
1589 #. type: Content of: <chapter><section><section><section><section><title>
1590 #: best-pkging-practices.dbk:1010
1594 # type: Content of: <chapter><section><section><section><section><para>
1595 #. type: Content of: <chapter><section><section><section><section><para>
1596 #: best-pkging-practices.dbk:1012
1598 "Results in a free-form input field that the user can type any string into."
1601 #. type: Content of: <chapter><section><section><section><section><title>
1602 #: best-pkging-practices.dbk:1017
1606 # type: Content of: <chapter><section><section><section><section><para>
1607 #. type: Content of: <chapter><section><section><section><section><para>
1608 #: best-pkging-practices.dbk:1019
1610 "Prompts the user for a password. Use this with caution; be aware that the "
1611 "password the user enters will be written to debconf's database. You should "
1612 "probably clean that value out of the database as soon as is possible."
1615 #. type: Content of: <chapter><section><section><section><section><title>
1616 #: best-pkging-practices.dbk:1026
1620 # type: Content of: <chapter><section><section><section><section><para>
1621 #. type: Content of: <chapter><section><section><section><section><para>
1622 #: best-pkging-practices.dbk:1028
1624 "A true/false choice. Remember: true/false, <emphasis role=\"strong\">not "
1625 "yes/no</emphasis>..."
1628 #. type: Content of: <chapter><section><section><section><section><title>
1629 #: best-pkging-practices.dbk:1034
1633 #. type: Content of: <chapter><section><section><section><section><para>
1634 #: best-pkging-practices.dbk:1036
1636 "A choice between one of a number of values. The choices must be specified "
1637 "in a field named 'Choices'. Separate the possible values with commas and "
1638 "spaces, like this: <literal>Choices: yes, no, maybe</literal>."
1641 #. type: Content of: <chapter><section><section><section><section><para>
1642 #: best-pkging-practices.dbk:1041
1644 "If choices are translatable strings, the 'Choices' field may be marked as "
1645 "translatable by using <literal>__Choices</literal>. The double underscore "
1646 "will split out each choice in a separate string."
1649 #. type: Content of: <chapter><section><section><section><section><para>
1650 #: best-pkging-practices.dbk:1046
1652 "The <command>po-debconf</command> system also offers interesting "
1653 "possibilities to only mark <emphasis role=\"strong\">some</emphasis> choices "
1654 "as translatable. Example:"
1657 #. type: Content of: <chapter><section><section><section><section><programlisting>
1658 #: best-pkging-practices.dbk:1051
1661 "Template: foo/bar\n"
1663 "#flag:translate:3\n"
1664 "__Choices: PAL, SECAM, Other\n"
1665 "_Description: TV standard:\n"
1666 " Please choose the TV standard used in your country.\n"
1668 "Template: foo/bar\n"
1670 "#flag:translate:3\n"
1671 "__Choices: PAL, SECAM, Other\n"
1672 "_Description: TV standard:\n"
1673 " Please choose the TV standard used in your country.\n"
1675 #. type: Content of: <chapter><section><section><section><section><para>
1676 #: best-pkging-practices.dbk:1059
1678 "In that example, only the 'Other' string is translatable while others are "
1679 "acronyms that should not be translated. The above allows only 'Other' to be "
1680 "included in PO and POT files."
1683 #. type: Content of: <chapter><section><section><section><section><para>
1684 #: best-pkging-practices.dbk:1064
1686 "The debconf templates flag system offers many such possibilities. The "
1687 "<citerefentry> <refentrytitle>po-debconf</refentrytitle> <manvolnum>7</"
1688 "manvolnum> </citerefentry> manual page lists all these possibilities."
1691 #. type: Content of: <chapter><section><section><section><section><title>
1692 #: best-pkging-practices.dbk:1072
1694 msgstr "multiselect"
1696 # type: Content of: <chapter><section><section><section><section><para>
1697 #. type: Content of: <chapter><section><section><section><section><para>
1698 #: best-pkging-practices.dbk:1074
1700 "Like the select data type, except the user can choose any number of items "
1701 "from the choices list (or chose none of them)."
1704 #. type: Content of: <chapter><section><section><section><section><title>
1705 #: best-pkging-practices.dbk:1080
1709 # type: Content of: <chapter><section><section><section><section><para>
1710 #. type: Content of: <chapter><section><section><section><section><para>
1711 #: best-pkging-practices.dbk:1082
1713 "Rather than being a question per se, this datatype indicates a note that can "
1714 "be displayed to the user. It should be used only for important notes that "
1715 "the user really should see, since debconf will go to great pains to make "
1716 "sure the user sees it; halting the install for them to press a key, and even "
1717 "mailing the note to them in some cases."
1720 #. type: Content of: <chapter><section><section><section><section><title>
1721 #: best-pkging-practices.dbk:1091
1725 # type: Content of: <chapter><section><section><section><section><para>
1726 #. type: Content of: <chapter><section><section><section><section><para>
1727 #: best-pkging-practices.dbk:1093
1728 msgid "This type is now considered obsolete: don't use it."
1731 #. type: Content of: <chapter><section><section><section><section><title>
1732 #: best-pkging-practices.dbk:1098
1736 # type: Content of: <chapter><section><section><section><section><para>
1737 #. type: Content of: <chapter><section><section><section><section><para>
1738 #: best-pkging-practices.dbk:1100
1740 "This type is designed to handle error messages. It is mostly similar to the "
1741 "note type. Frontends may present it differently (for instance, the dialog "
1742 "frontend of cdebconf draws a red screen instead of the usual blue one)."
1745 # type: Content of: <chapter><section><section><section><section><para>
1746 #. type: Content of: <chapter><section><section><section><section><para>
1747 #: best-pkging-practices.dbk:1105
1749 "It is recommended to use this type for any message that needs user attention "
1750 "for a correction of any kind."
1753 # type: Content of: <chapter><section><section><section><title>
1754 #. type: Content of: <chapter><section><section><section><title>
1755 #: best-pkging-practices.dbk:1113
1756 msgid "Description: short and extended description"
1759 # type: Content of: <chapter><section><section><section><para>
1760 #. type: Content of: <chapter><section><section><section><para>
1761 #: best-pkging-practices.dbk:1115
1763 "Template descriptions have two parts: short and extended. The short "
1764 "description is in the Description: line of the template."
1767 # type: Content of: <chapter><section><section><section><para>
1768 #. type: Content of: <chapter><section><section><section><para>
1769 #: best-pkging-practices.dbk:1119
1771 "The short description should be kept short (50 characters or so) so that it "
1772 "may be accommodated by most debconf interfaces. Keeping it short also helps "
1773 "translators, as usually translations tend to end up being longer than the "
1777 # type: Content of: <chapter><section><section><section><para>
1778 #. type: Content of: <chapter><section><section><section><para>
1779 #: best-pkging-practices.dbk:1125
1781 "The short description should be able to stand on its own. Some interfaces "
1782 "do not show the long description by default, or only if the user explicitely "
1783 "asks for it or even do not show it at all. Avoid things like What do you "
1787 # type: Content of: <chapter><section><section><section><para>
1788 #. type: Content of: <chapter><section><section><section><para>
1789 #: best-pkging-practices.dbk:1131
1791 "The short description does not necessarily have to be a full sentence. This "
1792 "is part of the keep it short and efficient recommendation."
1795 # type: Content of: <chapter><section><section><section><para>
1796 #. type: Content of: <chapter><section><section><section><para>
1797 #: best-pkging-practices.dbk:1135
1799 "The extended description should not repeat the short description word for "
1800 "word. If you can't think up a long description, then first, think some "
1801 "more. Post to debian-devel. Ask for help. Take a writing class! That "
1802 "extended description is important. If after all that you still can't come "
1803 "up with anything, leave it blank."
1806 # type: Content of: <chapter><section><section><section><para>
1807 #. type: Content of: <chapter><section><section><section><para>
1808 #: best-pkging-practices.dbk:1142
1810 "The extended description should use complete sentences. Paragraphs should "
1811 "be kept short for improved readability. Do not mix two ideas in the same "
1812 "paragraph but rather use another paragraph."
1815 # type: Content of: <chapter><section><section><section><para>
1816 #. type: Content of: <chapter><section><section><section><para>
1817 #: best-pkging-practices.dbk:1147
1819 "Don't be too verbose. User tend to ignore too long screens. 20 lines are "
1820 "by experience a border you shouldn't cross, because that means that in the "
1821 "classical dialog interface, people will need to scroll, and lot of people "
1822 "just don't do that."
1825 # type: Content of: <chapter><section><section><section><para>
1826 #. type: Content of: <chapter><section><section><section><para>
1827 #: best-pkging-practices.dbk:1153
1829 "The extended description should <emphasis role=\"strong\">never</emphasis> "
1830 "include a question."
1833 # type: Content of: <chapter><section><section><section><para>
1834 #. type: Content of: <chapter><section><section><section><para>
1835 #: best-pkging-practices.dbk:1157
1837 "For specific rules depending on templates type (string, boolean, etc.), "
1838 "please read below."
1841 # type: Content of: <chapter><section><section><section><title>
1842 #. type: Content of: <chapter><section><section><section><title>
1843 #: best-pkging-practices.dbk:1163
1847 #. type: Content of: <chapter><section><section><section><para>
1848 #: best-pkging-practices.dbk:1165
1850 "This field should be used for select and multiselect types. It contains the "
1851 "possible choices which will be presented to users. These choices should be "
1852 "separated by commas."
1855 # type: Content of: <chapter><section><section><section><title>
1856 #. type: Content of: <chapter><section><section><section><title>
1857 #: best-pkging-practices.dbk:1172
1861 # type: Content of: <chapter><section><section><section><para>
1862 #. type: Content of: <chapter><section><section><section><para>
1863 #: best-pkging-practices.dbk:1174
1865 "This field is optional. It contains the default answer for string, select "
1866 "and multiselect templates. For multiselect templates, it may contain a "
1867 "comma-separated list of choices."
1870 # type: Content of: <chapter><section><section><title>
1871 #. type: Content of: <chapter><section><section><title>
1872 #: best-pkging-practices.dbk:1183
1873 msgid "Templates fields specific style guide"
1876 # type: Content of: <chapter><section><section><section><title>
1877 #. type: Content of: <chapter><section><section><section><title>
1878 #: best-pkging-practices.dbk:1185
1882 # type: Content of: <chapter><section><section><section><para>
1883 #. type: Content of: <chapter><section><section><section><para>
1884 #: best-pkging-practices.dbk:1187
1886 "No specific indication except: use the appropriate type by referring to the "
1890 # type: Content of: <chapter><section><section><section><title>
1891 #. type: Content of: <chapter><section><section><section><title>
1892 #: best-pkging-practices.dbk:1193
1893 msgid "Description field"
1896 # type: Content of: <chapter><section><section><section><para>
1897 #. type: Content of: <chapter><section><section><section><para>
1898 #: best-pkging-practices.dbk:1195
1900 "Below are specific instructions for properly writing the Description (short "
1901 "and extended) depending on the template type."
1904 # type: Content of: <chapter><section><section><section><section><title>
1905 #. type: Content of: <chapter><section><section><section><section><title>
1906 #: best-pkging-practices.dbk:1199
1907 msgid "String/password templates"
1910 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1911 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1912 #: best-pkging-practices.dbk:1203
1914 "The short description is a prompt and <emphasis role=\"strong\">not</"
1915 "emphasis> a title. Avoid question style prompts (IP Address?) in favour of "
1916 "opened prompts (IP address:). The use of colons is recommended."
1919 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1920 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1921 #: best-pkging-practices.dbk:1210
1923 "The extended description is a complement to the short description. In the "
1924 "extended part, explain what is being asked, rather than ask the same "
1925 "question again using longer words. Use complete sentences. Terse writing "
1926 "style is strongly discouraged."
1929 # type: Content of: <chapter><section><section><section><section><title>
1930 #. type: Content of: <chapter><section><section><section><section><title>
1931 #: best-pkging-practices.dbk:1220
1932 msgid "Boolean templates"
1935 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1936 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1937 #: best-pkging-practices.dbk:1224
1939 "The short description should be phrased in the form of a question which "
1940 "should be kept short and should generally end with a question mark. Terse "
1941 "writing style is permitted and even encouraged if the question is rather "
1942 "long (remember that translations are often longer than original versions)."
1945 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1946 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1947 #: best-pkging-practices.dbk:1232
1949 "Again, please avoid referring to specific interface widgets. A common "
1950 "mistake for such templates is if you answer Yes-type constructions."
1953 # type: Content of: <chapter><section><section><section><section><title>
1954 #. type: Content of: <chapter><section><section><section><section><title>
1955 #: best-pkging-practices.dbk:1240
1956 msgid "Select/Multiselect"
1959 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1960 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1961 #: best-pkging-practices.dbk:1244
1963 "The short description is a prompt and <emphasis role=\"strong\">not</"
1964 "emphasis> a title. Do <emphasis role=\"strong\">not</emphasis> use useless "
1965 "Please choose... constructions. Users are clever enough to figure out they "
1966 "have to choose something...:)"
1969 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1970 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1971 #: best-pkging-practices.dbk:1252
1973 "The extended description will complete the short description. It may refer "
1974 "to the available choices. It may also mention that the user may choose more "
1975 "than one of the available choices, if the template is a multiselect one "
1976 "(although the interface often makes this clear)."
1979 # type: Content of: <chapter><section><section><section><section><title>
1980 #. type: Content of: <chapter><section><section><section><section><title>
1981 #: best-pkging-practices.dbk:1262
1985 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1986 #: best-pkging-practices.dbk:1266
1988 "The short description should be considered to be a <emphasis role=\"strong"
1989 "\">title</emphasis>."
1992 # type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1993 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
1994 #: best-pkging-practices.dbk:1271
1996 "The extended description is what will be displayed as a more detailed "
1997 "explanation of the note. Phrases, no terse writing style."
2000 #. type: Content of: <chapter><section><section><section><section><itemizedlist><listitem><para>
2001 #: best-pkging-practices.dbk:1277
2003 "<emphasis role=\"strong\">Do not abuse debconf.</emphasis> Notes are the "
2004 "most common way to abuse debconf. As written in debconf-devel manual page: "
2005 "it's best to use them only for warning about very serious problems. The "
2006 "<filename>NEWS.Debian</filename> or <filename>README.Debian</filename> files "
2007 "are the appropriate location for a lot of notes. If, by reading this, you "
2008 "consider converting your Note type templates to entries in <filename>NEWS."
2009 "Debian</filename> or <filename>README.Debian</filename>, plus consider "
2010 "keeping existing translations for the future."
2013 # type: Content of: <chapter><section><section><section><title>
2014 #. type: Content of: <chapter><section><section><section><title>
2015 #: best-pkging-practices.dbk:1292
2016 msgid "Choices field"
2019 # type: Content of: <chapter><section><section><section><para>
2020 #. type: Content of: <chapter><section><section><section><para>
2021 #: best-pkging-practices.dbk:1294
2023 "If the Choices are likely to change often, please consider using the "
2024 "__Choices trick. This will split each individual choice into a single "
2025 "string, which will considerably help translators for doing their work."
2028 # type: Content of: <chapter><section><section><section><title>
2029 #. type: Content of: <chapter><section><section><section><title>
2030 #: best-pkging-practices.dbk:1301 best-pkging-practices.dbk:1339
2031 msgid "Default field"
2034 #. type: Content of: <chapter><section><section><section><para>
2035 #: best-pkging-practices.dbk:1303
2037 "If the default value, for a select template, is likely to vary depending on "
2038 "the user language (for instance, if the choice is a language choice), please "
2039 "use the _Default trick."
2042 #. type: Content of: <chapter><section><section><section><para>
2043 #: best-pkging-practices.dbk:1308
2045 "This special field allow translators to put the most appropriate choice "
2046 "according to their own language. It will become the default choice when "
2047 "their language is used while your own mentioned Default Choice will be used "
2048 "when using English."
2051 # type: Content of: <chapter><section><section><section><para>
2052 #. type: Content of: <chapter><section><section><section><para>
2053 #: best-pkging-practices.dbk:1314
2054 msgid "Example, taken from the geneweb package templates:"
2057 #. type: Content of: <chapter><section><section><section><screen>
2058 #: best-pkging-practices.dbk:1317
2061 "Template: geneweb/lang\n"
2063 "__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"
2064 "# This is the default choice. Translators may put their own language here\n"
2065 "# instead of the default.\n"
2066 "# WARNING : you MUST use the ENGLISH NAME of your language\n"
2067 "# For instance, the french translator will need to put French (fr) here.\n"
2068 "_Default: English[ translators, please see comment in PO files]\n"
2069 "_Description: Geneweb default language:\n"
2071 "Template: geneweb/lang\n"
2073 "__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"
2074 "# This is the default choice. Translators may put their own language here\n"
2075 "# instead of the default.\n"
2076 "# WARNING : you MUST use the ENGLISH NAME of your language\n"
2077 "# For instance, the french translator will need to put French (fr) here.\n"
2078 "_Default: English[ translators, please see comment in PO files]\n"
2079 "_Description: Geneweb default language:\n"
2081 # type: Content of: <chapter><section><section><section><para>
2082 #. type: Content of: <chapter><section><section><section><para>
2083 #: best-pkging-practices.dbk:1328
2085 "Note the use of brackets which allow internal comments in debconf fields. "
2086 "Also note the use of comments which will show up in files the translators "
2090 #. type: Content of: <chapter><section><section><section><para>
2091 #: best-pkging-practices.dbk:1333
2093 "The comments are needed as the _Default trick is a bit confusing: the "
2094 "translators may put their own choice"
2097 # type: Content of: <chapter><section><section><section><para>
2098 #. type: Content of: <chapter><section><section><section><para>
2099 #: best-pkging-practices.dbk:1341
2101 "Do NOT use empty default field. If you don't want to use default values, do "
2102 "not use Default at all."
2105 #. type: Content of: <chapter><section><section><section><para>
2106 #: best-pkging-practices.dbk:1345
2108 "If you use po-debconf (and you <emphasis role=\"strong\">should</emphasis>, "
2109 "see <xref linkend=\"s6.5.2.2\"/>), consider making this field translatable, "
2110 "if you think it may be translated."
2113 #. type: Content of: <chapter><section><section><section><para>
2114 #: best-pkging-practices.dbk:1350
2116 "If the default value may vary depending on language/country (for instance "
2117 "the default value for a language choice), consider using the special "
2118 "_Default type documented in <citerefentry> <refentrytitle>po-debconf</"
2119 "refentrytitle> <manvolnum>7</manvolnum> </citerefentry>."
2122 # type: Content of: <chapter><section><title>
2123 #. type: Content of: <chapter><section><title>
2124 #: best-pkging-practices.dbk:1362
2125 msgid "Internationalization"
2128 #. type: Content of: <chapter><section><para>
2129 #: best-pkging-practices.dbk:1364
2131 "This section contains global information for developers to make translators' "
2132 "life easier. More information for translators and developers interrested in "
2133 "internationalization are available in the <ulink url=\"&url-i18n-l10n;"
2134 "\">Internationalisation and localisation in Debian</ulink> documentation."
2137 # type: Content of: <chapter><section><section><title>
2138 #. type: Content of: <chapter><section><section><title>
2139 #: best-pkging-practices.dbk:1371
2140 msgid "Handling debconf translations"
2141 msgstr "debconf の翻訳を取り扱う"
2143 # type: Content of: <chapter><section><section><para>
2144 #. type: Content of: <chapter><section><section><para>
2145 #: best-pkging-practices.dbk:1373
2147 "Like porters, translators have a difficult task. They work on many packages "
2148 "and must collaborate with many different maintainers. Moreover, most of the "
2149 "time, they are not native English speakers, so you may need to be "
2150 "particularly patient with them."
2153 # type: Content of: <chapter><section><section><para>
2154 #. type: Content of: <chapter><section><section><para>
2155 #: best-pkging-practices.dbk:1379
2157 "The goal of <systemitem role=\"package\">debconf</systemitem> was to make "
2158 "packages configuration easier for maintainers and for users. Originally, "
2159 "translation of debconf templates was handled with <command>debconf-"
2160 "mergetemplate</command>. However, that technique is now deprecated; the "
2161 "best way to accomplish <systemitem role=\"package\">debconf</systemitem> "
2162 "internationalization is by using the <systemitem role=\"package\">po-"
2163 "debconf</systemitem> package. This method is easier both for maintainer and "
2164 "translators; transition scripts are provided."
2167 #. type: Content of: <chapter><section><section><para>
2168 #: best-pkging-practices.dbk:1389
2170 "Using <systemitem role=\"package\">po-debconf</systemitem>, the translation "
2171 "is stored in <filename>.po</filename> files (drawing from <command>gettext</"
2172 "command> translation techniques). Special template files contain the "
2173 "original messages and mark which fields are translatable. When you change "
2174 "the value of a translatable field, by calling <command>debconf-updatepo</"
2175 "command>, the translation is marked as needing attention from the "
2176 "translators. Then, at build time, the <command>dh_installdebconf</command> "
2177 "program takes care of all the needed magic to add the template along with "
2178 "the up-to-date translations into the binary packages. Refer to the "
2179 "<citerefentry> <refentrytitle>po-debconf</refentrytitle> <manvolnum>7</"
2180 "manvolnum> </citerefentry> manual page for details."
2183 # type: Content of: <chapter><section><section><title>
2184 #. type: Content of: <chapter><section><section><title>
2185 #: best-pkging-practices.dbk:1405
2186 msgid "Internationalized documentation"
2189 # type: Content of: <chapter><section><section><para>
2190 #. type: Content of: <chapter><section><section><para>
2191 #: best-pkging-practices.dbk:1407
2193 "Internationalizing documentation is crucial for users, but a lot of labor. "
2194 "There's no way to eliminate all that work, but you can make things easier "
2198 #. type: Content of: <chapter><section><section><para>
2199 #: best-pkging-practices.dbk:1412
2201 "If you maintain documentation of any size, it is easier for translators if "
2202 "they have access to a source control system. That lets translators see the "
2203 "differences between two versions of the documentation, so, for instance, "
2204 "they can see what needs to be retranslated. It is recommended that the "
2205 "translated documentation maintain a note about what source control revision "
2206 "the translation is based on. An interesting system is provided by <ulink "
2207 "url=\"&url-i18n-doc-check;\">doc-check</ulink> in the <systemitem role="
2208 "\"package\">debian-installer</systemitem> package, which shows an overview "
2209 "of the translation status for any given language, using structured comments "
2210 "for the current revision of the file to be translated and, for a translated "
2211 "file, the revision of the original file the translation is based on. You "
2212 "might wish to adapt and provide that in your VCS area."
2215 # type: Content of: <chapter><section><section><para>
2216 #. type: Content of: <chapter><section><section><para>
2217 #: best-pkging-practices.dbk:1426
2219 "If you maintain XML or SGML documentation, we suggest that you isolate any "
2220 "language-independent information and define those as entities in a separate "
2221 "file which is included by all the different translations. This makes it "
2222 "much easier, for instance, to keep URLs up to date across multiple files."
2225 #. type: Content of: <chapter><section><section><para>
2226 #: best-pkging-practices.dbk:1432
2228 "Some tools (e.g. <systemitem role=\"package\">po4a</systemitem>, <systemitem "
2229 "role=\"package\">poxml</systemitem>, or the <systemitem role=\"package"
2230 "\">translate-toolkit</systemitem>) are specialized in extracting the "
2231 "translatable material from different formats. They produce PO files, a "
2232 "format quite common to translators, which permits to see what needs to be "
2233 "retranslated when the translated document is updated."
2236 # type: Content of: <chapter><section><title>
2237 #. type: Content of: <chapter><section><title>
2238 #: best-pkging-practices.dbk:1444
2239 msgid "Common packaging situations"
2242 # type: Content of: <chapter><section><section><title>
2243 #. type: Content of: <chapter><section><section><title>
2244 #: best-pkging-practices.dbk:1455
2245 msgid "Packages using <command>autoconf</command>/<command>automake</command>"
2246 msgstr "<command>autoconf</command>/<command>automake</command> を使っているパッケージ"
2248 # type: Content of: <chapter><section><section><para>
2249 #. type: Content of: <chapter><section><section><para>
2250 #: best-pkging-practices.dbk:1457
2252 "Keeping <command>autoconf</command>'s <filename>config.sub</filename> and "
2253 "<filename>config.guess</filename> files up to date is critical for porters, "
2254 "especially on more volatile architectures. Some very good packaging "
2255 "practices for any package using <command>autoconf</command> and/or "
2256 "<command>automake</command> have been synthesized in &file-bpp-autotools; "
2257 "from the <systemitem role=\"package\">autotools-dev</systemitem> package. "
2258 "You're strongly encouraged to read this file and to follow the given "
2262 # type: Content of: <chapter><section><section><title>
2263 #. type: Content of: <chapter><section><section><title>
2264 #: best-pkging-practices.dbk:1469
2268 # type: Content of: <chapter><section><section><para>
2269 #. type: Content of: <chapter><section><section><para>
2270 #: best-pkging-practices.dbk:1471
2272 "Libraries are always difficult to package for various reasons. The policy "
2273 "imposes many constraints to ease their maintenance and to make sure upgrades "
2274 "are as simple as possible when a new upstream version comes out. Breakage "
2275 "in a library can result in dozens of dependent packages breaking."
2278 # type: Content of: <chapter><section><section><para>
2279 #. type: Content of: <chapter><section><section><para>
2280 #: best-pkging-practices.dbk:1477
2282 "Good practices for library packaging have been grouped in <ulink url=\"&url-"
2283 "libpkg-guide;\">the library packaging guide</ulink>."
2286 # type: Content of: <chapter><section><section><title>
2287 #. type: Content of: <chapter><section><section><title>
2288 #: best-pkging-practices.dbk:1484
2289 msgid "Documentation"
2292 # type: Content of: <chapter><section><section><para>
2293 #. type: Content of: <chapter><section><section><para>
2294 #: best-pkging-practices.dbk:1486
2296 "Be sure to follow the <ulink url=\"&url-debian-policy;ch-docs.html\">Policy "
2297 "on documentation</ulink>."
2300 # type: Content of: <chapter><section><section><para>
2301 #. type: Content of: <chapter><section><section><para>
2302 #: best-pkging-practices.dbk:1491
2304 "If your package contains documentation built from XML or SGML, we recommend "
2305 "you not ship the XML or SGML source in the binary package(s). If users want "
2306 "the source of the documentation, they should retrieve the source package."
2309 # type: Content of: <chapter><section><section><para>
2310 #. type: Content of: <chapter><section><section><para>
2311 #: best-pkging-practices.dbk:1496
2313 "Policy specifies that documentation should be shipped in HTML format. We "
2314 "also recommend shipping documentation in PDF and plain text format if "
2315 "convenient and if output of reasonable quality is possible. However, it is "
2316 "generally not appropriate to ship plain text versions of documentation whose "
2317 "source format is HTML."
2320 # type: Content of: <chapter><section><section><para>
2321 #. type: Content of: <chapter><section><section><para>
2322 #: best-pkging-practices.dbk:1503
2324 "Major shipped manuals should register themselves with <systemitem role="
2325 "\"package\">doc-base</systemitem> on installation. See the <systemitem role="
2326 "\"package\">doc-base</systemitem> package documentation for more information."
2329 #. type: Content of: <chapter><section><section><para>
2330 #: best-pkging-practices.dbk:1509
2332 "Debian policy (section 12.1) directs that manual pages should accompany "
2333 "every program, utility, and function, and suggests them for other objects "
2334 "like configuration files. If the work you are packaging does not have such "
2335 "manual pages, consider writing them for inclusion in your package, and "
2336 "submitting them upstream."
2339 #. type: Content of: <chapter><section><section><para>
2340 #: best-pkging-practices.dbk:1516
2342 "The manpages do not need to be written directly in the troff format. "
2343 "Popular source formats are Docbook, POD and reST, which can be converted "
2344 "using <command>xsltproc</command>, <command>pod2man</command> and "
2345 "<command>rst2man</command> respectively. To a lesser extent, the "
2346 "<command>help2man</command> program can also be used to write a stub."
2349 # type: Content of: <chapter><section><section><title>
2350 #. type: Content of: <chapter><section><section><title>
2351 #: best-pkging-practices.dbk:1525
2352 msgid "Specific types of packages"
2355 # type: Content of: <chapter><section><section><para>
2356 #. type: Content of: <chapter><section><section><para>
2357 #: best-pkging-practices.dbk:1527
2359 "Several specific types of packages have special sub-policies and "
2360 "corresponding packaging rules and practices:"
2363 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2364 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2365 #: best-pkging-practices.dbk:1533
2367 "Perl related packages have a <ulink url=\"&url-perl-policy;\">Perl policy</"
2368 "ulink>, some examples of packages following that policy are <systemitem role="
2369 "\"package\">libdbd-pg-perl</systemitem> (binary perl module) or <systemitem "
2370 "role=\"package\">libmldbm-perl</systemitem> (arch independent perl module)."
2373 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2374 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2375 #: best-pkging-practices.dbk:1542
2377 "Python related packages have their python policy; see &file-python-policy; "
2378 "in the <systemitem role=\"package\">python</systemitem> package."
2381 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2382 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2383 #: best-pkging-practices.dbk:1549
2385 "Emacs related packages have the <ulink url=\"&url-emacs-policy;\">emacs "
2389 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2390 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2391 #: best-pkging-practices.dbk:1556
2393 "Java related packages have their <ulink url=\"&url-java-policy;\">java "
2397 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2398 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2399 #: best-pkging-practices.dbk:1563
2401 "Ocaml related packages have their own policy, found in &file-ocaml-policy; "
2402 "from the <systemitem role=\"package\">ocaml</systemitem> package. A good "
2403 "example is the <systemitem role=\"package\">camlzip</systemitem> source "
2407 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2408 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2409 #: best-pkging-practices.dbk:1571
2411 "Packages providing XML or SGML DTDs should conform to the recommendations "
2412 "found in the <systemitem role=\"package\">sgml-base-doc</systemitem> package."
2415 # type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2416 #. type: Content of: <chapter><section><section><itemizedlist><listitem><para>
2417 #: best-pkging-practices.dbk:1577
2419 "Lisp packages should register themselves with <systemitem role=\"package"
2420 "\">common-lisp-controller</systemitem>, about which see &file-lisp-"
2424 # type: Content of: <chapter><section><section><title>
2425 #. type: Content of: <chapter><section><section><title>
2426 #: best-pkging-practices.dbk:1607
2427 msgid "Architecture-independent data"
2428 msgstr "アーキテクチャ非依存のデータ"
2430 # type: Content of: <chapter><section><section><para>
2431 #. type: Content of: <chapter><section><section><para>
2432 #: best-pkging-practices.dbk:1609
2434 "It is not uncommon to have a large amount of architecture-independent data "
2435 "packaged with a program. For example, audio files, a collection of icons, "
2436 "wallpaper patterns, or other graphic files. If the size of this data is "
2437 "negligible compared to the size of the rest of the package, it's probably "
2438 "best to keep it all in a single package."
2441 #. type: Content of: <chapter><section><section><para>
2442 #: best-pkging-practices.dbk:1616
2444 "However, if the size of the data is considerable, consider splitting it out "
2445 "into a separate, architecture-independent package (<filename>_all.deb</"
2446 "filename>). By doing this, you avoid needless duplication of the same data "
2447 "into eleven or more .debs, one per each architecture. While this adds some "
2448 "extra overhead into the <filename>Packages</filename> files, it saves a lot "
2449 "of disk space on Debian mirrors. Separating out architecture-independent "
2450 "data also reduces processing time of <command>lintian</command> (see <xref "
2451 "linkend=\"tools-lint\"/>) when run over the entire Debian archive."
2454 # type: Content of: <chapter><section><section><title>
2455 #. type: Content of: <chapter><section><section><title>
2456 #: best-pkging-practices.dbk:1628
2457 msgid "Needing a certain locale during build"
2460 # type: Content of: <chapter><section><section><para>
2461 #. type: Content of: <chapter><section><section><para>
2462 #: best-pkging-practices.dbk:1630
2464 "If you need a certain locale during build, you can create a temporary file "
2468 # type: Content of: <chapter><section><section><para>
2469 #. type: Content of: <chapter><section><section><para>
2470 #: best-pkging-practices.dbk:1634
2472 "If you set <varname>LOCPATH</varname> to the equivalent of <filename>/usr/"
2473 "lib/locale</filename>, and <varname>LC_ALL</varname> to the name of the "
2474 "locale you generate, you should get what you want without being root. "
2475 "Something like this:"
2478 # type: Content of: <chapter><section><section><screen>
2479 #. type: Content of: <chapter><section><section><screen>
2480 #: best-pkging-practices.dbk:1639
2483 "LOCALE_PATH=debian/tmpdir/usr/lib/locale\n"
2484 "LOCALE_NAME=en_IN\n"
2485 "LOCALE_CHARSET=UTF-8\n"
2487 "mkdir -p $LOCALE_PATH\n"
2488 "localedef -i $LOCALE_NAME.$LOCALE_CHARSET -f $LOCALE_CHARSET $LOCALE_PATH/$LOCALE_NAME.$LOCALE_CHARSET\n"
2490 "# Using the locale\n"
2491 "LOCPATH=$LOCALE_PATH LC_ALL=$LOCALE_NAME.$LOCALE_CHARSET date\n"
2493 "LOCALE_PATH=debian/tmpdir/usr/lib/locale\n"
2494 "LOCALE_NAME=en_IN\n"
2495 "LOCALE_CHARSET=UTF-8\n"
2497 "mkdir -p $LOCALE_PATH\n"
2498 "localedef -i $LOCALE_NAME.$LOCALE_CHARSET -f $LOCALE_CHARSET $LOCALE_PATH/$LOCALE_NAME.$LOCALE_CHARSET\n"
2501 "LOCPATH=$LOCALE_PATH LC_ALL=$LOCALE_NAME.$LOCALE_CHARSET date\n"
2503 # type: Content of: <chapter><section><section><title>
2504 #. type: Content of: <chapter><section><section><title>
2505 #: best-pkging-practices.dbk:1652
2506 msgid "Make transition packages deborphan compliant"
2509 # type: Content of: <chapter><section><section><para>
2510 #. type: Content of: <chapter><section><section><para>
2511 #: best-pkging-practices.dbk:1654
2513 "Deborphan is a program for helping users to detect which packages can safely "
2514 "be removed from the system, i.e. the ones that have no packages depending "
2515 "on them. The default operation is to search only within the libs and "
2516 "oldlibs sections, to hunt down unused libraries. But when passed the right "
2517 "argument, it tries to catch other useless packages."
2520 # type: Content of: <chapter><section><section><para>
2521 #. type: Content of: <chapter><section><section><para>
2522 #: best-pkging-practices.dbk:1661
2524 "For example, with <literal>--guess-dummy</literal>, <command>deborphan</"
2525 "command> tries to search all transitional packages which were needed for "
2526 "upgrade but which can now safely be removed. For that, it looks for the "
2527 "string dummy or transitional in their short description."
2530 # type: Content of: <chapter><section><section><para>
2531 #. type: Content of: <chapter><section><section><para>
2532 #: best-pkging-practices.dbk:1668
2534 "So, when you are creating such a package, please make sure to add this text "
2535 "to your short description. If you are looking for examples, just run: "
2536 "<command>apt-cache search .|grep dummy</command> or <command>apt-cache "
2537 "search .|grep transitional</command>."
2540 # type: Content of: <chapter><section><title>
2541 #. type: Content of: <chapter><section><section><title>
2542 #: best-pkging-practices.dbk:1676
2543 msgid "Best practices for <filename>.orig.tar.{gz,bz2,lzma}</filename> files"
2545 "<filename>.orig.tar.{gz,bz2,lzma}</filename> についてのベストプラクティス"
2547 # type: Content of: <chapter><section><section><para>
2548 #. type: Content of: <chapter><section><section><para>
2549 #: best-pkging-practices.dbk:1678
2551 "There are two kinds of original source tarballs: Pristine source and "
2552 "repackaged upstream source."
2555 # type: Content of: <chapter><section><section><section><title>
2556 #. type: Content of: <chapter><section><section><section><title>
2557 #: best-pkging-practices.dbk:1682
2558 msgid "Pristine source"
2561 #. type: Content of: <chapter><section><section><section><para><footnote><para>
2562 #: best-pkging-practices.dbk:1686
2564 "We cannot prevent upstream authors from changing the tarball they distribute "
2565 "without also incrementing the version number, so there can be no guarantee "
2566 "that a pristine tarball is identical to what upstream <emphasis>currently</"
2567 "emphasis> distributing at any point in time. All that can be expected is "
2568 "that it is identical to something that upstream once <emphasis>did</"
2569 "emphasis> distribute. If a difference arises later (say, if upstream "
2570 "notices that he wasn't using maximal compression in his original "
2571 "distribution and then re-<command>gzip</command>s it), that's just too bad. "
2572 "Since there is no good way to upload a new <filename>.orig.tar.{gz,bz2,lzma}"
2573 "</filename> for the same version, there is not even any point in treating "
2574 "this situation as a bug."
2577 #. type: Content of: <chapter><section><section><section><para>
2578 #: best-pkging-practices.dbk:1684
2580 "The defining characteristic of a pristine source tarball is that the "
2581 "<filename>.orig.tar.{gz,bz2,lzma}</filename> file is byte-for-byte identical "
2582 "to a tarball officially distributed by the upstream author.<placeholder type="
2583 "\"footnote\" id=\"0\"/> This makes it possible to use checksums to easily "
2584 "verify that all changes between Debian's version and upstream's are "
2585 "contained in the Debian diff. Also, if the original source is huge, "
2586 "upstream authors and others who already have the upstream tarball can save "
2587 "download time if they want to inspect your packaging in detail."
2590 # type: Content of: <chapter><section><section><section><para>
2591 #. type: Content of: <chapter><section><section><section><para>
2592 #: best-pkging-practices.dbk:1704
2594 "There is no universally accepted guidelines that upstream authors follow "
2595 "regarding to the directory structure inside their tarball, but <command>dpkg-"
2596 "source</command> is nevertheless able to deal with most upstream tarballs as "
2597 "pristine source. Its strategy is equivalent to the following:"
2600 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2601 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2602 #: best-pkging-practices.dbk:1712
2603 msgid "It unpacks the tarball in an empty temporary directory by doing"
2606 # type: Content of: <chapter><section><section><section><orderedlist><listitem><screen>
2607 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><screen>
2608 #: best-pkging-practices.dbk:1715
2610 msgid "zcat path/to/<replaceable>packagename</replaceable>_<replaceable>upstream-version</replaceable>.orig.tar.gz | tar xf -\n"
2611 msgstr "zcat path/to/<replaceable>パッケージ名</replaceable>_<replaceable>upstream-version</replaceable>.orig.tar.gz | tar xf -\n"
2613 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2614 #: best-pkging-practices.dbk:1720
2616 "If, after this, the temporary directory contains nothing but one directory "
2617 "and no other files, <command>dpkg-source</command> renames that directory to "
2618 "<filename><replaceable>packagename</replaceable>-<replaceable>upstream-"
2619 "version</replaceable>(.orig)</filename>. The name of the top-level "
2620 "directory in the tarball does not matter, and is forgotten."
2623 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2624 #: best-pkging-practices.dbk:1729
2626 "Otherwise, the upstream tarball must have been packaged without a common top-"
2627 "level directory (shame on the upstream author!). In this case, "
2628 "<command>dpkg-source</command> renames the temporary directory "
2629 "<emphasis>itself</emphasis> to <filename><replaceable>packagename</"
2630 "replaceable>-<replaceable>upstream-version</replaceable>(.orig)</filename>."
2633 # type: Content of: <chapter><section><section><section><title>
2634 #. type: Content of: <chapter><section><section><section><title>
2635 #: best-pkging-practices.dbk:1740
2636 msgid "Repackaged upstream source"
2637 msgstr "upstream のソースをパッケージしなおす"
2639 # type: Content of: <chapter><section><section><section><para>
2640 #. type: Content of: <chapter><section><section><section><para>
2641 #: best-pkging-practices.dbk:1742
2643 "You <emphasis role=\"strong\">should</emphasis> upload packages with a "
2644 "pristine source tarball if possible, but there are various reasons why it "
2645 "might not be possible. This is the case if upstream does not distribute the "
2646 "source as gzipped tar at all, or if upstream's tarball contains non-DFSG-"
2647 "free material that you must remove before uploading."
2650 #. type: Content of: <chapter><section><section><section><para>
2651 #: best-pkging-practices.dbk:1749
2653 "In these cases the developer must construct a suitable <filename>.orig.tar."
2654 "{gz,bz2,lzma}</filename> file himself. We refer to such a tarball as a "
2655 "repackaged upstream source. Note that a repackaged upstream source is "
2656 "different from a Debian-native package. A repackaged source still comes "
2657 "with Debian-specific changes in a separate <filename>.diff.gz</filename> or "
2658 "<filename>.debian.tar.{gz,bz2,lzma}</filename> and still has a version "
2659 "number composed of <replaceable>upstream-version</replaceable> and "
2660 "<replaceable>debian-version</replaceable>."
2663 #. type: Content of: <chapter><section><section><section><para>
2664 #: best-pkging-practices.dbk:1758
2666 "There may be cases where it is desirable to repackage the source even though "
2667 "upstream distributes a <filename>.tar.{gz,bz2,lzma}</filename> that could in "
2668 "principle be used in its pristine form. The most obvious is if "
2669 "<emphasis>significant</emphasis> space savings can be achieved by "
2670 "recompressing the tar archive or by removing genuinely useless cruft from "
2671 "the upstream archive. Use your own discretion here, but be prepared to "
2672 "defend your decision if you repackage source that could have been pristine."
2675 #. type: Content of: <chapter><section><section><section><para>
2676 #: best-pkging-practices.dbk:1767
2677 msgid "A repackaged <filename>.orig.tar.{gz,bz2,lzma}</filename>"
2680 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2681 #: best-pkging-practices.dbk:1772
2683 "<emphasis role=\"strong\">should</emphasis> be documented in the resulting "
2684 "source package. Detailed information on how the repackaged source was "
2685 "obtained, and on how this can be reproduced should be provided in "
2686 "<filename>debian/copyright</filename>. It is also a good idea to provide a "
2687 "<literal>get-orig-source</literal> target in your <filename>debian/rules</"
2688 "filename> file that repeats the process, as described in the Policy Manual, "
2689 "<ulink url=\"&url-debian-policy;ch-source.html#s-debianrules\">Main building "
2690 "script: <filename>debian/rules</filename></ulink>."
2693 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para><footnote><para>
2694 #: best-pkging-practices.dbk:1787
2696 "As a special exception, if the omission of non-free files would lead to the "
2697 "source failing to build without assistance from the Debian diff, it might be "
2698 "appropriate to instead edit the files, omitting only the non-free parts of "
2699 "them, and/or explain the situation in a <filename>README.source</filename> "
2700 "file in the root of the source tree. But in that case please also urge the "
2701 "upstream author to make the non-free components easier separable from the "
2702 "rest of the source."
2705 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2706 #: best-pkging-practices.dbk:1785
2708 "<emphasis role=\"strong\">should not</emphasis> contain any file that does "
2709 "not come from the upstream author(s), or whose contents has been changed by "
2710 "you.<placeholder type=\"footnote\" id=\"0\"/>"
2713 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2714 #: best-pkging-practices.dbk:1798
2716 "<emphasis role=\"strong\">should</emphasis>, except where impossible for "
2717 "legal reasons, preserve the entire building and portablility infrastructure "
2718 "provided by the upstream author. For example, it is not a sufficient reason "
2719 "for omitting a file that it is used only when building on MS-DOS. "
2720 "Similarly, a <filename>Makefile</filename> provided by upstream should not "
2721 "be omitted even if the first thing your <filename>debian/rules</filename> "
2722 "does is to overwrite it by running a configure script."
2725 # type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2726 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2727 #: best-pkging-practices.dbk:1807
2729 "(<emphasis>Rationale:</emphasis> It is common for Debian users who need to "
2730 "build software for non-Debian platforms to fetch the source from a Debian "
2731 "mirror rather than trying to locate a canonical upstream distribution point)."
2734 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2735 #: best-pkging-practices.dbk:1814
2737 "<emphasis role=\"strong\">should</emphasis> use "
2738 "<filename><replaceable>packagename</replaceable>-<replaceable>upstream-"
2739 "version</replaceable>.orig</filename> as the name of the top-level directory "
2740 "in its tarball. This makes it possible to distinguish pristine tarballs "
2741 "from repackaged ones."
2744 #. type: Content of: <chapter><section><section><section><orderedlist><listitem><para>
2745 #: best-pkging-practices.dbk:1822
2747 "<emphasis role=\"strong\">should</emphasis> be gzipped or bzipped with "
2748 "maximal compression."
2751 #. type: Content of: <chapter><section><section><section><title>
2752 #: best-pkging-practices.dbk:1829
2753 msgid "Changing binary files"
2756 #. type: Content of: <chapter><section><section><section><para>
2757 #: best-pkging-practices.dbk:1831
2759 "Sometimes it is necessary to change binary files contained in the original "
2760 "tarball, or to add binary files that are not in it. This is fully supported "
2761 "when using source packages in “3.0 (quilt)” format, see the "
2762 "<citerefentry><refentrytitle>dpkg-source</refentrytitle><manvolnum>1</"
2763 "manvolnum></citerefentry> manual page for details. When using the older "
2764 "format “1.0”, binary files can't be stored in the <filename>.diff.gz</"
2765 "filename> so you must store an <command>uuencode</command>d (or similar) "
2766 "version of the file(s) and decode it at build time in <filename>debian/"
2767 "rules</filename> (and move it in its official location)."
2770 # type: Content of: <chapter><section><section><title>
2771 #. type: Content of: <chapter><section><section><title>
2772 #: best-pkging-practices.dbk:1846
2773 msgid "Best practices for debug packages"
2776 #. type: Content of: <chapter><section><section><para>
2777 #: best-pkging-practices.dbk:1848
2779 "A debug package is a package with a name ending in -dbg, that contains "
2780 "additional information that <command>gdb</command> can use. Since Debian "
2781 "binaries are stripped by default, debugging information, including function "
2782 "names and line numbers, is otherwise not available when running "
2783 "<command>gdb</command> on Debian binaries. Debug packages allow users who "
2784 "need this additional debugging information to install it, without bloating a "
2785 "regular system with the information."
2788 # type: Content of: <chapter><section><section><para>
2789 #. type: Content of: <chapter><section><section><para>
2790 #: best-pkging-practices.dbk:1856
2792 "It is up to a package's maintainer whether to create a debug package or "
2793 "not. Maintainers are encouraged to create debug packages for library "
2794 "packages, since this can aid in debugging many programs linked to a "
2795 "library. In general, debug packages do not need to be added for all "
2796 "programs; doing so would bloat the archive. But if a maintainer finds that "
2797 "users often need a debugging version of a program, it can be worthwhile to "
2798 "make a debug package for it. Programs that are core infrastructure, such as "
2799 "apache and the X server are also good candidates for debug packages."
2802 #. type: Content of: <chapter><section><section><para>
2803 #: best-pkging-practices.dbk:1866
2805 "Some debug packages may contain an entire special debugging build of a "
2806 "library or other binary, but most of them can save space and build time by "
2807 "instead containing separated debugging symbols that <command>gdb</command> "
2808 "can find and load on the fly when debugging a program or library. The "
2809 "convention in Debian is to keep these symbols in <filename>/usr/lib/debug/"
2810 "<replaceable>path</replaceable></filename>, where <replaceable>path</"
2811 "replaceable> is the path to the executable or library. For example, "
2812 "debugging symbols for <filename>/usr/bin/foo</filename> go in <filename>/usr/"
2813 "lib/debug/usr/bin/foo</filename>, and debugging symbols for <filename>/usr/"
2814 "lib/libfoo.so.1</filename> go in <filename>/usr/lib/debug/usr/lib/libfoo."
2818 #. type: Content of: <chapter><section><section><para>
2819 #: best-pkging-practices.dbk:1878
2821 "The debugging symbols can be extracted from an object file using "
2822 "<command>objcopy --only-keep-debug</command>. Then the object file can be "
2823 "stripped, and <command>objcopy --add-gnu-debuglink</command> used to specify "
2824 "the path to the debugging symbol file. <citerefentry> "
2825 "<refentrytitle>objcopy</refentrytitle> <manvolnum>1</manvolnum> </"
2826 "citerefentry> explains in detail how this works."
2829 #. type: Content of: <chapter><section><section><para>
2830 #: best-pkging-practices.dbk:1886
2832 "The <command>dh_strip</command> command in <systemitem role=\"package"
2833 "\">debhelper</systemitem> supports creating debug packages, and can take "
2834 "care of using <command>objcopy</command> to separate out the debugging "
2835 "symbols for you. If your package uses <systemitem role=\"package"
2836 "\">debhelper</systemitem>, all you need to do is call <command>dh_strip --"
2837 "dbg-package=libfoo-dbg</command>, and add an entry to <filename>debian/"
2838 "control</filename> for the debug package."
2841 #. type: Content of: <chapter><section><section><para>
2842 #: best-pkging-practices.dbk:1893
2844 "Note that the debug package should depend on the package that it provides "
2845 "debugging symbols for, and this dependency should be versioned. For example:"
2848 # type: Content of: <chapter><section><section><screen>
2849 #. type: Content of: <chapter><section><section><screen>
2850 #: best-pkging-practices.dbk:1897
2852 msgid "Depends: libfoo (= ${binary:Version})\n"
2853 msgstr "Depends: libfoo (= ${binary:Version})\n"