chiark / gitweb /
also update list of authors
[developers-reference.git] / pkgs.dbk
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3     "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4   <!ENTITY % commondata SYSTEM "common.ent" > %commondata;
5 ]>
6 <chapter id="pkgs">
7 <title>Managing Packages</title>
8 <para>
9 This chapter contains information related to creating, uploading, maintaining,
10 and porting packages.
11 </para>
12 <section id="newpackage">
13 <title>New packages</title>
14 <para>
15 If you want to create a new package for the Debian distribution, you should
16 first check the <ulink url="&url-wnpp;">Work-Needing and
17 Prospective Packages (WNPP)</ulink> list.  Checking the WNPP list ensures that
18 no one is already working on packaging that software, and that effort is not
19 duplicated.  Read the <ulink url="&url-wnpp;">WNPP web
20 pages</ulink> for more information.
21 </para>
22 <para>
23 Assuming no one else is already working on your prospective package, you must
24 then submit a bug report (<xref linkend="submit-bug"/> ) against the
25 pseudo-package <systemitem role="package">wnpp</systemitem> describing your
26 plan to create a new package, including, but not limiting yourself to, a
27 description of the package, the license of the prospective package, and the
28 current URL where it can be downloaded from.
29 </para>
30 <para>
31 You should set the subject of the bug to <literal>ITP: 
32 <replaceable>foo</replaceable> -- <replaceable>short
33 description</replaceable></literal>, substituting the name of the new
34 package for <replaceable>foo</replaceable>. 
35 The severity of the bug report must be set to <literal>wishlist</literal>.
36 Please send a copy to &email-debian-devel; by using the X-Debbugs-CC
37 header (don't use CC:, because that way the message's subject won't
38 indicate the bug number). If you are packaging so many new packages (>10)
39 that notifying the mailing list in seperate messages is too disruptive,
40 do send a summary after filing the bugs to the debian-devel list instead.
41 This will inform the other developers about upcoming packages and will
42 allow a review of your description and package name.
43 </para>
44 <para>
45 Please include a <literal>Closes:
46 bug#<replaceable>nnnnn</replaceable></literal> entry in the changelog of the
47 new package in order for the bug report to be automatically closed once the new
48 package is installed in the archive (see <xref linkend="upload-bugfix"/> ).
49 </para>
50 <para>
51 If you think your package needs some explanations for the administrators of the
52 NEW package queue, include them in your changelog, send to ftpmaster@debian.org
53 a reply to the email you receive as a maintainer after your upload, or reply to
54 the rejection email in case you are already re-uploading.
55 </para>
56 <para>
57 When closing security bugs include CVE numbers as well as the Closes: #nnnnn.
58 This is useful for the security team to track vulnerabilities.  If an upload is
59 made to fix the bug before the advisory ID is known, it is encouraged to modify
60 the historical changelog entry with the next upload.  Even in this case, please
61 include all available pointers to background information in the original
62 changelog entry.
63 </para>
64 <para>
65 There are a number of reasons why we ask maintainers to announce their
66 intentions:
67 </para>
68 <itemizedlist>
69 <listitem>
70 <para>
71 It helps the (potentially new) maintainer to tap into the experience of people
72 on the list, and lets them know if anyone else is working on it already.
73 </para>
74 </listitem>
75 <listitem>
76 <para>
77 It lets other people thinking about working on the package know that there
78 already is a volunteer, so efforts may be shared.
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 It lets the rest of the maintainers know more about the package than the one
84 line description and the usual changelog entry ``Initial release'' that gets
85 posted to &email-debian-devel-changes;.
86 </para>
87 </listitem>
88 <listitem>
89 <para>
90 It is helpful to the people who live off <literal>unstable</literal> (and form
91 our first line of testers).  We should encourage these people.
92 </para>
93 </listitem>
94 <listitem>
95 <para>
96 The announcements give maintainers and other interested parties a better feel
97 of what is going on, and what is new, in the project.
98 </para>
99 </listitem>
100 </itemizedlist>
101 <para>
102 Please see <ulink url="http://&ftp-master-host;/REJECT-FAQ.html"></ulink>
103 for common rejection reasons for a new package.
104 </para>
105 </section>
106
107 <section id="changelog-entries">
108 <title>Recording changes in the package</title>
109 <para>
110 Changes that you make to the package need to be recorded in the
111 <filename>debian/changelog</filename>.  These changes should provide a concise
112 description of what was changed, why (if it's in doubt), and note if any bugs
113 were closed.  They also record when the package was completed.  This file will
114 be installed in
115 <filename>/usr/share/doc/<replaceable>package</replaceable>/changelog.Debian.gz</filename>,
116 or
117 <filename>/usr/share/doc/<replaceable>package</replaceable>/changelog.gz</filename>
118 for native packages.
119 </para>
120 <para>
121 The <filename>debian/changelog</filename> file conforms to a certain structure,
122 with a number of different fields.  One field of note, the
123 <literal>distribution</literal>, is described in <xref
124 linkend="distribution"/> .  More information about the structure of this file
125 can be found in the Debian Policy section titled
126 <filename>debian/changelog</filename>.
127 </para>
128 <para>
129 Changelog entries can be used to automatically close Debian bugs when the
130 package is installed into the archive.  See <xref linkend="upload-bugfix"/> .
131 </para>
132 <para>
133 It is conventional that the changelog entry of a package that contains a new
134 upstream version of the software looks like this:
135 </para>
136 <screen>
137   * new upstream version
138 </screen>
139 <para>
140 There are tools to help you create entries and finalize the
141 <filename>changelog</filename> for release — see <xref linkend="devscripts"/>
142 and <xref linkend="dpkg-dev-el"/> .
143 </para>
144 <para>
145 See also <xref linkend="bpp-debian-changelog"/> .
146 </para>
147 </section>
148
149 <section id="sanitycheck">
150 <title>Testing the package</title>
151 <para>
152 Before you upload your package, you should do basic testing on it.  At a
153 minimum, you should try the following activities (you'll need to have an older
154 version of the same Debian package around):
155 </para>
156 <itemizedlist>
157 <listitem>
158 <para>
159 Install the package and make sure the software works, or upgrade the package
160 from an older version to your new version if a Debian package for it already
161 exists.
162 </para>
163 </listitem>
164 <listitem>
165 <para>
166 Run <command>lintian</command> over the package.  You can run
167 <command>lintian</command> as follows: <literal>lintian -v
168 <replaceable>package-version</replaceable>.changes</literal>.  This will check
169 the source package as well as the binary package.  If you don't understand the
170 output that <command>lintian</command> generates, try adding the
171 <literal>-i</literal> switch, which will cause <command>lintian</command> to
172 output a very verbose description of the problem.
173 </para>
174 <para>
175 Normally, a package should <emphasis>not</emphasis> be uploaded if it causes
176 lintian to emit errors (they will start with <literal>E</literal>).
177 </para>
178 <para>
179 For more information on <command>lintian</command>, see <xref
180 linkend="lintian"/> .
181 </para>
182 </listitem>
183 <listitem>
184 <para>
185 Optionally run <xref linkend="debdiff"/> to analyze changes from an older
186 version, if one exists.
187 </para>
188 </listitem>
189 <listitem>
190 <para>
191 Downgrade the package to the previous version (if one exists) — this tests
192 the <filename>postrm</filename> and <filename>prerm</filename> scripts.
193 </para>
194 </listitem>
195 <listitem>
196 <para>
197 Remove the package, then reinstall it.
198 </para>
199 </listitem>
200 <listitem>
201 <para>
202 Copy the source package in a different directory and try unpacking it and
203 rebuilding it.  This tests if the package relies on existing files outside of
204 it, or if it relies on permissions being preserved on the files shipped inside
205 the .diff.gz file.
206 </para>
207 </listitem>
208 </itemizedlist>
209 </section>
210
211 <section id="sourcelayout">
212 <title>Layout of the source package</title>
213 <para>
214 There are two types of Debian source packages:
215 </para>
216 <itemizedlist>
217 <listitem>
218 <para>
219 the so-called <literal>native</literal> packages, where there is no
220 distinction between the original sources and the patches applied for Debian
221 </para>
222 </listitem>
223 <listitem>
224 <para>
225 the (more common) packages where there's an original source tarball file
226 accompanied by another file that contains the patches applied for Debian
227 </para>
228 </listitem>
229 </itemizedlist>
230 <para>
231 For the native packages, the source package includes a Debian source control
232 file (<literal>.dsc</literal>) and the source tarball
233 (<literal>.tar.gz</literal>).  A source package of a non-native package
234 includes a Debian source control file, the original source tarball
235 (<literal>.orig.tar.gz</literal>) and the Debian patches
236 (<literal>.diff.gz</literal>).
237 </para>
238 <para>
239 Whether a package is native or not is determined when it is built by
240 <citerefentry> <refentrytitle>dpkg-buildpackage</refentrytitle>
241 <manvolnum>1</manvolnum> </citerefentry>.  The rest of this section relates
242 only to non-native packages.
243 </para>
244 <para>
245 The first time a version is uploaded which corresponds to a particular upstream
246 version, the original source tar file should be uploaded and included in the
247 <filename>.changes</filename> file.  Subsequently, this very same tar file
248 should be used to build the new diffs and <filename>.dsc</filename> files, and
249 will not need to be re-uploaded.
250 </para>
251 <para>
252 By default, <command>dpkg-genchanges</command> and
253 <command>dpkg-buildpackage</command> will include the original source tar file
254 if and only if the Debian revision part of the source version number is 0 or 1,
255 indicating a new upstream version.  This behavior may be modified by using
256 <literal>-sa</literal> to always include it or <literal>-sd</literal> to always
257 leave it out.
258 </para>
259 <para>
260 If no original source is included in the upload, the original source tar-file
261 used by <command>dpkg-source</command> when constructing the
262 <filename>.dsc</filename> file and diff to be uploaded
263 <emphasis>must</emphasis> be byte-for-byte identical with the one already in
264 the archive.
265 </para>
266 <para>
267 Please notice that, in non-native packages, permissions on files that are not
268 present in the .orig.tar.gz will not be preserved, as diff does not store file
269 permissions in the patch.
270 </para>
271 </section>
272
273 <section id="distribution">
274 <title>Picking a distribution</title>
275 <para>
276 Each upload needs to specify which distribution the package is intended for.
277 The package build process extracts this information from the first line of the
278 <filename>debian/changelog</filename> file and places it in the
279 <literal>Distribution</literal> field of the <literal>.changes</literal> file.
280 </para>
281 <para>
282 There are several possible values for this field: <literal>stable</literal>,
283 <literal>unstable</literal>, <literal>testing-proposed-updates</literal> and
284 <literal>experimental</literal>.  Normally, packages are uploaded into
285 <literal>unstable</literal>.
286 </para>
287 <para>
288 Actually, there are two other possible distributions: <literal>stable-security
289 </literal> and <literal>testing-security</literal>, but read 
290 <xref linkend="bug-security"/> for more information on those.
291 </para>
292 <para>
293 It is not possible to upload a package into several distributions at the same
294 time.
295 </para>
296 <section id="upload-stable">
297 <title>Special case: uploads to the <literal>stable</literal> and 
298 <literal>oldstable</literal> distributions</title>
299 <para>
300 Uploading to <literal>stable</literal> means that the package will transfered
301 to the <literal>proposed-updates-new</literal> queue for review by the stable
302 release managers, and if approved will be installed in
303 <filename>stable-proposed-updates</filename> directory of the Debian archive.
304 From there, it will be included in <literal>stable</literal> with the next
305 point release.
306 </para>
307 <para>
308 To ensure that your upload will be accepted, you should discuss the changes
309 with the stable release team before you upload. For that, send a mail to
310 the &email-debian-release; mailing list, including the patch you want to
311 apply to the package version currently in <literal>stable</literal>. Always
312 be verbose and detailed in your changelog entries for uploads to the
313 <literal>stable</literal> distribution.
314 </para>
315 <para>
316 Extra care should be taken when uploading to <literal>stable</literal>.
317 Basically, a package should only be uploaded to <literal>stable</literal> if
318 one of the following happens:
319 </para>
320 <itemizedlist>
321 <listitem>
322 <para>
323 a truly critical functionality problem
324 </para>
325 </listitem>
326 <listitem>
327 <para>
328 the package becomes uninstallable
329 </para>
330 </listitem>
331 <listitem>
332 <para>
333 a released architecture lacks the package
334 </para>
335 </listitem>
336 </itemizedlist>
337 <para>
338 In the past, uploads to <literal>stable</literal> were used to address
339 security problems as well.  However, this practice is deprecated, as uploads
340 used for Debian security advisories are automatically copied to the appropriate
341 <filename>proposed-updates</filename> archive when the advisory is released.
342 See <xref linkend="bug-security"/> for detailed information on handling
343 security problems. If the security teams deems the problem to be too
344 benign to be fixed through a <literal>DSA</literal>, the stable release
345 managers are usually willing to include your fix nonetheless in a regular
346 upload to <literal>stable</literal>.
347 </para>
348 <para>
349 Changing anything else in the package that isn't important is discouraged,
350 because even trivial fixes can cause bugs later on.
351 </para>
352 <para>
353 Packages uploaded to <literal>stable</literal> need to be compiled on systems
354 running <literal>stable</literal>, so that their dependencies are limited to
355 the libraries (and other packages) available in <literal>stable</literal>;
356 for example, a package uploaded to <literal>stable</literal> that depends on
357 a library package that only exists in <literal>unstable</literal> will be 
358 rejected.  Making changes to dependencies of other packages (by messing with
359 <literal>Provides</literal> or <literal>shlibs</literal> files), possibly 
360 making those other packages uninstallable, is strongly discouraged.
361 </para>
362 <para>
363 Uploads to the <literal>oldstable</literal> distributions are possible as
364 long as it hasn't been archived. The same rules as for <literal>stable
365 </literal> apply.
366 </para>
367 </section>
368
369 <section id="upload-t-p-u">
370 <title>Special case: uploads to <literal>testing/testing-proposed-updates</literal></title>
371 <para>
372 Please see the information in the <link linkend="t-p-u">testing
373 section</link> for details.
374 </para>
375 </section>
376
377 </section>
378
379 <section id="upload">
380 <title>Uploading a package</title>
381 <section id="upload-ftp-master">
382 <title>Uploading to <literal>ftp-master</literal></title>
383 <para>
384 To upload a package, you should upload the files (including the signed changes
385 and dsc-file) with anonymous ftp to <literal>&ftp-master-host;</literal> in
386 the directory <ulink
387 url="ftp://&ftp-master-host;&upload-queue;">&upload-queue;</ulink>.
388 To get the files processed there, they need to be signed with a key in the
389 Debian Developers keyring or the Debian Maintainers keyring
390 (see <ulink url="&url-wiki-dm;"></ulink>).
391 </para>
392 <para>
393 Please note that you should transfer the changes file last.  Otherwise, your
394 upload may be rejected because the archive maintenance software will parse the
395 changes file and see that not all files have been uploaded.
396 </para>
397 <para>
398 You may also find the Debian packages <xref linkend="dupload"/> or <xref
399 linkend="dput"/> useful when uploading packages.  These handy programs help
400 automate the process of uploading packages into Debian.
401 </para>
402 <para>
403 For removing packages, please see the README file in that ftp directory, and
404 the Debian package <xref linkend="dcut"/> .
405 </para>
406 </section>
407
408 <section id="delayed-incoming">
409 <title>Delayed uploads</title>
410
411 <para>
412 It is sometimes useful to upload a package immediately, but to want this
413 package to arrive in the archive only a few days later. For example,
414 when preparing a <link linkend="nmu">Non-maintainer Upload</link>,
415 you might want to give the maintainer a few days to react.
416 </para>
417
418 <para>
419 An upload to the delayed directory keeps the package in
420 <ulink url="http://ftp-master.debian.org/deferred.html">
421 the deferred uploads queue"</ulink>.
422 When the specified waiting time is over, the package is moved into
423 the regular incoming directory for processing.
424 This is done through automatic uploading to
425 <literal>&ftp-master-host;</literal> in upload-directory
426 <literal>DELAYED/[012345678]-day</literal>. 0-day is uploaded
427 multiple times per day to <literal>&ftp-master-host;</literal>.
428 </para>
429 <para>
430 With dput, you can use the <literal>--delayed <replaceable>DELAY</replaceable></literal>
431 parameter to put the package into one of the queues.
432 </para>
433 </section>
434
435 <section id="s5.6.4">
436 <title>Security uploads</title>
437 <para>
438 Do <emphasis role="strong">NOT</emphasis> upload a package to the security
439 upload queue (<literal>oldstable-security</literal>, <literal>stable-security
440 </literal>, etc.) without prior authorization from the security team.  If the
441 package does not exactly meet the team's requirements, it will cause many
442 problems and delays in dealing with the unwanted upload.  For details, please
443 see section <xref linkend="bug-security"/> .
444 </para>
445 </section>
446
447 <section id="s5.6.5">
448 <title>Other upload queues</title>
449 <para>
450 The scp queues on <literal>&ftp-master-host;</literal>, and <literal>
451 security.debian.org</literal> are mostly unusable due to the login restrictions
452 on those hosts.
453 </para>
454 <para>
455 The anonymous queues on ftp.uni-erlangen.de and ftp.uk.debian.org are currently
456 down.  Work is underway to resurrect them.
457 </para>
458 <para>
459 The queues on master.debian.org, samosa.debian.org, master.debian.or.jp, and
460 ftp.chiark.greenend.org.uk are down permanently, and will not be resurrected.
461 The queue in Japan will be replaced with a new queue on hp.debian.or.jp some
462 day.
463 </para>
464 </section>
465
466 <section id="upload-notification">
467 <title>Notification that a new package has been installed</title>
468 <para>
469 The Debian archive maintainers are responsible for handling package uploads.
470 For the most part, uploads are automatically handled on a daily basis by the
471 archive maintenance tools, <command>katie</command>.  Specifically, updates to
472 existing packages to the <literal>unstable</literal> distribution are handled
473 automatically.  In other cases, notably new packages, placing the uploaded 
474 package into the distribution is handled manually.  When uploads are handled
475 manually, the change to the archive may take up to a month to occur.  Please
476 be patient.
477 </para>
478 <para>
479 In any case, you will receive an email notification indicating that the package
480 has been added to the archive, which also indicates which bugs will be closed
481 by the upload.  Please examine this notification carefully, checking if any
482 bugs you meant to close didn't get triggered.
483 </para>
484 <para>
485 The installation notification also includes information on what section the
486 package was inserted into.  If there is a disparity, you will receive a
487 separate email notifying you of that.  Read on below.
488 </para>
489 <para>
490 Note that if you upload via queues, the queue daemon software will also send
491 you a notification by email.
492 </para>
493 </section>
494
495 </section>
496
497 <section id="override-file">
498 <title>Specifying the package section, subsection and priority</title>
499 <para>
500 The <filename>debian/control</filename> file's <literal>Section</literal> and
501 <literal>Priority</literal> fields do not actually specify where the file will
502 be placed in the archive, nor its priority.  In order to retain the overall
503 integrity of the archive, it is the archive maintainers who have control over
504 these fields.  The values in the <filename>debian/control</filename> file are
505 actually just hints.
506 </para>
507 <para>
508 The archive maintainers keep track of the canonical sections and priorities for
509 packages in the <literal>override file</literal>.  If there is a disparity
510 between the <literal>override file</literal> and the package's fields as
511 indicated in <filename>debian/control</filename>, then you will receive an
512 email noting the divergence when the package is installed into the archive.
513 You can either correct your <filename>debian/control</filename> file for your
514 next upload, or else you may wish to make a change in the <literal>override
515 file</literal>.
516 </para>
517 <para>
518 To alter the actual section that a package is put in, you need to first make
519 sure that the <filename>debian/control</filename> file in your package is
520 accurate.  Next, send an email &email-override; or submit a
521 bug against <systemitem role="package">ftp.debian.org</systemitem> requesting
522 that the section or priority for your package be changed from the old section
523 or priority to the new one.  Be sure to explain your reasoning.
524 </para>
525 <para>
526 For more information about <literal>override files</literal>, see
527 <citerefentry> <refentrytitle>dpkg-scanpackages</refentrytitle>
528 <manvolnum>1</manvolnum> </citerefentry> and <ulink
529 url="&url-bts-devel;#maintincorrect"></ulink>.
530 </para>
531 <para>
532 Note that the <literal>Section</literal> field describes both the section as
533 well as the subsection, which are described in <xref
534 linkend="archive-sections"/> .  If the section is main, it should be omitted.
535 The list of allowable subsections can be found in <ulink
536 url="&url-debian-policy;ch-archive.html#s-subsections"></ulink>.
537 </para>
538 </section>
539
540 <section id="bug-handling">
541 <title>Handling bugs</title>
542 <para>
543 Every developer has to be able to work with the Debian <ulink
544 url="&url-bts;">bug tracking system</ulink>.  This includes
545 knowing how to file bug reports properly (see <xref linkend="submit-bug"/> ),
546 how to update them and reorder them, and how to process and close them.
547 </para>
548 <para>
549 The bug tracking system's features are described in the <ulink
550 url="&url-bts-devel;">BTS documentation for
551 developers</ulink>.  This includes closing bugs, sending followup messages,
552 assigning severities and tags, marking bugs as forwarded, and other issues.
553 </para>
554 <para>
555 Operations such as reassigning bugs to other packages, merging separate bug
556 reports about the same issue, or reopening bugs when they are prematurely
557 closed, are handled using the so-called control mail server.  All of the
558 commands available on this server are described in the <ulink
559 url="&url-bts-control;">BTS control server
560 documentation</ulink>.
561 </para>
562 <section id="bug-monitoring">
563 <title>Monitoring bugs</title>
564 <para>
565 If you want to be a good maintainer, you should periodically check the <ulink
566 url="&url-bts;">Debian bug tracking system (BTS)</ulink> for
567 your packages.  The BTS contains all the open bugs against your packages.  You
568 can check them by browsing this page:
569 <literal>http://&bugs-host;/<replaceable>yourlogin</replaceable>@debian.org</literal>.
570 </para>
571 <para>
572 Maintainers interact with the BTS via email addresses at
573 <literal>&bugs-host;</literal>.  Documentation on available
574 commands can be found at <ulink url="&url-bts;"></ulink>, or,
575 if you have installed the <systemitem role="package">doc-debian</systemitem>
576 package, you can look at the local files &file-bts-docs;.
577 </para>
578 <para>
579 Some find it useful to get periodic reports on open bugs.  You can add a cron
580 job such as the following if you want to get a weekly email outlining all the
581 open bugs against your packages:
582 </para>
583 <screen>
584 # ask for weekly reports of bugs in my packages
585 &cron-bug-report;
586 </screen>
587 <para>
588 Replace <replaceable>address</replaceable> with your official Debian maintainer
589 address.
590 </para>
591 </section>
592
593 <section id="bug-answering">
594 <title>Responding to bugs</title>
595 <para>
596 When responding to bugs, make sure that any discussion you have about bugs is
597 sent both to the original submitter of the bug, and to the bug itself (e.g.,
598 <email>123@&bugs-host;</email>).  If you're writing a new mail and you
599 don't remember the submitter email address, you can use the
600 <email>123-submitter@&bugs-host;</email> email to contact the submitter
601 <emphasis>and</emphasis> to record your mail within the bug log (that means you
602 don't need to send a copy of the mail to <email>123@&bugs-host;</email>).
603 </para>
604 <para>
605 If you get a bug which mentions FTBFS, this means Fails to build from source.
606 Porters frequently use this acronym.
607 </para>
608 <para>
609 Once you've dealt with a bug report (e.g.  fixed it), mark it as
610 <literal>done</literal> (close it) by sending an explanation message to
611 <email>123-done@&bugs-host;</email>.  If you're fixing a bug by changing
612 and uploading the package, you can automate bug closing as described in <xref
613 linkend="upload-bugfix"/> .
614 </para>
615 <para>
616 You should <emphasis>never</emphasis> close bugs via the bug server
617 <literal>close</literal> command sent to &email-bts-control;.
618 If you do so, the original submitter will not receive any information about why
619 the bug was closed.
620 </para>
621 </section>
622
623 <section id="bug-housekeeping">
624 <title>Bug housekeeping</title>
625 <para>
626 As a package maintainer, you will often find bugs in other packages or have
627 bugs reported against your packages which are actually bugs in other packages.
628 The bug tracking system's features are described in the <ulink
629 url="&url-bts-devel;">BTS documentation for Debian
630 developers</ulink>.  Operations such as reassigning, merging, and tagging bug
631 reports are described in the <ulink
632 url="&url-bts-control;">BTS control server
633 documentation</ulink>.  This section contains some guidelines for managing your
634 own bugs, based on the collective Debian developer experience.
635 </para>
636 <para>
637 Filing bugs for problems that you find in other packages is one of the civic
638 obligations of maintainership, see <xref linkend="submit-bug"/> for details.
639 However, handling the bugs in your own packages is even more important.
640 </para>
641 <para>
642 Here's a list of steps that you may follow to handle a bug report:
643 </para>
644 <orderedlist numeration="arabic">
645 <listitem>
646 <para>
647 Decide whether the report corresponds to a real bug or not.  Sometimes users
648 are just calling a program in the wrong way because they haven't read the
649 documentation.  If you diagnose this, just close the bug with enough
650 information to let the user correct their problem (give pointers to the good
651 documentation and so on).  If the same report comes up again and again you may
652 ask yourself if the documentation is good enough or if the program shouldn't
653 detect its misuse in order to give an informative error message.  This is an
654 issue that may need to be brought up with the upstream author.
655 </para>
656 <para>
657 If the bug submitter disagrees with your decision to close the bug, they may
658 reopen it until you find an agreement on how to handle it.  If you don't find
659 any, you may want to tag the bug <literal>wontfix</literal> to let people know
660 that the bug exists but that it won't be corrected.  If this situation is
661 unacceptable, you (or the submitter) may want to require a decision of the
662 technical committee by reassigning the bug to <systemitem
663 role="package">tech-ctte</systemitem> (you may use the clone command of the BTS
664 if you wish to keep it reported against your package).  Before doing so, please
665 read the <ulink url="&url-tech-ctte;">recommended
666 procedure</ulink>.
667 </para>
668 </listitem>
669 <listitem>
670 <para>
671 If the bug is real but it's caused by another package, just reassign the bug to
672 the right package.  If you don't know which package it should be reassigned to,
673 you should ask for help on <link linkend="irc-channels">IRC</link> or
674 on &email-debian-devel;.  Please inform the maintainer(s) of the package
675 you reassign the bug to, for example by Cc:ing the message that does the
676 reassign to <email>packagename@packages.debian.org</email> and explaining
677 your reasons in that mail. Please note that a simple reassignment is
678 <emphasis>not</emphasis> e-mailed to the maintainers of the package
679 being reassigned to, so they won't know about it until they look at
680 a bug overview for their packages.
681 </para>
682 <para>
683 If the bug affects the operation of your package, please consider
684 cloning the bug and reassigning the clone to the package that really
685 causes the behavior. Otherwise, the bug will not be shown in your
686 package's bug list, possibly causing users to report the same bug over
687 and over again. You should block "your" bug with the reassigned, cloned
688 bug to document the relationship.
689 </para>
690 </listitem>
691 <listitem>
692 <para>
693 Sometimes you also have to adjust the severity of the bug so that it matches
694 our definition of the severity.  That's because people tend to inflate the
695 severity of bugs to make sure their bugs are fixed quickly.  Some bugs may even
696 be dropped to wishlist severity when the requested change is just cosmetic.
697 </para>
698 </listitem>
699 <listitem>
700 <para>
701 If the bug is real but the same problem has already been reported by someone
702 else, then the two relevant bug reports should be merged into one using the
703 merge command of the BTS.  In this way, when the bug is fixed, all of the
704 submitters will be informed of this.  (Note, however, that emails sent to one
705 bug report's submitter won't automatically be sent to the other report's
706 submitter.) For more details on the technicalities of the merge command and its
707 relative, the unmerge command, see the BTS control server documentation.
708 </para>
709 </listitem>
710 <listitem>
711 <para>
712 The bug submitter may have forgotten to provide some information, in which case
713 you have to ask them for the required information.  You may use the
714 <literal>moreinfo</literal> tag to mark the bug as such.  Moreover if you can't
715 reproduce the bug, you tag it <literal>unreproducible</literal>.  Anyone who
716 can reproduce the bug is then invited to provide more information on how to
717 reproduce it.  After a few months, if this information has not been sent by
718 someone, the bug may be closed.
719 </para>
720 </listitem>
721 <listitem>
722 <para>
723 If the bug is related to the packaging, you just fix it.  If you are not able
724 to fix it yourself, then tag the bug as <literal>help</literal>.  You can also
725 ask for help on &email-debian-devel; or
726 &email-debian-qa;.  If it's an upstream problem, you have to
727 forward it to the upstream author.  Forwarding a bug is not enough, you have to
728 check at each release if the bug has been fixed or not.  If it has, you just
729 close it, otherwise you have to remind the author about it.  If you have the
730 required skills you can prepare a patch that fixes the bug and send it to the
731 author at the same time.  Make sure to send the patch to the BTS and to tag the
732 bug as <literal>patch</literal>.
733 </para>
734 </listitem>
735 <listitem>
736 <para>
737 If you have fixed a bug in your local copy, or if a fix has been committed to
738 the CVS repository, you may tag the bug as <literal>pending</literal> to let
739 people know that the bug is corrected and that it will be closed with the next
740 upload (add the <literal>closes:</literal> in the
741 <filename>changelog</filename>).  This is particularly useful if you are
742 several developers working on the same package.
743 </para>
744 </listitem>
745 <listitem>
746 <para>
747 Once a corrected package is available in the archive, the bug should be
748 closed indicating the version in which it was fixed. This can be done
749 automatically, read <xref linkend="upload-bugfix"/>.
750 </para>
751 </listitem>
752 </orderedlist>
753 </section>
754
755 <section id="upload-bugfix">
756 <title>When bugs are closed by new uploads</title>
757 <para>
758 As bugs and problems are fixed in your packages, it is your responsibility as
759 the package maintainer to close these bugs.  However, you should not close a
760 bug until the package which fixes the bug has been accepted into the Debian
761 archive.  Therefore, once you get notification that your updated package has
762 been installed into the archive, you can and should close the bug in the BTS.
763 Also, the bug should be closed with the correct version.
764 </para>
765 <para>
766 However, it's possible to avoid having to manually close bugs after the upload
767 — just list the fixed bugs in your <filename>debian/changelog</filename>
768 file, following a certain syntax, and the archive maintenance software will
769 close the bugs for you.  For example:
770 </para>
771 <screen>
772 acme-cannon (3.1415) unstable; urgency=low
773
774   * Frobbed with options (closes: Bug#98339)
775   * Added safety to prevent operator dismemberment, closes: bug#98765,
776     bug#98713, #98714.
777   * Added man page. Closes: #98725.
778 </screen>
779 <para>
780 Technically speaking, the following Perl regular expression describes how bug
781 closing changelogs are identified:
782 </para>
783 <screen>
784   /closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*/ig
785 </screen>
786 <para>
787 We prefer the <literal>closes: #<replaceable>XXX</replaceable></literal>
788 syntax, as it is the most concise entry and the easiest to integrate with the
789 text of the <filename>changelog</filename>.  Unless specified different by the
790 <replaceable>-v</replaceable>-switch to <command>dpkg-buildpackage</command>,
791 only the bugs closed in the most recent changelog entry are closed (basically,
792 exactly the bugs mentioned in the changelog-part in the
793 <filename>.changes</filename> file are closed).
794 </para>
795 <para>
796 Historically, uploads identified as <link linkend="nmu">Non-maintainer
797 upload (NMU)</link> were tagged <literal>fixed</literal> instead of being
798 closed, but that practice was ceased with the advent of version-tracking.  The
799 same applied to the tag <literal>fixed-in-experimental</literal>.
800 </para>
801 <para>
802 If you happen to mistype a bug number or forget a bug in the changelog entries,
803 don't hesitate to undo any damage the error caused.  To reopen wrongly closed
804 bugs, send a <literal>reopen <replaceable>XXX</replaceable></literal> command
805 to the bug tracking system's control address,
806 &email-bts-control;.  To close any remaining bugs that were
807 fixed by your upload, email the <filename>.changes</filename> file to
808 <email>XXX-done@&bugs-host;</email>, where <replaceable>XXX</replaceable>
809 is the bug number, and put Version: YYY and an empty line as the first two
810 lines of the body of the email, where <replaceable>YYY</replaceable> is the
811 first version where the bug has been fixed.
812 </para>
813 <para>
814 Bear in mind that it is not obligatory to close bugs using the changelog as
815 described above.  If you simply want to close bugs that don't have anything to
816 do with an upload you made, do it by emailing an explanation to
817 <email>XXX-done@&bugs-host;</email>.  Do <emphasis
818 role="strong">not</emphasis> close bugs in the changelog entry of a version if
819 the changes in that version of the package don't have any bearing on the bug.
820 </para>
821 <para>
822 For general information on how to write your changelog entries, see <xref
823 linkend="bpp-debian-changelog"/> .
824 </para>
825 </section>
826
827 <section id="bug-security">
828 <title>Handling security-related bugs</title>
829 <para>
830 Due to their sensitive nature, security-related bugs must be handled carefully.
831 The Debian Security Team exists to coordinate this activity, keeping track of
832 outstanding security problems, helping maintainers with security problems or
833 fixing them themselves, sending security advisories, and maintaining
834 <literal>security.debian.org</literal>.
835 </para>
836 <para>
837 When you become aware of a security-related bug in a Debian package, whether or
838 not you are the maintainer, collect pertinent information about the problem,
839 and promptly contact the security team at
840 &email-security-team; as soon as possible.  <emphasis
841 role="strong">DO NOT UPLOAD</emphasis> any packages for <literal>stable</literal>
842 without contacting the team.  Useful information includes, for example:
843 </para>
844 <itemizedlist>
845 <listitem>
846 <para>
847 Which versions of the package are known to be affected by the bug.  Check each
848 version that is present in a supported Debian release, as well as 
849 <literal>testing</literal> and <literal>unstable</literal>.
850 </para>
851 </listitem>
852 <listitem>
853 <para>
854 The nature of the fix, if any is available (patches are especially helpful)
855 </para>
856 </listitem>
857 <listitem>
858 <para>
859 Any fixed packages that you have prepared yourself (send only the
860 <literal>.diff.gz</literal> and <literal>.dsc</literal> files and read <xref
861 linkend="bug-security-building"/> first)
862 </para>
863 </listitem>
864 <listitem>
865 <para>
866 Any assistance you can provide to help with testing (exploits, regression
867 testing, etc.)
868 </para>
869 </listitem>
870 <listitem>
871 <para>
872 Any information needed for the advisory (see <xref
873 linkend="bug-security-advisories"/> )
874 </para>
875 </listitem>
876 </itemizedlist>
877 <para>As the maintainer of the package, you have the responsibility to
878 maintain it, even in the stable release. You are in the best position
879 to evaluate patches and test updated packages, so please see the sections
880 below on how to prepare packages for the Security Team to handle.</para>
881
882 <section id="bug-security-tracker">
883 <title>The Security Tracker</title>
884 <para>
885 The security team maintains a central database, the
886 <ulink url="http://security-tracker.debian.net/">Debian Security Tracker</ulink>.
887 This contains all public information that is known about security issues:
888 which packages and versions are affected or fixed, and thus whether stable,
889 testing and/or unstable are vulnerable. Information that is still confidential
890 is not added to the tracker.
891 </para>
892 <para>
893 You can search it for a specific issue, but also on package name. Look
894 for your package to see which issues are still open. If you can, please provide
895 more information about those issues, or help to address them in your package.
896 Instructions are on the tracker web pages.
897 </para>
898 </section>
899
900 <section id="bug-security-confidentiality">
901 <title>Confidentiality</title>
902 <para>
903 Unlike most other activities within Debian, information about security issues
904 must sometimes be kept private for a time.  This allows software distributors
905 to coordinate their disclosure in order to minimize their users' exposure.
906 Whether this is the case depends on the nature of the problem and corresponding
907 fix, and whether it is already a matter of public knowledge.
908 </para>
909 <para>
910 There are several ways developers can learn of a security problem:
911 </para>
912 <itemizedlist>
913 <listitem>
914 <para>
915 they notice it on a public forum (mailing list, web site, etc.)
916 </para>
917 </listitem>
918 <listitem>
919 <para>
920 someone files a bug report
921 </para>
922 </listitem>
923 <listitem>
924 <para>
925 someone informs them via private email
926 </para>
927 </listitem>
928 </itemizedlist>
929 <para>
930 In the first two cases, the information is public and it is important to have a
931 fix as soon as possible.  In the last case, however, it might not be public
932 information.  In that case there are a few possible options for dealing with
933 the problem:
934 </para>
935 <itemizedlist>
936 <listitem>
937 <para>
938 If the security exposure is minor, there is sometimes no need to keep the
939 problem a secret and a fix should be made and released.
940 </para>
941 </listitem>
942 <listitem>
943 <para>
944 If the problem is severe, it is preferable to share the information with other
945 vendors and coordinate a release.  The security team keeps in contact with the
946 various organizations and individuals and can take care of that.
947 </para>
948 </listitem>
949 </itemizedlist>
950 <para>
951 In all cases if the person who reports the problem asks that it not be
952 disclosed, such requests should be honored, with the obvious exception of
953 informing the security team in order that a fix may be produced for a stable
954 release of Debian.  When sending confidential information to the security team,
955 be sure to mention this fact.
956 </para>
957 <para>
958 Please note that if secrecy is needed you may not upload a fix to 
959 <literal>unstable</literal> (or
960 anywhere else, such as a public CVS repository).  It is not sufficient to
961 obfuscate the details of the change, as the code itself is public, and can (and
962 will) be examined by the general public.
963 </para>
964 <para>
965 There are two reasons for releasing information even though secrecy is
966 requested: the problem has been known for a while, or the problem or exploit
967 has become public.
968 </para>
969 <para>
970 The Security Team has a PGP-key to enable encrypted communication about
971 sensitive issues. See the <ulink url="http://www.debian.org/security/faq.en.html#contact">Security Team FAQ</ulink> for details.
972 </para>
973 </section>
974
975 <section id="bug-security-advisories">
976 <title>Security Advisories</title>
977 <para>
978 Security advisories are only issued for the current, released stable
979 distribution, and <emphasis>not</emphasis> for <literal>testing</literal>
980 or <literal>unstable</literal>.  When released, advisories are sent to the
981 &email-debian-security-announce; mailing list and posted on
982 <ulink url="&url-debian-security-advisories;">the security web
983 page</ulink>.  Security advisories are written and posted by the security team.
984 However they certainly do not mind if a maintainer can supply some of the
985 information for them, or write part of the text.  Information that should be in
986 an advisory includes:
987 </para>
988 <itemizedlist>
989 <listitem>
990 <para>
991 A description of the problem and its scope, including:
992 </para>
993 <itemizedlist>
994 <listitem>
995 <para>
996 The type of problem (privilege escalation, denial of service, etc.)
997 </para>
998 </listitem>
999 <listitem>
1000 <para>
1001 What privileges may be gained, and by whom (if any)
1002 </para>
1003 </listitem>
1004 <listitem>
1005 <para>
1006 How it can be exploited
1007 </para>
1008 </listitem>
1009 <listitem>
1010 <para>
1011 Whether it is remotely or locally exploitable
1012 </para>
1013 </listitem>
1014 <listitem>
1015 <para>
1016 How the problem was fixed
1017 </para>
1018 </listitem>
1019 </itemizedlist>
1020 <para>
1021 This information allows users to assess the threat to their systems.
1022 </para>
1023 </listitem>
1024 <listitem>
1025 <para>
1026 Version numbers of affected packages
1027 </para>
1028 </listitem>
1029 <listitem>
1030 <para>
1031 Version numbers of fixed packages
1032 </para>
1033 </listitem>
1034 <listitem>
1035 <para>
1036 Information on where to obtain the updated packages (usually from the Debian
1037 security archive)
1038 </para>
1039 </listitem>
1040 <listitem>
1041 <para>
1042 References to upstream advisories, <ulink
1043 url="http://cve.mitre.org">CVE</ulink> identifiers, and any other information
1044 useful in cross-referencing the vulnerability
1045 </para>
1046 </listitem>
1047 </itemizedlist>
1048 </section>
1049
1050 <section id="bug-security-building">
1051 <title>Preparing packages to address security issues</title>
1052 <para>
1053 One way that you can assist the security team in their duties is to provide
1054 them with fixed packages suitable for a security advisory for the stable Debian
1055 release.
1056 </para>
1057 <para>
1058 When an update is made to the stable release, care must be taken to avoid
1059 changing system behavior or introducing new bugs.  In order to do this, make as
1060 few changes as possible to fix the bug.  Users and administrators rely on the
1061 exact behavior of a release once it is made, so any change that is made might
1062 break someone's system.  This is especially true of libraries: make sure you
1063 never change the API or ABI, no matter how small the change.
1064 </para>
1065 <para>
1066 This means that moving to a new upstream version is not a good solution.
1067 Instead, the relevant changes should be back-ported to the version present in
1068 the current stable Debian release.  Generally, upstream maintainers are willing
1069 to help if needed.  If not, the Debian security team may be able to help.
1070 </para>
1071 <para>
1072 In some cases, it is not possible to back-port a security fix, for example when
1073 large amounts of source code need to be modified or rewritten.  If this
1074 happens, it may be necessary to move to a new upstream version.  However, this
1075 is only done in extreme situations, and you must always coordinate that with
1076 the security team beforehand.
1077 </para>
1078 <para>
1079 Related to this is another important guideline: always test your changes.  If
1080 you have an exploit available, try it and see if it indeed succeeds on the
1081 unpatched package and fails on the fixed package.  Test other, normal actions
1082 as well, as sometimes a security fix can break seemingly unrelated features in
1083 subtle ways.
1084 </para>
1085 <para>
1086 Do <emphasis role="strong">NOT</emphasis> include any changes in your package
1087 which are not directly related to fixing the vulnerability.  These will only
1088 need to be reverted, and this wastes time.  If there are other bugs in your
1089 package that you would like to fix, make an upload to proposed-updates in the
1090 usual way, after the security advisory is issued.  The security update
1091 mechanism is not a means for introducing changes to your package which would
1092 otherwise be rejected from the stable release, so please do not attempt to do
1093 this.
1094 </para>
1095 <para>
1096 Review and test your changes as much as possible.  Check the differences from
1097 the previous version repeatedly (<command>interdiff</command> from the
1098 <systemitem role="package">patchutils</systemitem> package and
1099 <command>debdiff</command> from <systemitem
1100 role="package">devscripts</systemitem> are useful tools for this, see <xref
1101 linkend="debdiff"/> ).
1102 </para>
1103 <para>
1104 Be sure to verify the following items:
1105 </para>
1106 <itemizedlist>
1107 <listitem>
1108 <para>
1109 <emphasis role="strong">Target the right distribution</emphasis>
1110 in your <filename>debian/changelog</filename>.
1111 For <literal>stable</literal> this is <literal>stable-security</literal> and
1112 for testing this is <literal>testing-security</literal>, and for the previous
1113 stable release, this is <literal>oldstable-security</literal>.  Do not target
1114 <replaceable>distribution</replaceable><literal>-proposed-updates</literal> or
1115 <literal>stable</literal>!
1116 </para>
1117 </listitem>
1118 <listitem>
1119 <para>
1120 The upload should have <emphasis role="strong">urgency=high</emphasis>.
1121 </para>
1122 </listitem>
1123 <listitem>
1124 <para>
1125 Make descriptive, meaningful changelog entries.  Others will rely on them to
1126 determine whether a particular bug was fixed.  Add <literal>closes:</literal>
1127 statements for any <emphasis role="strong">Debian bugs</emphasis> filed.
1128 Always include an external reference, preferably a <emphasis role="strong">CVE
1129 identifier</emphasis>, so that it can be cross-referenced. However, if a CVE
1130 identifier has not yet been assigned, do not wait for it but continue the
1131 process. The identifier can be cross-referenced later.
1132 </para>
1133 </listitem>
1134 <listitem>
1135 <para>
1136 Make sure the <emphasis role="strong">version number</emphasis> is proper. 
1137 It must be greater than the current package, but less than package versions in
1138 later distributions.  If in doubt, test it with <literal>dpkg
1139 --compare-versions</literal>.  Be careful not to re-use a version number that
1140 you have already used for a previous upload, or one that conflicts with a
1141 binNMU. The convention is to append
1142 <literal>+</literal><replaceable>codename</replaceable><literal>1</literal>, e.g.
1143 <literal>1:2.4.3-4+etch1</literal>, of course increasing 1 for any subsequent
1144 uploads.
1145 </para>
1146 </listitem>
1147 <listitem>
1148 <para>
1149 Unless the upstream source has been uploaded to <literal>security.debian.org
1150 </literal> before (by a previous security update), build the upload <emphasis
1151 role="strong">with full upstream source</emphasis> (<literal>dpkg-buildpackage
1152 -sa</literal>).  If there has been a previous upload to
1153 <literal>security.debian.org</literal> with the same upstream version, you may
1154 upload without upstream source (<literal> dpkg-buildpackage -sd</literal>).
1155 </para>
1156 </listitem>
1157 <listitem>
1158 <para>
1159 Be sure to use the <emphasis role="strong">exact same
1160 <filename>*.orig.tar.gz</filename></emphasis> as used in the
1161 normal archive, otherwise it is not possible to move the security fix into the
1162 main archives later.
1163 </para>
1164 </listitem>
1165 <listitem>
1166 <para>
1167 Build the package on a <emphasis role="strong">clean system</emphasis> which only
1168 has packages installed from the distribution you are building for. If you do not
1169 have such a system yourself, you can use a debian.org machine (see
1170 <xref linkend="server-machines"/> ) or setup a chroot (see
1171 <xref linkend="pbuilder"/> and <xref linkend="debootstrap"/> ).
1172 </para>
1173 </listitem>
1174 </itemizedlist>
1175 </section>
1176
1177 <section id="bug-security-upload">
1178 <title>Uploading the fixed package</title>
1179 <para>
1180 Do <emphasis role="strong">NOT</emphasis> upload a package to the security
1181 upload queue (<literal>oldstable-security</literal>, <literal>stable-security
1182 </literal>, etc.) without prior authorization from the security team.  If the
1183 package does not exactly meet the team's requirements, it will cause many 
1184 problems and delays in dealing with the unwanted upload.
1185 </para>
1186 <para>
1187 Do <emphasis role="strong">NOT</emphasis> upload your fix to <literal>
1188 proposed-updates</literal> without coordinating with the security team.  
1189 Packages from <literal>security.debian.org</literal> will be copied into
1190 the <literal>proposed-updates</literal> directory automatically.  If a package
1191 with the same or a higher version number is already installed into the archive,
1192 the security update will be rejected by the archive system.  That way, the
1193 stable distribution will end up without a security update for this package
1194 instead.
1195 </para>
1196 <para>
1197 Once you have created and tested the new package and it has been approved by
1198 the security team, it needs to be uploaded so that it can be installed in the
1199 archives.  For security uploads, the place to upload to is
1200 <literal>ftp://security-master.debian.org/pub/SecurityUploadQueue/</literal> .
1201 </para>
1202 <para>
1203 Once an upload to the security queue has been accepted, the package will
1204 automatically be built for all architectures and stored for verification by
1205 the security team.
1206 </para>
1207 <para>
1208 Uploads which are waiting for acceptance or verification are only accessible by
1209 the security team.  This is necessary since there might be fixes for security
1210 problems that cannot be disclosed yet.
1211 </para>
1212 <para>
1213 If a member of the security team accepts a package, it will be installed on
1214 <literal>security.debian.org</literal> as well as proposed for the proper
1215 <replaceable>distribution</replaceable><literal>-proposed-updates</literal>
1216 on <literal>&ftp-master-host;</literal>.
1217 </para>
1218 </section>
1219
1220 </section>
1221
1222 </section>
1223
1224 <section id="archive-manip">
1225 <title>Moving, removing, renaming, adopting, and orphaning packages</title>
1226 <para>
1227 Some archive manipulation operations are not automated in the Debian upload
1228 process.  These procedures should be manually followed by maintainers.  This
1229 chapter gives guidelines on what to do in these cases.
1230 </para>
1231 <section id="moving-pkgs">
1232 <title>Moving packages</title>
1233 <para>
1234 Sometimes a package will change its section.  For instance, a package from the
1235 `non-free' section might be GPL'd in a later version, in which case the package
1236 should be moved to `main' or `contrib'.<footnote><para> See the <ulink
1237 url="&url-debian-policy;">Debian Policy Manual</ulink> for
1238 guidelines on what section a package belongs in.  </para> </footnote>
1239 </para>
1240 <para>
1241 If you need to change the section for one of your packages, change the package
1242 control information to place the package in the desired section, and re-upload
1243 the package (see the <ulink
1244 url="&url-debian-policy;">Debian Policy Manual</ulink> for
1245 details).  You must ensure that you include the
1246 <filename>.orig.tar.gz</filename> in your upload (even if you are not uploading
1247 a new upstream version), or it will not appear in the new section together with
1248 the rest of the package.  If your new section is valid, it will be moved
1249 automatically.  If it does not, then contact the ftpmasters in order to
1250 understand what happened.
1251 </para>
1252 <para>
1253 If, on the other hand, you need to change the <literal>subsection</literal>
1254 of one of your packages (e.g., ``devel'', ``admin''), the procedure is slightly
1255 different.  Correct the subsection as found in the control file of the package,
1256 and re-upload that.  Also, you'll need to get the override file updated, as
1257 described in <xref linkend="override-file"/> .
1258 </para>
1259 </section>
1260
1261 <section id="removing-pkgs">
1262 <title>Removing packages</title>
1263 <para>
1264 If for some reason you want to completely remove a package (say, if it is an
1265 old compatibility library which is no longer required), you need to file a bug
1266 against <literal>ftp.debian.org</literal> asking that the package be removed;
1267 as all bugs, this bug should normally have normal severity.
1268 The bug title should be in the form <literal>RM: <replaceable>package
1269 </replaceable> <replaceable>[architecture list]</replaceable> -- 
1270 <replaceable>reason</replaceable></literal>, where <replaceable>package</replaceable>
1271 is the package to be removed and <replaceable>reason</replaceable> is a
1272 short summary of the reason for the removal request. 
1273 <replaceable>[architecture list]</replaceable> is optional and only needed
1274 if the removal request only applies to some architectures, not all. Note
1275 that the <command>reportbug</command> will create a title conforming
1276 to these rules when you use it to report a bug against the <literal>
1277 ftp.debian.org</literal> pseudo-package.
1278 </para>
1279
1280 <para>
1281 If you want to remove a package you maintain, you should note this in
1282 the bug title by prepending <literal>ROM</literal> (Request Of Maintainer).
1283 There are several other standard acronyms used in the reasoning for a package
1284 removal, see <ulink url="http://&ftp-master-host;/removals.html"></ulink>
1285 for a complete list. That page also provides a convenient overview of
1286 pending removal requests.
1287 </para>
1288
1289 <para>
1290 Note that removals can only be done for the <literal>unstable
1291 </literal>, <literal>experimental</literal> and <literal>stable
1292 </literal> distribution.  Packages are not removed from 
1293 <literal>testing</literal> directly.  Rather, they will be removed
1294 automatically after the package has been removed from
1295 <literal>unstable</literal> and no package in <literal>testing
1296 </literal> depends on it.
1297 </para>
1298 <para>
1299 There is one exception when an explicit removal request is not necessary: If a
1300 (source or binary) package is an orphan, it will be removed semi-automatically.
1301 For a binary-package, this means if there is no longer any source package
1302 producing this binary package; if the binary package is just no longer produced
1303 on some architectures, a removal request is still necessary.  For a
1304 source-package, this means that all binary packages it refers to have been
1305 taken over by another source package.
1306 </para>
1307 <para>
1308 In your removal request, you have to detail the reasons justifying the request.
1309 This is to avoid unwanted removals and to keep a trace of why a package has
1310 been removed.  For example, you can provide the name of the package that
1311 supersedes the one to be removed.
1312 </para>
1313 <para>
1314 Usually you only ask for the removal of a package maintained by yourself.  If
1315 you want to remove another package, you have to get the approval of its
1316 maintainer. Should the package be orphaned and thus have no maintainer,
1317 you should first discuss the removal request on &email-debian-qa;. If
1318 there is a consensus that the package should be removed, you should
1319 reassign and retitle the <literal>O:</literal> bug filed against the
1320 <literal>wnpp</literal> package instead of filing a new bug as
1321 removal request.
1322 </para>
1323 <para>
1324 Further information relating to these and other package removal related topics
1325 may be found at <ulink url="http://wiki.debian.org/ftpmaster_Removals"></ulink>
1326 and <ulink url="&url-debian-qa;howto-remove.html"></ulink>.
1327 </para>
1328 <para>
1329 If in doubt concerning whether a package is disposable, email
1330 &email-debian-devel; asking for opinions.  Also of interest is
1331 the <command>apt-cache</command> program from the <systemitem
1332 role="package">apt</systemitem> package.  When invoked as <literal>apt-cache
1333 showpkg <replaceable>package</replaceable></literal>, the program will show
1334 details for <replaceable>package</replaceable>, including reverse depends.
1335 Other useful programs include <literal>apt-cache rdepends</literal>,
1336 <command>apt-rdepends</command>, <command>build-rdeps</command> (in the
1337 <systemitem role="package">devscripts</systemitem> package) and
1338 <command>grep-dctrl</command>.  Removal of
1339 orphaned packages is discussed on &email-debian-qa;.
1340 </para>
1341 <para>
1342 Once the package has been removed, the package's bugs should be handled.  They
1343 should either be reassigned to another package in the case where the actual
1344 code has evolved into another package (e.g.  <literal>libfoo12</literal> was
1345 removed because <literal>libfoo13</literal> supersedes it) or closed if the
1346 software is simply no longer part of Debian.
1347 When closing the bugs,
1348 to avoid marking the bugs as fixed in versions of the packages
1349 in previous Debian releases, they should be marked as fixed
1350 in the version <literal>&lt;most-recent-version-ever-in-Debian&gt;+rm</literal>.
1351 </para>
1352 <section id="s5.9.2.1">
1353 <title>Removing packages from <filename>Incoming</filename></title>
1354 <para>
1355 In the past, it was possible to remove packages from
1356 <filename>incoming</filename>.  However, with the introduction of the new
1357 incoming system, this is no longer possible.  Instead, you have to upload a new
1358 revision of your package with a higher version than the package you want to
1359 replace.  Both versions will be installed in the archive but only the higher
1360 version will actually be available in <literal>unstable</literal> since the
1361 previous version will immediately be replaced by the higher.  However, if you
1362 do proper testing of your packages, the need to replace a package should not
1363 occur too often anyway.
1364 </para>
1365 </section>
1366
1367 </section>
1368
1369 <section id="s5.9.3">
1370 <title>Replacing or renaming packages</title>
1371 <para>
1372 When the upstream maintainers for one of your packages chose to
1373 rename their software (or you made a mistake naming your package),
1374 you should follow a two-step process to rename it. In the first
1375 step, change the <filename>debian/control</filename> file to
1376 reflect the new name and to replace, provide and conflict with the
1377 obsolete package name (see the <ulink url="&url-debian-policy;">
1378 Debian Policy Manual</ulink> for details).  Please note that you
1379 should only add a <literal>Provides</literal> relation if all
1380 packages depending on the obsolete package name continue to work
1381 after the renaming. Once you've uploaded the package and the package
1382 has moved into the archive, file a bug against <literal>
1383 ftp.debian.org</literal> asking to remove the package with the
1384 obsolete name (see <xref linkend="removing-pkgs"/>).  Do not forget
1385 to properly reassign the package's bugs at the same time.
1386 </para>
1387 <para>
1388 At other times, you may make a mistake in constructing your package and wish to
1389 replace it.  The only way to do this is to increase the version number and
1390 upload a new version.  The old version will be expired in the usual manner.
1391 Note that this applies to each part of your package, including the sources: if
1392 you wish to replace the upstream source tarball of your package, you will need
1393 to upload it with a different version.  An easy possibility is to replace
1394 <filename>foo_1.00.orig.tar.gz</filename> with
1395 <filename>foo_1.00+0.orig.tar.gz</filename>.  This restriction gives each file
1396 on the ftp site a unique name, which helps to ensure consistency across the
1397 mirror network.
1398 </para>
1399 </section>
1400
1401 <section id="orphaning">
1402 <title>Orphaning a package</title>
1403 <para>
1404 If you can no longer maintain a package, you need to inform others, and see
1405 that the package is marked as orphaned.  You should set the package maintainer
1406 to <literal>Debian QA Group &orphan-address;</literal> and
1407 submit a bug report against the pseudo package <systemitem
1408 role="package">wnpp</systemitem>.  The bug report should be titled <literal>O:
1409 <replaceable>package</replaceable> -- <replaceable>short
1410 description</replaceable></literal> indicating that the package is now
1411 orphaned.  The severity of the bug should be set to
1412 <literal>normal</literal>; if the package has a priority of standard or
1413 higher, it should be set to important.  If you feel it's necessary, send a copy
1414 to &email-debian-devel; by putting the address in the
1415 X-Debbugs-CC: header of the message (no, don't use CC:, because that way the
1416 message's subject won't indicate the bug number).
1417 </para>
1418 <para>
1419 If you just intend to give the package away, but you can keep maintainership
1420 for the moment, then you should instead submit a bug against <systemitem
1421 role="package">wnpp</systemitem> and title it <literal>RFA:
1422 <replaceable>package</replaceable> -- <replaceable>short
1423 description</replaceable></literal>.  <literal>RFA</literal> stands for
1424 <literal>Request For Adoption</literal>.
1425 </para>
1426 <para>
1427 More information is on the <ulink url="&url-wnpp;">WNPP
1428 web pages</ulink>.
1429 </para>
1430 </section>
1431
1432 <section id="adopting">
1433 <title>Adopting a package</title>
1434 <para>
1435 A list of packages in need of a new maintainer is available in the <ulink
1436 url="&url-wnpp;">Work-Needing and Prospective Packages
1437 list (WNPP)</ulink>.  If you wish to take over maintenance of any of the
1438 packages listed in the WNPP, please take a look at the aforementioned page for
1439 information and procedures.
1440 </para>
1441 <para>
1442 It is not OK to simply take over a package that you feel is neglected — that
1443 would be package hijacking.  You can, of course, contact the current maintainer
1444 and ask them if you may take over the package.  If you have reason to believe a
1445 maintainer has gone AWOL (absent without leave), see <xref linkend="mia-qa"/> .
1446 </para>
1447 <para>
1448 Generally, you may not take over the package without the assent of the current
1449 maintainer.  Even if they ignore you, that is still not grounds to take over a
1450 package.  Complaints about maintainers should be brought up on the developers'
1451 mailing list.  If the discussion doesn't end with a positive conclusion, and
1452 the issue is of a technical nature, consider bringing it to the attention of
1453 the technical committee (see the <ulink
1454 url="&url-tech-ctte;">technical committee web page</ulink> for
1455 more information).
1456 </para>
1457 <para>
1458 If you take over an old package, you probably want to be listed as the
1459 package's official maintainer in the bug system.  This will happen
1460 automatically once you upload a new version with an updated
1461 <literal>Maintainer:</literal> field, although it can take a few hours after
1462 the upload is done.  If you do not expect to upload a new version for a while,
1463 you can use <xref linkend="pkg-tracking-system"/> to get the bug reports.
1464 However, make sure that the old maintainer has no problem with the fact that
1465 they will continue to receive the bugs during that time.
1466 </para>
1467 </section>
1468
1469 </section>
1470
1471 <section id="porting">
1472 <title>Porting and being ported</title>
1473 <para>
1474 Debian supports an ever-increasing number of architectures.  Even if you are
1475 not a porter, and you don't use any architecture but one, it is part of your
1476 duty as a maintainer to be aware of issues of portability.  Therefore, even if
1477 you are not a porter, you should read most of this chapter.
1478 </para>
1479 <para>
1480 Porting is the act of building Debian packages for architectures that are
1481 different from the original architecture of the package maintainer's binary
1482 package.  It is a unique and essential activity.  In fact, porters do most of
1483 the actual compiling of Debian packages.  For instance, when a maintainer
1484 uploads a (portable) source packages with binaries for the <literal>i386
1485 </literal> architecture, it will be built for each of the other architectures,
1486 amounting to &number-of-arches; more builds.
1487 </para>
1488 <section id="kind-to-porters">
1489 <title>Being kind to porters</title>
1490 <para>
1491 Porters have a difficult and unique task, since they are required to deal with
1492 a large volume of packages.  Ideally, every source package should build right
1493 out of the box.  Unfortunately, this is often not the case.  This section
1494 contains a checklist of ``gotchas'' often committed by Debian maintainers —
1495 common problems which often stymie porters, and make their jobs unnecessarily
1496 difficult.
1497 </para>
1498 <para>
1499 The first and most important thing is to respond quickly to bug or issues
1500 raised by porters.  Please treat porters with courtesy, as if they were in fact
1501 co-maintainers of your package (which, in a way, they are).  Please be tolerant
1502 of succinct or even unclear bug reports; do your best to hunt down whatever the
1503 problem is.
1504 </para>
1505 <para>
1506 By far, most of the problems encountered by porters are caused by
1507 <emphasis>packaging bugs</emphasis> in the source packages.  Here is a
1508 checklist of things you should check or be aware of.
1509 </para>
1510 <orderedlist numeration="arabic">
1511 <listitem>
1512 <para>
1513 Make sure that your <literal>Build-Depends</literal> and
1514 <literal>Build-Depends-Indep</literal> settings in
1515 <filename>debian/control</filename> are set properly.  The best way to validate
1516 this is to use the <systemitem role="package">debootstrap</systemitem> package
1517 to create an <literal>unstable</literal> chroot environment (see <xref
1518 linkend="debootstrap"/> ).
1519 Within that chrooted environment, install the <systemitem
1520 role="package">build-essential</systemitem> package and any package
1521 dependencies mentioned in <literal>Build-Depends</literal> and/or
1522 <literal>Build-Depends-Indep</literal>.  Finally, try building your package
1523 within that chrooted environment.  These steps can be automated by the use of
1524 the <command>pbuilder</command> program which is provided by the package of the
1525 same name (see <xref linkend="pbuilder"/> ).
1526 </para>
1527 <para>
1528 If you can't set up a proper chroot, <command>dpkg-depcheck</command> may be of
1529 assistance (see <xref linkend="dpkg-depcheck"/> ).
1530 </para>
1531 <para>
1532 See the <ulink url="&url-debian-policy;">Debian Policy
1533 Manual</ulink> for instructions on setting build dependencies.
1534 </para>
1535 </listitem>
1536 <listitem>
1537 <para>
1538 Don't set architecture to a value other than <literal>all</literal> or 
1539 <literal>any</literal> unless you really mean it.  In too many cases,
1540 maintainers don't follow the instructions in the <ulink 
1541 url="&url-debian-policy;">Debian Policy Manual</ulink>.  Setting your
1542 architecture to only one architecture (such as <literal>i386</literal>
1543 or <literal>amd64</literal>) is usually incorrect.
1544 </para>
1545 </listitem>
1546 <listitem>
1547 <para>
1548 Make sure your source package is correct.  Do <literal>dpkg-source -x
1549 <replaceable>package</replaceable>.dsc</literal> to make sure your source
1550 package unpacks properly.  Then, in there, try building your package from
1551 scratch with <command>dpkg-buildpackage</command>.
1552 </para>
1553 </listitem>
1554 <listitem>
1555 <para>
1556 Make sure you don't ship your source package with the
1557 <filename>debian/files</filename> or <filename>debian/substvars</filename>
1558 files.  They should be removed by the <literal>clean</literal> target of
1559 <filename>debian/rules</filename>.
1560 </para>
1561 </listitem>
1562 <listitem>
1563 <para>
1564 Make sure you don't rely on locally installed or hacked configurations or
1565 programs.  For instance, you should never be calling programs in
1566 <filename>/usr/local/bin</filename> or the like.  Try not to rely on programs
1567 being setup in a special way.  Try building your package on another machine,
1568 even if it's the same architecture.
1569 </para>
1570 </listitem>
1571 <listitem>
1572 <para>
1573 Don't depend on the package you're building being installed already (a sub-case
1574 of the above issue). There are, of course, exceptions to this rule, but be
1575 aware that any case like this needs manual bootstrapping and cannot be done
1576 by automated package builders.
1577 </para>
1578 </listitem>
1579 <listitem>
1580 <para>
1581 Don't rely on the compiler being a certain version, if possible.  If not, then
1582 make sure your build dependencies reflect the restrictions, although you are
1583 probably asking for trouble, since different architectures sometimes
1584 standardize on different compilers.
1585 </para>
1586 </listitem>
1587 <listitem>
1588 <para>
1589 Make sure your debian/rules contains separate <literal>binary-arch</literal>
1590 and <literal>binary-indep</literal> targets, as the Debian Policy Manual 
1591 requires.  Make sure that both targets work independently, that is, that you
1592 can call the target without having called the other before.  To test this,
1593 try to run <command>dpkg-buildpackage -B</command>.
1594 </para>
1595 </listitem>
1596 </orderedlist>
1597 </section>
1598
1599 <section id="porter-guidelines">
1600 <title>Guidelines for porter uploads</title>
1601 <para>
1602 If the package builds out of the box for the architecture to be ported to, you
1603 are in luck and your job is easy.  This section applies to that case; it
1604 describes how to build and upload your binary package so that it is properly
1605 installed into the archive.  If you do have to patch the package in order to
1606 get it to compile for the other architecture, you are actually doing a source
1607 NMU, so consult <xref linkend="nmu-guidelines"/> instead.
1608 </para>
1609 <para>
1610 For a porter upload, no changes are being made to the source.  You do not need
1611 to touch any of the files in the source package.  This includes
1612 <filename>debian/changelog</filename>.
1613 </para>
1614 <para>
1615 The way to invoke <command>dpkg-buildpackage</command> is as
1616 <literal>dpkg-buildpackage -B
1617 -m<replaceable>porter-email</replaceable></literal>.  Of course, set
1618 <replaceable>porter-email</replaceable> to your email address.  This will do a
1619 binary-only build of only the architecture-dependent portions of the package,
1620 using the <literal>binary-arch</literal> target in <filename>debian/rules
1621 </filename>.
1622 </para>
1623 <para>
1624 If you are working on a Debian machine for your porting efforts and you need to
1625 sign your upload locally for its acceptance in the archive, you can run
1626 <command>debsign</command> on your <filename>.changes</filename> file to have
1627 it signed conveniently, or use the remote signing mode of
1628 <command>dpkg-sig</command>.
1629 </para>
1630 <section id="binary-only-nmu">
1631 <title>Recompilation or binary-only NMU</title>
1632 <para>
1633 Sometimes the initial porter upload is problematic because the environment in
1634 which the package was built was not good enough (outdated or obsolete library,
1635 bad compiler, ...).  Then you may just need to recompile it in an updated
1636 environment.  However, you have to bump the version number in this case, so
1637 that the old bad package can be replaced in the Debian archive
1638 (<command>dak</command> refuses to install new packages if they don't have a
1639 version number greater than the currently available one).
1640 </para>
1641 <para>
1642 You have to make sure that your binary-only NMU doesn't render the package
1643 uninstallable.  This could happen when a source package generates
1644 arch-dependent and arch-independent packages that have inter-dependencies
1645 generated using dpkg's substitution variable <literal>$(Source-Version)
1646 </literal>.
1647 </para>
1648 <para>
1649 Despite the required modification of the changelog, these are called
1650 binary-only NMUs — there is no need in this case to trigger all other
1651 architectures to consider themselves out of date or requiring recompilation.
1652 </para>
1653 <para>
1654 Such recompilations require special ``magic'' version numbering, so that the
1655 archive maintenance tools recognize that, even though there is a new Debian
1656 version, there is no corresponding source update.  If you get this wrong, the
1657 archive maintainers will reject your upload (due to lack of corresponding
1658 source code).
1659 </para>
1660 <para>
1661 The ``magic'' for a recompilation-only NMU is triggered by using a suffix
1662 appended to the package version number, following the form <literal>
1663 b<replaceable>number</replaceable></literal>.
1664 For instance, if the latest version you are recompiling against was version
1665 <literal>2.9-3</literal>, your binary-only NMU should carry a version of 
1666 <literal>2.9-3+b1</literal>.  If the latest version was <literal>3.4+b1
1667 </literal> (i.e, a native package with a previous recompilation NMU), your
1668 binary-only NMU should have a version number of <literal>3.4+b2</literal>.
1669 <footnote><para> In the past, such NMUs used the third-level number on the 
1670 Debian part of the revision to denote their recompilation-only status;
1671 however, this syntax was ambiguous with native packages and did not allow
1672 proper ordering of recompile-only NMUs, source NMUs, and security NMUs on
1673 the same package, and has therefore been abandoned in favor of this new syntax.
1674 </para> </footnote>
1675 </para>
1676 <para>
1677 Similar to initial porter uploads, the correct way of invoking
1678 <command>dpkg-buildpackage</command> is <literal>dpkg-buildpackage -B</literal>
1679 to only build the architecture-dependent parts of the package.
1680 </para>
1681 </section>
1682
1683 <section id="source-nmu-when-porter">
1684 <title>When to do a source NMU if you are a porter</title>
1685 <para>
1686 Porters doing a source NMU generally follow the guidelines found in <xref
1687 linkend="nmu"/> , just like non-porters.  However, it is expected that the wait
1688 cycle for a porter's source NMU is smaller than for a non-porter, since porters
1689 have to cope with a large quantity of packages.  Again, the situation varies
1690 depending on the distribution they are uploading to.  It also varies whether
1691 the architecture is a candidate for inclusion into the next stable release; the
1692 release managers decide and announce which architectures are candidates.
1693 </para>
1694 <para>
1695 If you are a porter doing an NMU for <literal>unstable</literal>, the above 
1696 guidelines for porting should be followed, with two variations.  Firstly, the
1697 acceptable waiting period — the time between when the bug is submitted to
1698 the BTS and when it is OK to do an NMU — is seven days for porters working
1699 on the <literal>unstable</literal> distribution.  This period can be shortened
1700 if the problem is critical and imposes hardship on the porting effort, at the
1701 discretion of the porter group.  (Remember, none of this is Policy, just
1702 mutually agreed upon guidelines.) For uploads to <literal>stable</literal> or
1703 <literal>testing </literal>, please coordinate with the appropriate release
1704 team first.
1705 </para>
1706 <para>
1707 Secondly, porters doing source NMUs should make sure that the bug they submit
1708 to the BTS should be of severity <literal>serious</literal> or greater.  This
1709 ensures that a single source package can be used to compile every supported 
1710 Debian architecture by release time.  It is very important that we have one
1711 version of the binary and source package for all architectures in order to
1712 comply with many licenses.
1713 </para>
1714 <para>
1715 Porters should try to avoid patches which simply kludge around bugs in the
1716 current version of the compile environment, kernel, or libc.  Sometimes such
1717 kludges can't be helped.  If you have to kludge around compiler bugs and the
1718 like, make sure you <literal>#ifdef</literal> your work properly; also,
1719 document your kludge so that people know to remove it once the external
1720 problems have been fixed.
1721 </para>
1722 <para>
1723 Porters may also have an unofficial location where they can put the results of
1724 their work during the waiting period.  This helps others running the port have
1725 the benefit of the porter's work, even during the waiting period.  Of course,
1726 such locations have no official blessing or status, so buyer beware.
1727 </para>
1728 </section>
1729
1730 </section>
1731
1732 <section id="porter-automation">
1733 <title>Porting infrastructure and automation</title>
1734 <para>
1735 There is infrastructure and several tools to help automate package porting.
1736 This section contains a brief overview of this automation and porting to these
1737 tools; see the package documentation or references for full information.
1738 </para>
1739 <section id="s5.10.3.1">
1740 <title>Mailing lists and web pages</title>
1741 <para>
1742 Web pages containing the status of each port can be found at <ulink
1743 url="&url-debian-ports;"></ulink>.
1744 </para>
1745 <para>
1746 Each port of Debian has a mailing list.  The list of porting mailing lists can
1747 be found at <ulink url="&url-debian-port-lists;"></ulink>.  These
1748 lists are used to coordinate porters, and to connect the users of a given port
1749 with the porters.
1750 </para>
1751 </section>
1752
1753 <section id="s5.10.3.2">
1754 <title>Porter tools</title>
1755 <para>
1756 Descriptions of several porting tools can be found in <xref
1757 linkend="tools-porting"/> .
1758 </para>
1759 </section>
1760
1761 <section id="wanna-build">
1762 <title><systemitem role="package">wanna-build</systemitem></title>
1763 <para>
1764 The <systemitem role="package">wanna-build</systemitem> system is used as a
1765 distributed, client-server build distribution system.  It is usually used in
1766 conjunction with build daemons running the <systemitem role="package">buildd
1767 </systemitem> program. <literal>Build daemons</literal> are ``slave'' hosts
1768 which contact the central <systemitem role="package"> wanna-build</systemitem>
1769 system to receive a list of packages that need to be built.
1770 </para>
1771 <para>
1772 <systemitem role="package">wanna-build</systemitem> is not yet available as a
1773 package; however, all Debian porting efforts are using it for automated
1774 package building.  The tool used to do the actual package builds, <systemitem
1775 role="package">sbuild</systemitem> is available as a package, see its 
1776 description in <xref linkend="sbuild"/> .  Please note that the packaged
1777 version is not the same as the one used on build daemons, but it is close
1778 enough to reproduce problems. 
1779 </para>
1780 <para>
1781 Most of the data produced by <systemitem role="package">wanna-build
1782 </systemitem> which is generally useful to porters is available on the
1783 web at <ulink url="&url-buildd;"></ulink>.  This data includes nightly
1784 updated statistics, queueing information and logs for build attempts.
1785 </para>
1786 <para>
1787 We are quite proud of this system, since it has so many possible uses.
1788 Independent development groups can use the system for different sub-flavors of
1789 Debian, which may or may not really be of general interest (for instance, a
1790 flavor of Debian built with <command>gcc</command> bounds checking).  It will
1791 also enable Debian to recompile entire distributions quickly.
1792 </para>
1793 <para>
1794 The wanna-build team, in charge of the buildds,
1795 can be reached at <literal>debian-wb-team@lists.debian.org</literal>.
1796 To determine who (wanna-build team, release team) and how (mail, BTS)
1797 to contact, refer to <ulink url="&url-wb-team;"></ulink>.
1798 </para>
1799
1800 <para>
1801 When requesting binNMUs or give-backs (retries after a failed build),
1802 please use the format described at <ulink url="&url-release-wb;"/>.
1803 </para>
1804
1805 </section>
1806
1807 </section>
1808
1809 <section id="packages-arch-specific">
1810 <title>When your package is <emphasis>not</emphasis> portable</title>
1811 <para>
1812 Some packages still have issues with building and/or working on some of the
1813 architectures supported by Debian, and cannot be ported at all, or not within a
1814 reasonable amount of time.  An example is a package that is SVGA-specific (only
1815 available for <literal>i386</literal> and <literal>amd64</literal>), or uses
1816 other hardware-specific features not supported on all architectures.
1817 </para>
1818 <para>
1819 In order to prevent broken packages from being uploaded to the archive, and
1820 wasting buildd time, you need to do a few things:
1821 </para>
1822 <itemizedlist>
1823 <listitem>
1824 <para>
1825 First, make sure your package <emphasis>does</emphasis> fail to build on
1826 architectures that it cannot support.  There are a few ways to achieve this.
1827 The preferred way is to have a small testsuite during build time that will test
1828 the functionality, and fail if it doesn't work.  This is a good idea anyway, as
1829 this will prevent (some) broken uploads on all architectures, and also will
1830 allow the package to build as soon as the required functionality is available.
1831 </para>
1832 <para>
1833 Additionally, if you believe the list of supported architectures is pretty
1834 constant, you should change <literal>any</literal> to a list of supported
1835 architectures in <filename>debian/control</filename>.  This way, the build will
1836 fail also, and indicate this to a human reader without actually trying.
1837 </para>
1838 </listitem>
1839 <listitem>
1840 <para>
1841 In order to prevent autobuilders from needlessly trying to build your package,
1842 it must be included in <filename>packages-arch-specific</filename>, a list used
1843 by the <command>wanna-build</command> script.  The current version is available
1844 as <ulink
1845 url="&url-cvsweb;srcdep/Packages-arch-specific?cvsroot=dak"></ulink>;
1846 please see the top of the file for whom to contact for changes.
1847 </para>
1848 </listitem>
1849 </itemizedlist>
1850 <para>
1851 Please note that it is insufficient to only add your package to
1852 Packages-arch-specific without making it fail to build on unsupported
1853 architectures: A porter or any other person trying to build your package might
1854 accidently upload it without noticing it doesn't work.  If in the past some
1855 binary packages were uploaded on unsupported architectures, request their
1856 removal by filing a bug against <systemitem
1857 role="package">ftp.debian.org</systemitem>
1858 </para>
1859 </section>
1860
1861 </section>
1862
1863 <section id="nmu">
1864 <title>Non-Maintainer Uploads (NMUs)</title>
1865 <para>
1866 Every package has one or more maintainers. Normally, these are the people who
1867 work on and upload new versions of the package. In some situations, it is
1868 useful that other developers can upload a new version as well, for example if
1869 they want to fix a bug in a package they don't maintain, when the maintainer
1870 needs help to respond to issues.  Such uploads are called
1871 <emphasis>Non-Maintainer Uploads (NMU)</emphasis>.
1872 </para>
1873
1874 <section id="nmu-guidelines">
1875 <title>When and how to do an NMU</title>
1876
1877 <para>
1878 Before doing an NMU, consider the following questions:
1879 </para>
1880 <itemizedlist>
1881 <listitem>
1882 <para>
1883 Does your NMU really fix bugs? Fixing cosmetic issues or changing the
1884 packaging style in NMUs is discouraged.
1885 </para>
1886 </listitem>
1887 <listitem>
1888 <para>
1889 Did you give enough time to the maintainer? When was the bug reported to the
1890 BTS? Being busy for a week or two isn't unusual.  Is the bug so severe that it
1891 needs to be fixed right now, or can it wait a few more days?
1892 </para>
1893 </listitem>
1894 <listitem>
1895 <para>
1896 How confident are you about your changes? Please remember the Hippocratic Oath:
1897 "Above all, do no harm." It is better to leave a package with an open grave bug
1898 than applying a non-functional patch, or one that hides the bug instead of
1899 resolving it. If you are not 100% sure of what you did, it might be a good idea
1900 to seek advice from others. Remember that if you break something in your NMU,
1901 many people will be very unhappy about it.
1902 </para>
1903 </listitem>
1904 <listitem>
1905 <para>
1906 Have you clearly expressed your intention to NMU, at least in the BTS?
1907 It is also a good idea to try to contact the
1908 maintainer by other means (private email, IRC).
1909 </para>
1910 </listitem>
1911 <listitem>
1912 <para>
1913 If the maintainer is usually active and responsive, have you tried to contact
1914 him? In general it should be considered preferable that a maintainer takes care
1915 of an issue himself and that he is given the chance to review and correct your
1916 patch, because he can be expected to be more aware of potential issues which an
1917 NMUer might miss. It is often a better use of everyone's time if the maintainer
1918 is given an opportunity to upload a fix on their own.
1919 </para>
1920 </listitem>
1921 </itemizedlist>
1922 <para>
1923 When doing an NMU, you must first make sure that your intention to NMU is
1924 clear.  Then, you must send a patch with the differences between the
1925 current package and your proposed NMU to the BTS. The
1926 <literal>nmudiff</literal> script in the <literal>devscripts</literal> package
1927 might be helpful.
1928 </para>
1929 <para>
1930 While preparing the patch, you should better be aware of any package-specific
1931 practices that the maintainer might be using. Taking them into account reduces
1932 the burden of getting your changes integrated back in the normal package
1933 workflow and thus increases the possibilities that that will happen. A good
1934 place where to look for for possible package-specific practices is
1935 <ulink url="&url-debian-policy;ch-source.html#s-readmesource"><literal>debian/README.source</literal></ulink>.
1936 </para>
1937 <para>
1938 Unless you have an excellent reason not to do so, you must then give some time
1939 to the maintainer to react (for example, by uploading to the
1940 <literal>DELAYED</literal> queue).  Here are some recommended values to use for delays:
1941 </para>
1942 <itemizedlist>
1943 <listitem>
1944 <para>
1945 Upload fixing only release-critical bugs older than 7 days: 2 days
1946 </para>
1947 </listitem>
1948 <listitem>
1949 <para>
1950 Upload fixing only release-critical and important bugs: 5 days
1951 </para>
1952 </listitem>
1953 <listitem>
1954 <para>
1955 Other NMUs: 10 days
1956 </para>
1957 </listitem>
1958 </itemizedlist>
1959
1960 <para>
1961 Those delays are only examples. In some cases, such as uploads fixing security
1962 issues, or fixes for trivial bugs that blocking a transition, it is desirable
1963 that the fixed package reaches <literal>unstable</literal> sooner.
1964 </para>
1965
1966 <para>
1967 Sometimes, release managers decide to allow NMUs with shorter delays for a
1968 subset of bugs (e.g release-critical bugs older than 7 days). Also, some
1969 maintainers list themselves in the <ulink url="&url-low-threshold-nmu;">Low
1970 Threshold NMU list</ulink>, and accept that NMUs are uploaded without delay. But
1971 even in those cases, it's still a good idea to give the maintainer a few days
1972 to react before you upload, especially if the patch wasn't available in the BTS
1973 before, or if you know that the maintainer is generally active.
1974 </para>
1975
1976 <para>
1977 After you upload an NMU, you are responsible for the possible problems that you
1978 might have introduced. You must keep an eye on the package (subscribing to the
1979 package on the PTS is a good way to achieve this).
1980 </para>
1981
1982 <para>
1983 This is not a license to perform NMUs thoughtlessly.  If you NMU when it is
1984 clear that the maintainers are active and would have acknowledged a patch in a
1985 timely manner, or if you ignore the recommendations of this document, your
1986 upload might be a cause of conflict with the maintainer.
1987 You should always be prepared to
1988 defend the wisdom of any NMU you perform on its own merits.
1989 </para>
1990 </section>
1991
1992 <section id="nmu-changelog">
1993 <title>NMUs and debian/changelog</title>
1994 <para>
1995 Just like any other (source) upload, NMUs must add an entry to
1996 <literal>debian/changelog</literal>, telling what has changed with this
1997 upload.  The first line of this entry must explicitely mention that this upload is an NMU, e.g.:
1998 </para>
1999 <screen>
2000   * Non-maintainer upload.
2001 </screen>
2002
2003 <para>
2004 The way to version NMUs differs for native and non-native packages.
2005 </para>
2006 <para>
2007 If the package is a native package (without a debian revision in the version number), 
2008 the version must be the version of the last maintainer upload, plus
2009 <literal>+nmu<replaceable>X</replaceable></literal>, where
2010 <replaceable>X</replaceable> is a counter starting at <literal>1</literal>.
2011 If
2012 the last upload was also an NMU, the counter should be increased.  For example,
2013 if the current version is <literal>1.5</literal>, then an NMU would get
2014 version <literal>1.5+nmu1</literal>.
2015 </para>
2016 <para>
2017 If the package is a not a native package, you should add a minor version number
2018 to the debian revision part of the version number (the portion after the last
2019 hyphen). This extra number must start at 1.  For example,
2020 if the current version is <literal>1.5-2</literal>, then an NMU would get
2021 version <literal>1.5-2.1</literal>. If a new upstream version
2022 is packaged in the NMU, the debian revision is set to <literal>0</literal>, for
2023 example <literal>1.6-0.1</literal>.
2024 </para>
2025 <para>
2026 In both cases, if the last upload was also an NMU, the counter should
2027 be increased. For example, if the current version is
2028 <literal>1.5+nmu3</literal> (a native package which has already been
2029 NMUed), the NMU would get version <literal>1.5+nmu4</literal>.  .
2030 </para>
2031 <para>
2032 A special versioning scheme is needed to avoid disrupting the maintainer's
2033 work, since using an integer for the Debian revision will potentially
2034 conflict with a maintainer upload already in preparation at the time of an
2035 NMU, or even one sitting in the ftp NEW queue.
2036 It also has the
2037 benefit of making it visually clear that a package in the archive was not made
2038 by the official maintainer.
2039 </para>
2040
2041 <para>
2042 If you upload a package to testing or stable, you sometimes need to "fork" the
2043 version number tree. This is the case for security uploads, for example.  For
2044 this, a version of the form
2045 <literal>+deb<replaceable>XY</replaceable>u<replaceable>Z</replaceable></literal>
2046 should be used, where <replaceable>X</replaceable> and
2047 <replaceable>Y</replaceable> are the major and minor release numbers, and
2048 <replaceable>Z</replaceable> is a counter starting at <literal>1</literal>.
2049 When the release number is not yet known (often the case for
2050 <literal>testing</literal>, at the beginning of release cycles), the lowest
2051 release number higher than the last stable release number must be used.  For
2052 example, while Etch (Debian 4.0) is stable, a security NMU to stable for a
2053 package at version <literal>1.5-3</literal> would have version
2054 <literal>1.5-3+deb40u1</literal>, whereas a security NMU to Lenny would get
2055 version <literal>1.5-3+deb50u1</literal>. After the release of Lenny, security
2056 uploads to the <literal>testing</literal> distribution will be versioned
2057 <literal>+deb51uZ</literal>, until it is known whether that release will be
2058 Debian 5.1 or Debian 6.0 (if that becomes the case, uploads will be versioned
2059 as <literal>+deb60uZ</literal>.
2060 </para>
2061 </section>
2062
2063 <section id="nmu-delayed">
2064 <title>Using the <literal>DELAYED/</literal> queue</title>
2065
2066 <para>
2067 Having to wait for a response after you request permission to NMU is
2068 inefficient, because it costs the NMUer a context switch to come back to the
2069 issue.
2070 The <literal>DELAYED</literal> queue (see <xref linkend="delayed-incoming"/>)
2071 allows the developer doing the NMU to perform all the necessary tasks at the
2072 same time. For instance, instead of telling the maintainer that you will
2073 upload the updated
2074 package in 7 days, you should upload the package to
2075 <literal>DELAYED/7</literal> and tell the maintainer that he has 7 days to
2076 react.  During this time, the maintainer can ask you to delay the upload some
2077 more, or cancel your upload.
2078 </para>
2079
2080 <para>
2081 The <literal>DELAYED</literal> queue should not be used to put additional
2082 pressure on the maintainer. In particular, it's important that you are
2083 available to cancel or delay the upload before the delay expires since the
2084 maintainer cannot cancel the upload himself.
2085 </para>
2086
2087 <para>
2088 If you make an NMU to <literal>DELAYED</literal> and the maintainer updates
2089 his package before the delay expires, your upload will be rejected because a
2090 newer version is already available in the archive.
2091 Ideally, the maintainer will take care to include your proposed changes (or
2092 at least a solution for the problems they address) in that upload.
2093 </para>
2094
2095 </section>
2096
2097 <section id="nmu-maintainer">
2098 <title>NMUs from the maintainer's point of view</title>
2099
2100 <para>
2101 When someone NMUs your package, this means they want to help you to keep it in
2102 good shape.  This gives users fixed packages faster.  You
2103 can consider asking the NMUer to become a co-maintainer of the package.
2104 Receiving an NMU on a package is not a bad
2105 thing; it just means that the package is interesting enough for other people to
2106 work on it.
2107 </para>
2108
2109 <para>
2110 To acknowledge an NMU, include its changes and changelog entry in your next
2111 maintainer upload.  If you do not acknowledge the NMU by including the
2112 NMU changelog entry in your changelog, the bugs will remain closed in the
2113 BTS but will be listed as affecting your maintainer version of the package.
2114 </para>
2115
2116 </section>
2117
2118 <section id="nmu-binnmu">
2119 <title>Source NMUs vs Binary-only NMUs (binNMUs)</title>
2120
2121 <para>
2122 The full name of an NMU is <emphasis>source NMU</emphasis>.  There is also
2123 another type, namely the <emphasis>binary-only NMU</emphasis>, or
2124 <emphasis>binNMU</emphasis>.  A binNMU is also a package upload by someone
2125 other than the package's maintainer.  However, it is a binary-only upload.
2126 </para>
2127
2128 <para>
2129 When a library (or other dependency) is updated, the packages using it may need
2130 to be rebuilt.  Since no changes to the source are needed, the same source
2131 package is used.
2132 </para>
2133
2134 <para>
2135 BinNMUs are usually triggered on the buildds by wanna-build.
2136 An entry is added to debian/changelog,
2137 explaining why the upload was needed and increasing the version number as
2138 described in <xref linkend="binary-only-nmu"/>.
2139 This entry should not be included in the next upload.
2140 </para>
2141
2142 <para>
2143 Buildds upload packages for their architecture to the archive as binary-only
2144 uploads.  Strictly speaking, these are binNMUs.  However, they are not normally
2145 called NMU, and they don't add an entry to debian/changelog.
2146 </para>
2147
2148 </section>
2149
2150 <section id="nmu-qa-upload">
2151 <title>NMUs vs QA uploads</title>
2152
2153 <para>
2154 NMUs are uploads of packages by somebody else than their assigned maintainer.
2155 There is
2156 another type of upload where the uploaded package is not yours: QA uploads. QA
2157 uploads are uploads of orphaned packages.
2158 </para>
2159
2160 <para>
2161 QA uploads are very much like normal maintainer uploads: they may fix anything,
2162 even minor issues; the version numbering is normal, and there is no need to use
2163 a delayed upload.  The difference is that you are not listed as the Maintainer
2164 or Uploader for the package.  Also, the changelog entry of a QA upload has a
2165 special first line:
2166 </para>
2167
2168 <screen>
2169  * QA upload.
2170 </screen>
2171
2172 <para>
2173 If you want to do an NMU, and it seems that the maintainer is not active, it is
2174 wise to check if the package is orphaned
2175 (this information is displayed on the package's Package Tracking System page).
2176 When doing the first QA upload to an
2177 orphaned package, the maintainer should be set to <literal>Debian QA Group
2178 &lt;packages@qa.debian.org&gt;</literal>.  Orphaned packages which did
2179 not yet have a QA upload still have their old maintainer set.  There is a list
2180 of them at <ulink url="&url-orphaned-not-qa;"/>.
2181 </para>
2182
2183 <para>
2184 Instead of doing a QA upload, you can also consider adopting the package by
2185 making yourself the maintainer.  You don't need permission from anybody to
2186 adopt an orphaned package, you can just set yourself as maintainer and upload
2187 the new version (see <xref linkend="adopting"/>).
2188 </para>
2189
2190 </section>
2191
2192 </section>
2193
2194 <section id="collaborative-maint">
2195 <title>Collaborative maintenance</title>
2196 <para>
2197 Collaborative maintenance is a term describing the sharing of Debian package
2198 maintenance duties by several people.  This collaboration is almost always a
2199 good idea, since it generally results in higher quality and faster bug fix
2200 turnaround times.  It is strongly recommended that packages with a priority of
2201 <literal>Standard</literal> or which are part of the base set have
2202 co-maintainers.
2203 </para>
2204 <para>
2205 Generally there is a primary maintainer and one or more co-maintainers.  The
2206 primary maintainer is the person whose name is listed in the
2207 <literal>Maintainer</literal> field of the <filename>debian/control</filename>
2208 file.  Co-maintainers are all the other maintainers,
2209 usually listed in the <literal>Uploaders</literal> field of the
2210 <filename>debian/control</filename> file.
2211 </para>
2212 <para>
2213 In its most basic form, the process of adding a new co-maintainer is quite
2214 easy:
2215 </para>
2216 <itemizedlist>
2217 <listitem>
2218 <para>
2219 Setup the co-maintainer with access to the sources you build the package from.
2220 Generally this implies you are using a network-capable version control system,
2221 such as <command>CVS</command> or <command>Subversion</command>.  Alioth (see
2222 <xref linkend="alioth"/> ) provides such tools, amongst others.
2223 </para>
2224 </listitem>
2225 <listitem>
2226 <para>
2227 Add the co-maintainer's correct maintainer name and address to the
2228 <literal>Uploaders</literal> field in the first paragraph of the
2229 <filename>debian/control</filename> file.
2230 </para>
2231 <screen>
2232 Uploaders: John Buzz &lt;jbuzz@debian.org&gt;, Adam Rex &lt;arex@debian.org&gt;
2233 </screen>
2234 </listitem>
2235 <listitem>
2236 <para>
2237 Using the PTS (<xref linkend="pkg-tracking-system"/> ), the co-maintainers
2238 should subscribe themselves to the appropriate source package.
2239 </para>
2240 </listitem>
2241 </itemizedlist>
2242 <para>
2243 Another form of collaborative maintenance is team maintenance, which is
2244 recommended if you maintain several packages with the same group of developers.
2245 In that case, the Maintainer and Uploaders field of each package must be
2246 managed with care.  It is recommended to choose between one of the two
2247 following schemes:
2248 </para>
2249 <orderedlist numeration="arabic">
2250 <listitem>
2251 <para>
2252 Put the team member mainly responsible for the package in the Maintainer field.
2253 In the Uploaders, put the mailing list address, and the team members who care
2254 for the package.
2255 </para>
2256 </listitem>
2257 <listitem>
2258 <para>
2259 Put the mailing list address in the Maintainer field.  In the Uploaders field,
2260 put the team members who care for the package.  In this case, you must make
2261 sure the mailing list accept bug reports without any human interaction (like
2262 moderation for non-subscribers).
2263 </para>
2264 </listitem>
2265 </orderedlist>
2266 <para>
2267 In any case, it is a bad idea to automatically put all team members in the
2268 Uploaders field.  It clutters the Developer's Package Overview listing (see
2269 <xref linkend="ddpo"/> ) with packages one doesn't really care for, and creates
2270 a false sense of good maintenance.
2271 </para>
2272 </section>
2273
2274 <section id="testing">
2275 <title>The testing distribution</title>
2276 <section id="testing-basics">
2277 <title>Basics</title>
2278 <para>
2279 Packages are usually installed into the <literal>testing</literal> distribution
2280 after they have undergone some degree of <literal>testing</literal> in
2281 <literal>unstable</literal>.
2282 </para>
2283 <para>
2284 They must be in sync on all architectures and mustn't have dependencies that
2285 make them uninstallable; they also have to have generally no known
2286 release-critical bugs at the time they're installed into <literal>testing
2287 </literal>.  This way, <literal>testing</literal> should always be close to
2288 being a release candidate.  Please see below for details.
2289 </para>
2290 </section>
2291
2292 <section id="testing-unstable">
2293 <title>Updates from unstable</title>
2294 <para>
2295 The scripts that update the <literal>testing</literal> distribution are run
2296 twice each day, right after the installation of the updated packages; these
2297 scripts are called <literal>britney</literal>.  They generate the
2298 <filename>Packages</filename> files for the <literal>testing</literal>
2299 distribution, but they do so in an intelligent manner; they try to avoid any
2300 inconsistency and to use only non-buggy packages.
2301 </para>
2302 <para>
2303 The inclusion of a package from <literal>unstable</literal> is conditional on
2304 the following:
2305 </para>
2306 <itemizedlist>
2307 <listitem>
2308 <para>
2309 The package must have been available in <literal>unstable</literal> for 2, 5
2310 or 10 days, depending on the urgency (high, medium or low).  Please note that
2311 the urgency is sticky, meaning that the highest urgency uploaded since the
2312 previous <literal>testing</literal> transition is taken into account.  Those
2313 delays may be doubled during a freeze, or <literal>testing</literal> 
2314 transitions may be switched off altogether;
2315 </para>
2316 </listitem>
2317 <listitem>
2318 <para>
2319 It must not have new release-critical bugs (RC bugs affecting the version
2320 available in <literal>unstable</literal>, but not affecting the version in 
2321 <literal>testing</literal>);
2322 </para>
2323 </listitem>
2324 <listitem>
2325 <para>
2326 It must be available on all architectures on which it has previously been built
2327 in <literal>unstable</literal>.  <xref linkend="dak-ls"/> may be of interest
2328 to check that information;
2329 </para>
2330 </listitem>
2331 <listitem>
2332 <para>
2333 It must not break any dependency of a package which is already available in
2334 <literal>testing</literal>;
2335 </para>
2336 </listitem>
2337 <listitem>
2338 <para>
2339 The packages on which it depends must either be available in
2340 <literal>testing</literal> or they must be accepted into
2341 <literal>testing</literal> at the same time (and they will be if they fulfill
2342 all the necessary criteria);
2343 </para>
2344 </listitem>
2345 </itemizedlist>
2346 <para>
2347 To find out whether a package is progressing into <literal>testing</literal>
2348 or not, see the <literal>testing</literal> script output on the <ulink
2349 url="&url-testing-maint;">web page of the testing
2350 distribution</ulink>, or use the program <command>grep-excuses</command> which
2351 is in the <systemitem role="package">devscripts</systemitem> package.  This
2352 utility can easily be used in a <citerefentry>
2353 <refentrytitle>crontab</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>
2354 to keep yourself informed of the progression of your packages into
2355 <literal>testing</literal>.
2356 </para>
2357 <para>
2358 The <filename>update_excuses</filename> file does not always give the precise
2359 reason why the package is refused; you may have to find it on your own by
2360 looking for what would break with the inclusion of the package.  The <ulink
2361 url="&url-testing-maint;">testing web page</ulink> gives some
2362 more information about the usual problems which may be causing such troubles.
2363 </para>
2364 <para>
2365 Sometimes, some packages never enter <literal>testing</literal> because the
2366 set of inter-relationship is too complicated and cannot be sorted out by the
2367 scripts.  See below for details.
2368 </para>
2369 <para>
2370 Some further dependency analysis is shown on <ulink
2371 url="http://release.debian.org/migration/"></ulink> — but be warned, this page also
2372 shows build dependencies which are not considered by britney.
2373 </para>
2374 <section id="outdated">
2375 <title>out-of-date</title>
2376 <para>
2377 <!-- FIXME: better rename this file than document rampant professionalism? -->
2378 For the <literal>testing</literal> migration script, outdated means: There are
2379 different versions in <literal>unstable</literal> for the release architectures
2380 (except for the architectures in fuckedarches; fuckedarches is a list of
2381 architectures that don't keep up (in <filename>update_out.py</filename>), but
2382 currently, it's empty).  outdated has nothing whatsoever to do with the 
2383 architectures this package has in <literal>testing</literal>.
2384 </para>
2385 <para>
2386 Consider this example:
2387 </para>
2388 <informaltable pgwide="1">
2389 <tgroup cols="3">
2390 <thead>
2391 <row>
2392 <entry></entry>
2393 <entry>alpha</entry>
2394 <entry>arm</entry>
2395 </row>
2396 </thead>
2397 <tbody>
2398 <row>
2399 <entry>testing</entry>
2400 <entry>1</entry>
2401 <entry>-</entry>
2402 </row>
2403 <row>
2404 <entry>unstable</entry>
2405 <entry>1</entry>
2406 <entry>2</entry>
2407 </row>
2408 </tbody>
2409 </tgroup>
2410 </informaltable>
2411 <para>
2412 The package is out of date on alpha in <literal>unstable</literal>, and will
2413 not go to <literal>testing</literal>. Removing the package would not help at all, the
2414 package is still out of date on <literal>alpha</literal>, and will not 
2415 propagate to testing.
2416 </para>
2417 <para>
2418 However, if ftp-master removes a package in <literal>unstable</literal> (here
2419 on <literal>arm</literal>):
2420 </para>
2421 <informaltable pgwide="1">
2422 <tgroup cols="4">
2423 <thead>
2424 <row>
2425 <entry></entry>
2426 <entry>alpha</entry>
2427 <entry>arm</entry>
2428 <entry>hurd-i386</entry>
2429 </row>
2430 </thead>
2431 <tbody>
2432 <row>
2433 <entry>testing</entry>
2434 <entry>1</entry>
2435 <entry>1</entry>
2436 <entry>-</entry>
2437 </row>
2438 <row>
2439 <entry>unstable</entry>
2440 <entry>2</entry>
2441 <entry>-</entry>
2442 <entry>1</entry>
2443 </row>
2444 </tbody>
2445 </tgroup>
2446 </informaltable>
2447 <para>
2448 In this case, the package is up to date on all release architectures in
2449 <literal>unstable</literal> (and the extra <literal>hurd-i386</literal> 
2450 doesn't matter, as it's not a release architecture).
2451 </para>
2452 <para>
2453 Sometimes, the question is raised if it is possible to allow packages in that
2454 are not yet built on all architectures: No.  Just plainly no.  (Except if you
2455 maintain glibc or so.)
2456 </para>
2457 </section>
2458
2459 <section id="removals">
2460 <title>Removals from testing</title>
2461 <para>
2462 Sometimes, a package is removed to allow another package in: This happens only
2463 to allow <emphasis>another</emphasis> package to go in if it's ready in every
2464 other sense.  Suppose e.g.  that <literal>a</literal> cannot be installed
2465 with the new version of <literal>b</literal>; then <literal>a</literal> may
2466 be removed to allow <literal>b</literal> in.
2467 </para>
2468 <para>
2469 Of course, there is another reason to remove a package from <literal>testing
2470 </literal>: It's just too buggy (and having a single RC-bug is enough to be
2471 in this state).
2472 </para>
2473 <para>
2474 Furthermore, if a package has been removed from <literal>unstable</literal>,
2475 and no package in <literal>testing</literal> depends on it any more, then it
2476 will automatically be removed.
2477 </para>
2478 </section>
2479
2480 <section id="circular">
2481 <title>circular dependencies</title>
2482 <para>
2483 A situation which is not handled very well by britney is if package
2484 <literal>a</literal> depends on the new version of package
2485 <literal>b</literal>, and vice versa.
2486 </para>
2487 <para>
2488 An example of this is:
2489 </para>
2490 <informaltable pgwide="1">
2491 <tgroup cols="3">
2492 <thead>
2493 <row>
2494 <entry></entry>
2495 <entry>testing</entry>
2496 <entry>unstable</entry>
2497 </row>
2498 </thead>
2499 <tbody>
2500 <row>
2501 <entry>a</entry>
2502 <entry>1; depends: b=1</entry>
2503 <entry>2; depends: b=2</entry>
2504 </row>
2505 <row>
2506 <entry>b</entry>
2507 <entry>1; depends: a=1</entry>
2508 <entry>2; depends: a=2</entry>
2509 </row>
2510 </tbody>
2511 </tgroup>
2512 </informaltable>
2513 <para>
2514 Neither package <literal>a</literal> nor package <literal>b</literal> is
2515 considered for update.
2516 </para>
2517 <para>
2518 Currently, this requires some manual hinting from the release team.  Please
2519 contact them by sending mail to &email-debian-release; if this
2520 happens to one of your packages.
2521 </para>
2522 </section>
2523
2524 <section id="s5.13.2.4">
2525 <title>influence of package in testing</title>
2526 <para>
2527 Generally, there is nothing that the status of a package in <literal>testing
2528 </literal> means for transition of the next version from <literal>unstable
2529 </literal> to <literal>testing</literal>, with two exceptions:
2530 If the RC-bugginess of the package goes down, it may go in even if it is still
2531 RC-buggy.  The second exception is if the version of the package in <literal>
2532 testing</literal> is out of sync on the different arches: Then any arch might
2533 just upgrade to the version of the source package; however, this can happen
2534 only if the package was previously forced through, the arch is in fuckedarches,
2535 or there was no binary package of that arch present in <literal>unstable
2536 </literal> at all during the <literal>testing</literal> migration.
2537 </para>
2538 <para>
2539 In summary this means: The only influence that a package being in <literal>
2540 testing</literal> has on a new version of the same package is that the new
2541 version might go in easier.
2542 </para>
2543 </section>
2544
2545 <section id="details">
2546 <title>details</title>
2547 <para>
2548 If you are interested in details, this is how britney works:
2549 </para>
2550 <para>
2551 The packages are looked at to determine whether they are valid candidates.
2552 This gives the update excuses.  The most common reasons why a package is not
2553 considered are too young, RC-bugginess, and out of date on some arches.  For
2554 this part of britney, the release managers have hammers of various sizes to
2555 force britney to consider a package.  (Also, the base freeze is coded in that
2556 part of britney.) (There is a similar thing for binary-only updates, but this
2557 is not described here.  If you're interested in that, please peruse the code.)
2558 </para>
2559 <para>
2560 Now, the more complex part happens: Britney tries to update <literal>testing
2561 </literal> with the valid candidates. For that, britney tries to add each
2562 valid candidate to the testing distribution. If the number of uninstallable
2563 packages in <literal>testing</literal> doesn't increase, the package is
2564 accepted. From that point on, the accepted package is considered to be part
2565 of <literal>testing</literal>, such that all subsequent installability
2566 tests include this package.  Hints from the release team are processed
2567 before or after this main run, depending on the exact type.
2568 </para>
2569 <para>
2570 If you want to see more details, you can look it up on
2571 <filename>merkel:/org/&ftp-debian-org;/testing/update_out/</filename> (or
2572 in <filename>merkel:~aba/testing/update_out</filename> to see a setup with
2573 a smaller packages file).  Via web, it's at <ulink
2574 url="http://&ftp-master-host;/testing/update_out_code/"></ulink>
2575 </para>
2576 <para>
2577 The hints are available via <ulink
2578 url="http://&ftp-master-host;/testing/hints/"></ulink>.
2579 </para>
2580 </section>
2581
2582 </section>
2583
2584 <section id="t-p-u">
2585 <title>Direct updates to testing</title>
2586 <para>
2587 The <literal>testing</literal> distribution is fed with packages from 
2588 <literal>unstable</literal> according to the rules explained above.  However,
2589 in some cases, it is necessary to upload packages built only for <literal>
2590 testing</literal>.  For that, you may want to upload to <literal>
2591 testing-proposed-updates</literal>.
2592 </para>
2593 <para>
2594 Keep in mind that packages uploaded there are not automatically processed, they
2595 have to go through the hands of the release manager.  So you'd better have a
2596 good reason to upload there.  In order to know what a good reason is in the
2597 release managers' eyes, you should read the instructions that they regularly
2598 give on &email-debian-devel-announce;.
2599 </para>
2600 <para>
2601 You should not upload to <literal>testing-proposed-updates</literal> when you
2602 can update your packages through <literal>unstable</literal>.  If you can't
2603 (for example because you have a newer development version in <literal>unstable
2604 </literal>), you may use this facility, but it is recommended that you ask for
2605 authorization from the release manager first.  Even if a package is frozen,
2606 updates through <literal>unstable</literal> are possible, if the upload via
2607 <literal>unstable</literal> does not pull in any new dependencies.
2608 </para>
2609 <para>
2610 Version numbers are usually selected by adding the codename of the 
2611 <literal>testing</literal> distribution and a running number, like 
2612 <literal>1.2sarge1</literal> for the first upload through
2613 <literal>testing-proposed-updates</literal> of package version 
2614 <literal>1.2</literal>.
2615 </para>
2616 <para>
2617 Please make sure you didn't miss any of these items in your upload:
2618 </para>
2619 <itemizedlist>
2620 <listitem>
2621 <para>
2622 Make sure that your package really needs to go through
2623 <literal>testing-proposed-updates</literal>, and can't go through <literal>
2624 unstable</literal>;
2625 </para>
2626 </listitem>
2627 <listitem>
2628 <para>
2629 Make sure that you included only the minimal amount of changes;
2630 </para>
2631 </listitem>
2632 <listitem>
2633 <para>
2634 Make sure that you included an appropriate explanation in the changelog;
2635 </para>
2636 </listitem>
2637 <listitem>
2638 <para>
2639 Make sure that you've written <literal>testing</literal> or
2640 <literal>testing-proposed-updates</literal> into your target distribution;
2641 </para>
2642 </listitem>
2643 <listitem>
2644 <para>
2645 Make sure that you've built and tested your package in
2646 <literal>testing</literal>, not in <literal>unstable</literal>;
2647 </para>
2648 </listitem>
2649 <listitem>
2650 <para>
2651 Make sure that your version number is higher than the version in
2652 <literal>testing</literal> and <literal>testing-proposed-updates</literal>,
2653 and lower than in <literal>unstable</literal>;
2654 </para>
2655 </listitem>
2656 <listitem>
2657 <para>
2658 After uploading and successful build on all platforms, contact the release team
2659 at &email-debian-release; and ask them to approve your upload.
2660 </para>
2661 </listitem>
2662 </itemizedlist>
2663 </section>
2664
2665 <section id="faq">
2666 <title>Frequently asked questions</title>
2667 <section id="rc">
2668 <title>What are release-critical bugs, and how do they get counted?</title>
2669 <para>
2670 All bugs of some higher severities are by default considered release-critical;
2671 currently, these are <literal>critical</literal>, <literal>grave</literal> and
2672 <literal>serious</literal> bugs.
2673 </para>
2674 <para>
2675 Such bugs are presumed to have an impact on the chances that the package will
2676 be released with the <literal>stable</literal> release of Debian: in general,
2677 if a package has open release-critical bugs filed on it, it won't get into 
2678 <literal>testing</literal>, and consequently won't be released in <literal>
2679 stable</literal>.
2680 </para>
2681 <para>
2682 The <literal>unstable</literal> bug count are all release-critical bugs which
2683 are marked to apply to <replaceable>package</replaceable>/<replaceable>version
2684 </replaceable> combinations that are available in unstable for a release
2685 architecture. The <literal>testing</literal> bug count is defined analogously.
2686 </para>
2687 </section>
2688
2689 <section id="s5.13.4.2">
2690 <title>How could installing a package into <literal>testing</literal> possibly
2691 break other packages?</title>
2692 <para>
2693 The structure of the distribution archives is such that they can only contain
2694 one version of a package; a package is defined by its name.  So when the source
2695 package <literal>acmefoo</literal> is installed into <literal>testing</literal>,
2696 along with its binary packages <literal>acme-foo-bin</literal>, <literal>
2697 acme-bar-bin</literal>, <literal>libacme-foo1</literal> and <literal>
2698 libacme-foo-dev</literal>, the old version is removed.
2699 </para>
2700 <para>
2701 However, the old version may have provided a binary package with an old soname
2702 of a library, such as <literal>libacme-foo0</literal>.  Removing the old 
2703 <literal>acmefoo</literal> will remove <literal>libacme-foo0</literal>, which
2704 will break any packages which depend on it.
2705 </para>
2706 <para>
2707 Evidently, this mainly affects packages which provide changing sets of binary
2708 packages in different versions (in turn, mainly libraries).  However, it will
2709 also affect packages upon which versioned dependencies have been declared of
2710 the ==, &lt;=, or &lt;&lt; varieties.
2711 </para>
2712 <para>
2713 When the set of binary packages provided by a source package change in this
2714 way, all the packages that depended on the old binaries will have to be updated
2715 to depend on the new binaries instead.  Because installing such a source
2716 package into <literal>testing</literal> breaks all the packages that depended on
2717 it in <literal>testing</literal>,
2718 some care has to be taken now: all the depending packages must be updated and
2719 ready to be installed themselves so that they won't be broken, and, once
2720 everything is ready, manual intervention by the release manager or an assistant
2721 is normally required.
2722 </para>
2723 <para>
2724 If you are having problems with complicated groups of packages like this,
2725 contact &email-debian-devel; or &email-debian-release; for help.
2726 </para>
2727 </section>
2728
2729 </section>
2730
2731 </section>
2732
2733 </chapter>
2734