/[ddp]/manuals/trunk/maint-guide/maint-guide.en.dbk
ViewVC logotype

Diff of /manuals/trunk/maint-guide/maint-guide.en.dbk

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 8719 by osamu, Sun Apr 24 13:31:28 2011 UTC revision 8760 by osamu, Sat Apr 30 05:47:41 2011 UTC
# Line 105  takes many hours.  Make no mistake, for Line 105  takes many hours.  Make no mistake, for
105  need to be both technically competent and diligent.  need to be both technically competent and diligent.
106  </para>  </para>
107  <para>  <para>
 This document will explain every little (at first maybe irrelevant) step, and  
 help you create that first package, and to gain some experience in building  
 the next releases of that and maybe other packages later on.  
 </para>  
 <para>  
108  If you need some help on packaging, please read <xref linkend="helpme"/>.  If you need some help on packaging, please read <xref linkend="helpme"/>.
109  </para>  </para>
110  <para>  <para>
# Line 120  The translations may be available in pac Line 115  The translations may be available in pac
115  <systemitem role="package">maint-guide-es</systemitem>.  <systemitem role="package">maint-guide-es</systemitem>.
116  Please note that this documentation may be slightly outdated.  Please note that this documentation may be slightly outdated.
117  </para>  </para>
118  <section id="socialdynamism"><title>Social dynamics of Debian</title>  <para>
119    Since this is a tutorial, I choose to explain each detailed step for some
120    important topics.  Some of them may look irrelevant to you.  Please be patient.
121    I have also intentionally skipped some corner cases and provided only pointers
122    to keep this document simple.
123    </para>
124    <section id="socialdynamics"><title>Social dynamics of Debian</title>
125  <para>  <para>
126  Here are some observations of Debian's social dynamics, presented in the hope  Here are some observations of Debian's social dynamics, presented in the hope
127  that it will prepare you for interactions with Debian.  that it will prepare you for interactions with Debian.
# Line 219  please refer to the following to learn h Line 220  please refer to the following to learn h
220  <itemizedlist>  <itemizedlist>
221  <listitem><para><ulink url="&logiciellibre;">Debian: 17 years of Free Software, "do-ocracy", and democracy</ulink> (Introductory slides) </para> </listitem>  <listitem><para><ulink url="&logiciellibre;">Debian: 17 years of Free Software, "do-ocracy", and democracy</ulink> (Introductory slides) </para> </listitem>
222  <listitem><para><ulink url="&debianorghelp;">How can you help Debian?</ulink> (official) </para> </listitem>  <listitem><para><ulink url="&debianorghelp;">How can you help Debian?</ulink> (official) </para> </listitem>
223  <listitem><para><ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - 'Contributing to the Debian Project'</ulink> (semi-official) </para> </listitem>  <listitem><para><ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - "Contributing to the Debian Project"</ulink> (semi-official) </para> </listitem>
224  <listitem><para><ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental) </para> </listitem>  <listitem><para><ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental) </para> </listitem>
225  <listitem><para><ulink url="&nm-do;">Debian New Maintainer site</ulink> (official) </para> </listitem>  <listitem><para><ulink url="&nm-do;">Debian New Maintainer site</ulink> (official) </para> </listitem>
226  <listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem>  <listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem>
# Line 420  those made for X11, also use these progr Line 421  those made for X11, also use these progr
421  </itemizedlist>  </itemizedlist>
422  <para>  <para>
423  The short descriptions that are given above only serve to introduce you to what  The short descriptions that are given above only serve to introduce you to what
424  each package does.  Before continuing please thoroughly read the documentation  each package does.  Before continuing please read the documentation
425  of each relevant program including ones installed through the package dependency such as  of each relevant program including ones installed through the package dependency such as
426  <command>make</command>, at least, for the standard usage.  It may seem like heavy  <command>make</command>, at least, for the standard usage.  It may seem like heavy
427  going now, but later on you'll be <emphasis>very</emphasis> glad you read it.  going now, but later on you'll be <emphasis>very</emphasis> glad you read it.
 </para>  
 <para>  
428  If you have specific questions later, I would suggest re-reading the documents  If you have specific questions later, I would suggest re-reading the documents
429  mentioned above.  Since this is a tutorial, I have intentionally skipped  mentioned above.
 details and provided only pointers to keep it simple.  
430  </para>  </para>
431  </section>  </section>
432  <section id="needdocs"><title>Documentation needed for development</title>  <section id="needdocs"><title>Documentation needed for development</title>
# Line 439  you should read along with this document Line 437  you should read along with this document
437  <itemizedlist>  <itemizedlist>
438  <listitem>  <listitem>
439  <para>  <para>
 <ulink url="&autotools-tutorial;">Autotools  
 Tutorial</ulink> provides a very good tutorial for <ulink url="&gnu-build-system;">the GNU Build System known  
 as the GNU Autotools</ulink> whose most important components are Autoconf,  
 Automake, Libtool, and gettext.  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
440  <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy  <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy
441  Manual</ulink> includes explanations of the structure and contents of the  Manual</ulink> includes explanations of the structure and contents of the
442  Debian archive, several OS design issues, the <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink>  Debian archive, several OS design issues, the <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink>
443  (FHS, which says where each file and directory should be), etc.  For you, the most  (FHS, which says where each file and directory should be), etc.  For you, the most
444  important thing is that it describes requirements that each package must  important thing is that it describes requirements that each package must
445  satisfy to be included in the distribution (see the local copies of  satisfy to be included in the distribution. (See the local copies of
446  <ulink url="&policy-pdf;">policy.pdf</ulink> and <ulink url="&fhs-pdf;">fhs-2.3.pdf</ulink>).  <ulink url="&policy-pdf;">policy.pdf</ulink> and <ulink url="&fhs-pdf;">fhs-2.3.pdf</ulink>.)
447  </para>  </para>
448  </listitem>  </listitem>
449  <listitem>  <listitem>
# Line 467  when and where to upload etc.  (See the Line 457  when and where to upload etc.  (See the
457  <ulink url="&developers-refpdf;">developers-reference.pdf</ulink>.)  <ulink url="&developers-refpdf;">developers-reference.pdf</ulink>.)
458  </para>  </para>
459  </listitem>  </listitem>
460    </itemizedlist>
461    <para>
462    The following is the <emphasis>important</emphasis> documentation which
463    you should read along with this document:
464    </para>
465    <itemizedlist>
466    <listitem>
467    <para>
468    <ulink url="&autotools-tutorial;">Autotools
469    Tutorial</ulink> provides a very good tutorial for <ulink url="&gnu-build-system;">the GNU Build System known
470    as the GNU Autotools</ulink> whose most important components are Autoconf,
471    Automake, Libtool, and gettext.
472    </para>
473    </listitem>
474  <listitem>  <listitem>
475  <para>  <para>
476  <systemitem role="package">gnu-standards</systemitem> - this package contains  <systemitem role="package">gnu-standards</systemitem> - this package contains
# Line 559  is time for you to dig into the Line 563  is time for you to dig into the
563  <ulink url="&bts;">Debian Bug Tracking System</ulink>  <ulink url="&bts;">Debian Bug Tracking System</ulink>
564  and read the documentation there, to be able to  and read the documentation there, to be able to
565  deal with the reports efficiently.  I highly recommend reading the  deal with the reports efficiently.  I highly recommend reading the
566  <ulink url="&devref-bug-handling;">Debian Developer's Reference, 5.8:  <ulink url="&devref-bug-handling;">Debian Developer's Reference, 5.8.
567  "Handling bugs"</ulink>.  "Handling bugs"</ulink>.
568  </para>  </para>
569  <para>  <para>
# Line 591  specifically named files for each step a Line 595  specifically named files for each step a
595  <listitem>  <listitem>
596  <para>We obtain an upstream program file usually in a compressed tar format.</para>  <para>We obtain an upstream program file usually in a compressed tar format.</para>
597    <itemizedlist>    <itemizedlist>
598    <listitem><literal><replaceable>programname</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem>    <listitem><literal><replaceable>package</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem>
599    </itemizedlist>    </itemizedlist>
600  </listitem>  </listitem>
601  <listitem>  <listitem>
602  <para>  <para>
603  We create a non-native Debian source package in the "3.0 (quilt)" format, which refers to the set of input files for  We create a non-native Debian source package in the <literal>3.0 (quilt)</literal> format, which refers to the set of input files for
604  the Debian package building, by adding Debian package modifications to the upstream program under the <filename>debian</filename> directory.  the Debian package building, by adding Debian package modifications to the upstream program under the <filename>debian</filename> directory.
605  </para>  </para>
606    <itemizedlist>    <itemizedlist>
607    <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem>
608    <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.debian.tar.gz</literal>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.debian.tar.gz</literal>
609      <footnote><para>For the older non-native Debian source package in the "1.0" format,      <footnote><para>For the older non-native Debian source package in the <literal>1.0</literal> format,
610      <literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal>      <literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal>
611      is used instead. </para></footnote></listitem>      is used instead. </para></footnote></listitem>
612    <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem>
613    </itemizedlist>    </itemizedlist>
614  </listitem>  </listitem>
615  <listitem>  <listitem>
# Line 613  the Debian package building, by adding D Line 617  the Debian package building, by adding D
617  We build Debian binary packages, which are ordinary installable package files in <literal>.deb</literal> format (or <literal>.udeb</literal> format, used by the Debian Installer), from the Debian source package.  We build Debian binary packages, which are ordinary installable package files in <literal>.deb</literal> format (or <literal>.udeb</literal> format, used by the Debian Installer), from the Debian source package.
618  </para>  </para>
619    <itemizedlist>    <itemizedlist>
620    <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>
621    </itemizedlist>    </itemizedlist>
622  </listitem>  </listitem>
623  </itemizedlist>  </itemizedlist>
624  <para>  <para>
625  Please note that the character separating  Please note that the character separating
626  <literal><replaceable>programname</replaceable></literal> and  <literal><replaceable>package</replaceable></literal> and
627  <literal><replaceable>version</replaceable></literal> was changed from  <literal><replaceable>version</replaceable></literal> was changed from
628  <literal>-</literal> (hyphen) to <literal>_</literal> (underscore).  <literal>-</literal> (hyphen) to <literal>_</literal> (underscore).
629  </para>  </para>
630  <para>  <para>
 If you are making a Debian specific package without an upstream program instead,  
 typical workflow of the Debian package building is simpler.  
 </para>  
 <itemizedlist>  
 <listitem>  
 <para>  
 We create a native Debian source package in the "3.0 (native)" format using a compressed tar format in which required files under the <filename>debian</filename> directory are also included.  
 </para>  
   <itemizedlist>  
   <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem>  
   <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.dsc</literal></listitem>  
   </itemizedlist>  
 </listitem>  
 <listitem>  
 <para>  
 We build Debian binary packages from the native Debian source package.  
 </para>  
   <itemizedlist>  
   <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>  
   </itemizedlist>  
 </listitem>  
 </itemizedlist>  
 <para>  
631  Here,  Here,
632  <literal><replaceable>programname</replaceable></literal> part of the file name is substituted by the  <literal><replaceable>package</replaceable></literal> part of the file name is substituted by the
633  <emphasis role="strong">package name</emphasis>,  <emphasis role="strong">package name</emphasis>,
634  <literal><replaceable>version</replaceable></literal> part of it is substituted by the  <literal><replaceable>version</replaceable></literal> part of it is substituted by the
635  <emphasis role="strong">upstream version</emphasis>,  <emphasis role="strong">upstream version</emphasis>,
# Line 668  Debian Policy Manual: <ulink url="&polic Line 649  Debian Policy Manual: <ulink url="&polic
649  and is automatically assigned by the package build process.</para></footnote>  and is automatically assigned by the package build process.</para></footnote>
650  </para>  </para>
651  <para>  <para>
652    If you are making a Debian specific package without an upstream program instead,
653    typical workflow of the Debian package building is simpler.
654    </para>
655    <itemizedlist>
656    <listitem>
657    <para>
658    We create a native Debian source package in the <literal>3.0 (quilt)</literal> format using a compressed tar format in which required files under the <filename>debian</filename> directory are also included.
659    </para>
660      <itemizedlist>
661      <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem>
662      <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.dsc</literal></listitem>
663      </itemizedlist>
664    </listitem>
665    <listitem>
666    <para>
667    We build Debian binary packages from the native Debian source package.
668    </para>
669      <itemizedlist>
670      <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>
671      </itemizedlist>
672    </listitem>
673    </itemizedlist>
674    <para>
675  In the following, each step of this is explained with detailed examples.  In the following, each step of this is explained with detailed examples.
676  </para>  </para>
677  </section>  </section>
# Line 805  For the <literal>non-free</literal> sect Line 809  For the <literal>non-free</literal> sect
809  with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.  with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.
810  </para>  </para>
811  </listitem>  </listitem>
812  </itemizedlist>  <listitem>
813  <para>  <para>
814  If you are unsure about where it should go, post the license text on <ulink url="&debian-legal-ldo;">debian-legal@lists.debian.org</ulink>  If you are unsure about where it should go, post the license text on
815    <ulink url="&debian-legal-ldo;">debian-legal@lists.debian.org</ulink>
816  and ask for advice.  and ask for advice.
817  </para>  </para>
818  </listitem>  </listitem>
819    </itemizedlist>
820    </listitem>
821  <listitem>  <listitem>
822  <para>  <para>
823  The program certainly should <emphasis role="strong">not</emphasis> run setuid  The program should <emphasis role="strong">not</emphasis> introduce security
824  root, or even better, it shouldn't need to be setuid or setgid to anything.  and maintenance concerns to the Debian system.
825  </para>  </para>
826  </listitem>  <itemizedlist>
827  <listitem>  <listitem>
828  <para>  <para>
829  The program should not be a daemon, or go in an  The program should be well documented and its code needs to be understandable
830  <filename>*/sbin</filename> directory, or open a port as root.  (i.e.  not obfuscated).
831  </para>  </para>
832  </listitem>  </listitem>
833  <listitem>  <listitem>
834  <para>  <para>
835  The program should be in the binary executable form; libraries are harder to handle.  You should contact the program's author(s) to check if they agree with packaging it
836    and are amicable to Debian.  It is important to be able to consult with the author(s)
837    in case of any problems with the program, so don't try to package
838    unmaintained software.
839  </para>  </para>
840  </listitem>  </listitem>
841  <listitem>  <listitem>
842  <para>  <para>
843  The program should be well documented and its code needs to be understandable  The program certainly should <emphasis role="strong">not</emphasis> run setuid
844  (i.e.  not obfuscated).  root, or even better, it shouldn't need to be setuid or setgid to anything.
845  </para>  </para>
846  </listitem>  </listitem>
847  <listitem>  <listitem>
848  <para>  <para>
849  You should contact the program's author(s) to check if they agree with packaging it  The program should not be a daemon, or go in an
850  and are amicable to Debian.  It is important to be able to consult with the author(s)  <filename>*/sbin</filename> directory, or open a port as root.
 in case of any problems with the program, so don't try to package  
 unmaintained software.  
851  </para>  </para>
852  </listitem>  </listitem>
853  </itemizedlist>  </itemizedlist>
854    </listitem>
855    </itemizedlist>
856  <para>  <para>
857  Of course, these are just safety measures, and intended to save you from  Of course, the last one is just a safety measures, and intended to save you from
858  enraging users if you do something wrong in some setuid daemon...  When you gain  enraging users if you do something wrong in some setuid daemon...  When you gain
859  more experience in packaging, you'll be able to package such software.  more experience in packaging, you'll be able to package such software.
860  </para>  </para>
861    <para>
862    As a new maintainer, you are encouraged to get some experience in packaging
863    with easier packages and discouraged from creating complicated packages.
864    </para>
865    <itemizedlist>
866    <listitem><para>Simple packages</para>
867    <itemizedlist>
868      <listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem>
869      <listitem><para>single binary package, arch = all (executables written in the POSIX shell language)</para></listitem>
870      <listitem><para>single binary package, arch = all (executables written in interpreter languages)</para></listitem>
871    </itemizedlist>
872    </listitem>
873    <listitem><para>Intermediate complexity packages</para>
874    <itemizedlist>
875      <listitem><para>single binary package, arch = any (executables written in compiler languages such as C and C++)</para></listitem>
876      <listitem><para>multiple binary packages, arch = any + all (packages for executables + documentation)</para></listitem>
877      <listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem>
878      <listitem><para>upstream source containing undistributable contents</para></listitem>
879    </itemizedlist>
880    </listitem>
881    <listitem><para>High complexity packages</para>
882    <itemizedlist>
883      <listitem><para>interpreter module package used by other packages</para></listitem>
884      <listitem><para>generic library package used by other packages</para></listitem>
885      <listitem><para>multiple binary packages containing a library package</para></listitem>
886      <listitem><para>source package with multiple upstream sources</para></listitem>
887      <listitem><para>kernel module packages</para></listitem>
888      <listitem><para>kernel patch packages</para></listitem>
889      <listitem><para>any package with non-trivial maintainer scripts</para></listitem>
890    </itemizedlist>
891    </listitem>
892    </itemizedlist>
893    <para>
894    Packaging high complexity packages is not too hard, but it requires a bit more
895    knowledge. You should seek specific guidances for every complexity. For
896    example, some interpreter languages have their policy.
897    </para>
898    <itemizedlist>
899    <listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem>
900    <listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem>
901    <listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem>
902    </itemizedlist>
903    <para>
904    There is another old Latin saying: <emphasis>Fabricando fit fabe</emphasis>
905    (Practice makes perfect).  It is <emphasis>highly</emphasis> recommended to
906    practice and experiment all the steps of Debian packaging with simple packages
907    while reading this tutorial.  A trivial upstream tarball
908    <filename>hello-sh-1.0.tar.gz</filename> created with the following may offer
909    you a good starting point.<footnote><para>Do not worry about missing
910    <filename>Makefile</filename>.  You can install the <command>hello</command>
911    command by simply using <command>debhelper</command> as in
912    <xref linkend="install"/>, or by modifying the upstream source to add a new
913    <filename>Makefile</filename> with the <literal>install</literal> target as in
914    <xref linkend="modify"/>.</para></footnote>
915    </para>
916    <screen>
917    $ mkdir -p hello-sh/hello-sh-1.0; cd hello-sh/hello-sh-1.0
918    $ cat &gt; hello &lt;&lt;EOF
919    #!/bin/sh
920    # (C) 2011 Foo Bar, GPL2+
921    echo "Hello!"
922    EOF
923    $ chmod 755 hello
924    $ cd ..
925    $ tar -cvzf hello-sh-1.0.tar.gz hello-sh-1.0
926    </screen>
927  </section>  </section>
928  <section id="getit"><title>Get the program, and try it out</title>  <section id="getit"><title>Get the program, and try it out</title>
929  <para>  <para>
# Line 860  author's homepage.  Sources for free Uni Line 936  author's homepage.  Sources for free Uni
936  <filename>.tar.bz2</filename>, or  <filename>.tar.bz2</filename>, or
937  <command>tar</command>+<command>xz</command> format with the extension  <command>tar</command>+<command>xz</command> format with the extension
938  <filename>.tar.xz</filename>.  These usually contain a directory called  <filename>.tar.xz</filename>.  These usually contain a directory called
939  <filename><replaceable>programname</replaceable>-<replaceable>version</replaceable></filename>  <filename><replaceable>package</replaceable>-<replaceable>version</replaceable></filename>
940  with all the sources inside.  with all the sources inside.
941  </para>  </para>
942  <para>  <para>
# Line 879  enough.  </para> </footnote>), you shoul Line 955  enough.  </para> </footnote>), you shoul
955  appropriate tools and repack it.  appropriate tools and repack it.
956  </para>  </para>
957  <para>  <para>
958    If your program's source comes with some contents which do not comply with
959    DFSG, you should also unpack it to remove such contents and repack it with a
960    modified upstream version containg <literal>dfsg</literal>.
961    </para>
962    <para>
963  As an example, I'll use a program called <command>gentoo</command>, a GTK+  As an example, I'll use a program called <command>gentoo</command>, a GTK+
964  file manager.  file manager.
965  <footnote><para> This program is already packaged. The  <footnote><para> This program is already packaged. The
# Line 923  or simply with freshly unpacked sources. Line 1004  or simply with freshly unpacked sources.
1004  </section>  </section>
1005  <section id="simplemake"><title>Simple build systems</title>  <section id="simplemake"><title>Simple build systems</title>
1006  <para>  <para>
1007  Simple programs come with a <filename>Makefile</filename> and can  Simple programs usually come with a <filename>Makefile</filename> and can
1008  be compiled just by invoking <literal>make</literal>.<footnote><para>  be compiled just by invoking <literal>make</literal>.<footnote><para>
1009  Many modern programs come with a script <filename>configure</filename> which  Many modern programs come with a script <filename>configure</filename> which
1010  when executed creates a <filename>Makefile</filename> customized for  when executed creates a <filename>Makefile</filename> customized for
# Line 961  system comprising <ulink url="&autoconf; Line 1042  system comprising <ulink url="&autoconf;
1042  such sources by the <filename>configure.ac</filename>,  such sources by the <filename>configure.ac</filename>,
1043  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.
1044  <footnote><para>Autotools is too big to deal in this small tutorial. This  <footnote><para>Autotools is too big to deal in this small tutorial. This
1045  section is mean to provide keywords and references only.  Please make sure to read the  section is meant to provide keywords and references only.  Please make sure to read the
1046  <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and  <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and
1047  <ulink url="&autotools-readme;"/>, if you need to use it.</para></footnote>  <ulink url="&autotools-readme;"/>, if you need to use it.</para></footnote>
1048  </para>  </para>
# Line 990  files requires some knowledge of <comman Line 1071  files requires some knowledge of <comman
1071  The second step of the Autotools workflow is usually that the user obtains this  The second step of the Autotools workflow is usually that the user obtains this
1072  distributed source and runs <literal>./configure &amp;&amp; make</literal> in  distributed source and runs <literal>./configure &amp;&amp; make</literal> in
1073  the source directory to compile the program into a  the source directory to compile the program into a
1074  <command><replaceable>binary</replaceable> executables</command>.  <command><replaceable>binary</replaceable></command> executable.
1075  </para>  </para>
1076  <screen>  <screen>
1077  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>
# Line 1032  These are used in the <filename>debian/c Line 1113  These are used in the <filename>debian/c
1113  Although this simple approach works most of the times, you may need to adjust  Although this simple approach works most of the times, you may need to adjust
1114  <emphasis role="strong">package name</emphasis> and  <emphasis role="strong">package name</emphasis> and
1115  <emphasis role="strong">upstream version</emphasis> by renaming the upstream  <emphasis role="strong">upstream version</emphasis> by renaming the upstream
1116  source to follow the Debian policy and the existing convention.  source to follow the Debian Policy and the existing convention.
1117  </para>  </para>
1118  <para>  <para>
1119  You must choose the <emphasis role="strong">package name</emphasis>  You must choose the <emphasis role="strong">package name</emphasis>
# Line 1041  to consist only of lower case letters (< Line 1122  to consist only of lower case letters (<
1122  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be
1123  at least two characters long, must start with an alphanumeric character, and  at least two characters long, must start with an alphanumeric character, and
1124  must not be the same as existing ones.  must not be the same as existing ones.
1125  It is good idea to keep its length within 30 characters and should not exceed  It is good idea to keep its length within 30 characters.
1126  40 characters.  <footnote><para>The default package name field length of <command>aptitude</command> is 30.  For more than 90% of packages, the package name is less than 24 characters.</para></footnote>
1127  </para>  </para>
1128  <!--  <!--
1129  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
# Line 1061  If upstream source uses generic words su Line 1142  If upstream source uses generic words su
1142  its name, it is good idea to rename it not to contaminate name space for the  its name, it is good idea to rename it not to contaminate name space for the
1143  package name and to identify its contents explicitly.  package name and to identify its contents explicitly.
1144  <footnote><para>If you follow the  <footnote><para>If you follow the
1145  <ulink url="&devref-newpackage;">Developer's Reference 5.1. 'New packages'</ulink>,  <ulink url="&devref-newpackage;">Debian Developer's Reference 5.1. "New packages"</ulink>,
1146  the ITP process will usually catch this kind of issues.</para></footnote>.  the ITP process will usually catch this kind of issues.</para></footnote>
1147  </para>  </para>
1148  <para>  <para>
1149  You should choose the <emphasis role="strong">upstream version</emphasis>  You should choose the <emphasis role="strong">upstream version</emphasis>
1150  to consist only of  to consist only of
1151  alphanumerics (<literal>0-9A-Za-z</literal>), plus (<literal>+</literal>),  alphanumerics (<literal>0-9A-Za-z</literal>), plus (<literal>+</literal>),
1152  tilde (<literal>~</literal>), and periods (<literal>.</literal>). It must  tildes (<literal>~</literal>), and periods (<literal>.</literal>). It must
1153  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter
1154  rule should help you avoid confusing file names.</para></footnote>  rule should help you avoid confusing file names.</para></footnote>
1155  It is good idea to keep its length within 8 characters if possible.  It is good idea to keep its length within 8 characters if possible.
1156    <footnote><para>The default version field length of <command>aptitude</command> is 10.  The Debian revision with preceding hyphen usually consumes 2.  For more than 80% of packages, the upstream version is less than 8 characters and the Debian revision is less than 2 characters.  For more than 90% of packages, the upstream version is less than 10 characters and the Debian revision is less than 3 characters.</para></footnote>
1157  </para>  </para>
1158  <!--  <!--
1159  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
# Line 1098  aptitude display 10 = 8char for up + 1ch Line 1180  aptitude display 10 = 8char for up + 1ch
1180  <para>  <para>
1181  If the upstream software does not use normal version system like  If the upstream software does not use normal version system like
1182  <literal>2.30.32</literal> but uses some kind of date such as  <literal>2.30.32</literal> but uses some kind of date such as
1183  <literal>09Oct23</literal>, a random codename string or a VCS hush value as a part  <literal>09Oct23</literal>, a random codename string or a VCS hash value as a part
1184  of version, make sure to remove them from the  of version, make sure to remove them from the
1185  <emphasis role="strong">upstream version</emphasis>.  Such information can be  <emphasis role="strong">upstream version</emphasis>.  Such information can be
1186  recorded in the <filename>debian/changelog</filename> file.  If you need to  recorded in the <filename>debian/changelog</filename> file.  If you need to
# Line 1107  invent a version string, use the <litera Line 1189  invent a version string, use the <litera
1189  <command>dpkg</command> properly sees later versions as upgrades.  <command>dpkg</command> properly sees later versions as upgrades.
1190  </para>  </para>
1191  <para>  <para>
1192  Version strings can be compared with <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as the following.  Version strings <footnote><para>Version strings may be
1193    <emphasis role="strong">upstream version</emphasis>
1194    (<literal><replaceable>version</replaceable></literal>),
1195    <emphasis role="strong">Debian revision</emphasis>
1196    (<literal><replaceable>revision</replaceable></literal>), or
1197    <emphasis role="strong">version</emphasis>
1198    (<literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>).
1199    See <xref linkend="newrevision"/> for how the
1200    <emphasis role="strong">Debian revision</emphasis> is incremented.
1201    </para></footnote>
1202    can be compared with <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as the following.
1203  </para>  </para>
1204  <screen>  <screen>
1205   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>
1206  </screen>  </screen>
1207  <para>  <para>
1208  The version comparison rule can be summarized as the folowing.  The version comparison rule can be summarized as the following.
1209  </para>  </para>
1210  <itemizedlist>  <itemizedlist>
1211  <listitem><para>The strings are compared from the head to the tail.</para></listitem>  <listitem><para>The strings are compared from the head to the tail.</para></listitem>
1212  <listitem><para>Alphabets are larger than numbers.</para></listitem>  <listitem><para>Alphabets are larger than numbers.</para></listitem>
1213  <listitem><para>Numbers are compared as the integer.</para></listitem>  <listitem><para>Numbers are compared as the integer.</para></listitem>
1214  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>
1215  <listitem><para>There are some special rules for periods (<literal>.</literal>), plus (<literal>+</literal>) and tilde (<literal>~</literal>) as the followings.</para>  <listitem><para>There are some special rules for periods (<literal>.</literal>), plus (<literal>+</literal>) and tildes (<literal>~</literal>) as the followings.</para>
1216    <para>    <para>
1217    <literal>0.0</literal> &lt;    <literal>0.0</literal> &lt;
1218    <literal>0.5</literal> &lt;    <literal>0.5</literal> &lt;
# Line 1144  sure that the upgrade works properly by Line 1236  sure that the upgrade works properly by
1236  <filename>gentoo-0.9.12~rc99.tar.gz</filename>.  <filename>gentoo-0.9.12~rc99.tar.gz</filename>.
1237  </para>  </para>
1238  </section>  </section>
1239  <section id="dh-make"><title>Initial Debian package</title>  <section id="dh-make"><title>Setting up <command>dh_make</command></title>
1240  <para>  <para>
1241  Set up the shell environment variables <literal>$DEBEMAIL</literal> and  Set up the shell environment variables <literal>$DEBEMAIL</literal> and
1242  <literal>$DEBFULLNAME</literal> so that various Debian maintenance  <literal>$DEBFULLNAME</literal> so that various Debian maintenance
# Line 1159  DEBEMAIL=your.email.address@example.org Line 1251  DEBEMAIL=your.email.address@example.org
1251  DEBFULLNAME=Firstname Lastname  DEBFULLNAME=Firstname Lastname
1252  export DEBEMAIL DEBFULLNAME  export DEBEMAIL DEBFULLNAME
1253  EOF  EOF
1254    $ . ~/.bashrc
1255  </screen>  </screen>
1256    </section>
1257    <section id="non-native-dh-make"><title>Initial non-native Debian package</title>
1258  <para>  <para>
1259  You can create an initial Debian package by issuing the  Normal Debian packages are non-native Debian packages made from upstream
1260  <command>dh_make</command> command as follows.  programs.  If you wish to create a non-native Debian package of an upstream
1261    source <filename>gentoo-0.9.12.tar.gz</filename>, you can create an initial
1262    non-native Debian package for it by issuing the <command>dh_make</command>
1263    command as follows.
1264  </para>  </para>
1265  <screen>  <screen>
1266  $ . ~/.bashrc  $ cd ~/gentoo
1267  $ cd ~/gentoo/gentoo-0.9.12  $ wget http://example.org/gentoo-0.9.12.tar.gz
1268    $ tar -xvzf gentoo-0.9.12.tar.gz
1269    $ cd gentoo-0.9.12
1270  $ dh_make -f ../gentoo-0.9.12.tar.gz  $ dh_make -f ../gentoo-0.9.12.tar.gz
1271  </screen>  </screen>
1272  <para>  <para>
# Line 1182  provided by the upstream for your Debian Line 1282  provided by the upstream for your Debian
1282  </para>  </para>
1283  <para>  <para>
1284  You should see some output asking you what sort of package you want  You should see some output asking you what sort of package you want
1285  to create.  Gentoo is a single-binary package - it creates only one binary package, i.e,  to create.  Gentoo is a single binary package - it creates only one binary package, i.e,
1286  one <filename>.deb</filename> file - so we will select the first option  one <filename>.deb</filename> file - so we will select the first option
1287  (with the <literal>s</literal> key), check the information on the screen, and  (with the <literal>s</literal> key), check the information on the screen, and
1288  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.
1289  <footnote><para> There are several choices here: <literal>s</literal> for  <footnote><para> There are several choices here: <literal>s</literal> for
1290  Single-binary package, <literal>i</literal> for arch-Independent package, <literal>m</literal> for  Single binary package, <literal>i</literal> for arch-Independent package, <literal>m</literal> for
1291  Multiple-binary packages, <literal>l</literal> for Library package, <literal>k</literal> for  Multiple binary packages, <literal>l</literal> for Library package, <literal>k</literal> for
1292  Kernel module package, <literal>n</literal> for kernel patch package, and <literal>b</literal>  Kernel module package, <literal>n</literal> for kernel patch package, and <literal>b</literal>
1293  for <systemitem role="package">cdbs</systemitem> package.  This document focuses on the  for <systemitem role="package">cdbs</systemitem> package.  This document focuses on the
1294  use of the <command>dh</command> command (from the package  use of the <command>dh</command> command (from the package
1295  <systemitem role="package">debhelper</systemitem>) to create a single-binary package,  <systemitem role="package">debhelper</systemitem>) to create a single binary package,
1296  but also touches on how to use it for arch-independent or  but also touches on how to use it for arch-independent or
1297  multiple-binary packages.  The package  multiple binary packages.  The package
1298  <systemitem role="package">cdbs</systemitem> offers an alternative packaging script  <systemitem role="package">cdbs</systemitem> offers an alternative packaging script
1299  infrastructure to the <command>dh</command> command and is outside the scope of  infrastructure to the <command>dh</command> command and is outside the scope of
1300  this document.  </para> </footnote>  this document.  </para> </footnote>
# Line 1240  testing them (<xref linkend="checkit"/>) Line 1340  testing them (<xref linkend="checkit"/>)
1340  All the steps will be explained.  All the steps will be explained.
1341  </para>  </para>
1342  <para>  <para>
 Once again, as a new maintainer you are discouraged from creating complicated  
 packages, e.g.:  
 </para>  
 <itemizedlist>  
 <listitem>  
 <para>  
 multiple-binary packages;  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
 library packages;  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
 kernel module packages;  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
 kernel patch packages;  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
 packages with the source in a format other than <filename>tar.gz</filename> or  
 <filename>tar.bz2</filename>; or  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
 packages where the source tarball contains undistributable contents.  
 </para>  
 </listitem>  
 </itemizedlist>  
 <para>  
 Doing so is not too hard, but it requires a bit more knowledge, so we won't  
 describe all of it here.  
 </para>  
 <para>  
1343  If you accidentally erased some template files while working on them, you can  If you accidentally erased some template files while working on them, you can
1344  recover them by running <command>dh_make</command> with the  recover them by running <command>dh_make</command> with the
1345  <literal>--addmissing</literal> option again in a Debian package source tree.  <literal>--addmissing</literal> option again in a Debian package source tree.
# Line 1290  Updating an existing package may get com Line 1349  Updating an existing package may get com
1349  techniques.  While learning the basics, please stick to creating a fresh  techniques.  While learning the basics, please stick to creating a fresh
1350  package; further explanations are given in <xref linkend="update"/>.  package; further explanations are given in <xref linkend="update"/>.
1351  </para>  </para>
1352    <para>
1353    Please note that the source file does not need to contain any build system
1354    discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It
1355    could be just a collection of graphics data etc.  Installation of files may be
1356    enabled by <systemitem role="package">debhelper</systemitem> configuration
1357    files such as <filename>debian/install</filename> (see
1358    <xref linkend="install"/>) only.
1359    </para>
1360    </section>
1361    <section id="native-dh-make"><title>Initial native Debian package</title>
1362    <para>
1363    Debian native packages are simpler to manage if they contain source files you
1364    manage only for Debian, possibly only for local uses.  If you have source
1365    files in <filename>~/mypackage-1.0</filename>, you can create an initial native
1366    Debian package for it by issuing the <command>dh_make</command> command as
1367    follows.
1368    </para>
1369    <screen>
1370    $ cd ~/mypackage-1.0
1371    $ dh_make --native
1372    </screen>
1373    <para>
1374    Then the <filename>debian</filename> directory and its contents are created
1375    just like <xref linkend="non-native-dh-make"/>.  This does not create a tarball
1376    since this is a native Debian package.  But that is the only difference.
1377    The rest of the packaging activities are practically the same.
1378    </para>
1379  </section>  </section>
1380  </chapter>  </chapter>
1381  <chapter id="modify"><title>Modifying the source</title>  <chapter id="modify"><title>Modifying the source</title>
# Line 1433  installation.  The packaging script will Line 1519  installation.  The packaging script will
1519  <literal>$(DESTDIR)</literal> to the temporary directory.  <literal>$(DESTDIR)</literal> to the temporary directory.
1520  </para>  </para>
1521  <para>  <para>
1522  For packages of the single-binary type, the temporary directory used  For packages of the single binary type, the temporary directory used
1523  by the <command>dh_auto_install</command> command will be set to  by the <command>dh_auto_install</command> command will be set to
1524  <filename>debian/<replaceable>package</replaceable></filename>.  <filename>debian/<replaceable>package</replaceable></filename>.
1525  <footnote><para> For packages of the multiple-binary type, the  <footnote><para> For packages of the multiple binary type, the
1526  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>
1527  as the temporary directory while the <command>dh_install</command> command with  as the temporary directory while the <command>dh_install</command> command with
1528  the help of  the help of
# Line 1680  they are obvious. Line 1766  they are obvious.
1766  This file contains various values which <command>dpkg</command>,  This file contains various values which <command>dpkg</command>,
1767  <command>dselect</command>, <command>apt-get</command>,  <command>dselect</command>, <command>apt-get</command>,
1768  <command>apt-cache</command>, <command>aptitude</command>, and other package  <command>apt-cache</command>, <command>aptitude</command>, and other package
1769  management tools will use to manage the package.  It is defined by the <ulink url="&policy-control;">Debian  management tools will use to manage the package.  It is defined by the
1770  Policy Manual, 5 'Control files and their fields'</ulink>.  <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.
1771  </para>  </para>
1772  <para>  <para>
1773  Here is the <filename>control</filename> file <command>dh_make</command>  Here is the <filename>control</filename> file <command>dh_make</command>
# Line 1728  for e-mail readers and daemons, <literal Line 1814  for e-mail readers and daemons, <literal
1814  daemons, <literal>x11</literal> for X11 programs that don't fit anywhere else,  daemons, <literal>x11</literal> for X11 programs that don't fit anywhere else,
1815  and many more.  and many more.
1816  <footnote> <para>See  <footnote> <para>See
1817  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 'Sections'</ulink> and  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 "Sections"</ulink> and
1818  <ulink url="&sections-unstable;">List of sections in <literal>sid</literal></ulink>.</para>  <ulink url="&sections-unstable;">List of sections in <literal>sid</literal></ulink>.</para>
1819  </footnote>  </footnote>
1820  </para>  </para>
# Line 1739  we can omit it.) Line 1825  we can omit it.)
1825  <para>  <para>
1826  Line 3 describes how important it is that the user installs this package.  Line 3 describes how important it is that the user installs this package.
1827  <footnote> <para>See  <footnote> <para>See
1828  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 'Priorities'</ulink>.  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 "Priorities"</ulink>.
1829  </para>  </para>
1830  </footnote>  </footnote>
1831  </para>  </para>
# Line 1778  you.  Avoid using commas, ampersands and Line 1864  you.  Avoid using commas, ampersands and
1864  The 5th line includes the list of packages required to build your package as  The 5th line includes the list of packages required to build your package as
1865  the <literal>Build-Depends</literal> field.  You can also have the  the <literal>Build-Depends</literal> field.  You can also have the
1866  <literal>Build-Depends-Indep</literal> field as an additional line, here.  <literal>Build-Depends-Indep</literal> field as an additional line, here.
1867  <footnote><para>See <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian  <footnote><para>See
1868  Policy Manual, 7.7 'Relationships between source and binary packages -  <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian Policy Manual, 7.7 "Relationships between source and binary packages - Build-Depends, Build-Depends-Indep, Build-Conflicts, Build-Conflicts-Indep"</ulink>.</para></footnote>
1869  Build-Depends, Build-Depends-Indep, Build-Conflicts,  Some packages like
 Build-Conflicts-Indep'</ulink>.</para></footnote>  Some packages like  
1870  <systemitem role="package">gcc</systemitem> and  <systemitem role="package">gcc</systemitem> and
1871  <systemitem role="package">make</systemitem> which are required by the  <systemitem role="package">make</systemitem> which are required by the
1872  <systemitem role="package">build-essential</systemitem> package are implied.  If you need  <systemitem role="package">build-essential</systemitem> package are implied.  If you need
# Line 1906  these relations; if not, it will be expl Line 1991  these relations; if not, it will be expl
1991  <para>  <para>
1992  Here is a simplified description of package relationships.  Here is a simplified description of package relationships.
1993  <footnote><para>See  <footnote><para>See
1994  <ulink url="&policy-relationships;">Debian Policy Manual, 7 'Declaring relationships between packages'</ulink>.  <ulink url="&policy-relationships;">Debian Policy Manual, 7 "Declaring relationships between packages"</ulink>.
1995  </para></footnote>  </para></footnote>
1996  </para>  </para>
1997  <itemizedlist>  <itemizedlist>
# Line 2084  English.  Translations of these descript Line 2169  English.  Translations of these descript
2169  Let's insert <literal>Vcs-*</literal> fields to document the Version Control  Let's insert <literal>Vcs-*</literal> fields to document the Version Control
2170  System (VCS) location between line 6 and 7.  System (VCS) location between line 6 and 7.
2171  <footnote><para>See  <footnote><para>See
2172  <ulink url="&devref-bpp-vcs;">Developer's Reference, 6.2.5. 'Version Control System location'</ulink>.  <ulink url="&devref-bpp-vcs;">Debian Developer's Reference, 6.2.5. "Version Control System location"</ulink>.
2173  </para></footnote>  </para></footnote>
2174  Let's assume that the <systemitem role="package">gentoo</systemitem>  Let's assume that the <systemitem role="package">gentoo</systemitem>
2175  package has its VCS located in Debian Alioth Git Service at  package has its VCS located in Debian Alioth Git Service at
# Line 2131  Finally, here is the updated <filename>c Line 2216  Finally, here is the updated <filename>c
2216  <para>  <para>
2217  This file contains the information about package upstream resources, copyright  This file contains the information about package upstream resources, copyright
2218  and license information.  and license information.
2219  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 'Copyright information'</ulink>  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink>
2220  dictates its content and  dictates its content and
2221  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>
2222  provides guidelines for its format.  provides guidelines for its format.
# Line 2201  debian-devel-announce: <ulink url="&howt Line 2286  debian-devel-announce: <ulink url="&howt
2286  <section id="changelog"><title><filename>changelog</filename> file</title>  <section id="changelog"><title><filename>changelog</filename> file</title>
2287  <para>  <para>
2288  This is a required file, which has a special format described in the  This is a required file, which has a special format described in the
2289  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 'debian/changelog'</ulink>.  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.
2290  This format is used by <command>dpkg</command> and other programs to obtain the  This format is used by <command>dpkg</command> and other programs to obtain the
2291  version number, revision, distribution and urgency of your package.  version number, revision, distribution and urgency of your package.
2292  </para>  </para>
# Line 2282  is marked as executable. Line 2367  is marked as executable.
2367  Every <filename>rules</filename> file, as any other  Every <filename>rules</filename> file, as any other
2368  <filename>Makefile</filename>, consists of several targets and their rules  <filename>Makefile</filename>, consists of several targets and their rules
2369  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian
2370  Policy Manual, 4.9 'Main building script: debian/rules'</ulink> explains its  Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains its
2371  details.  details.
2372  </para>  </para>
2373  <para>  <para>
# Line 2935  possible. Line 3020  possible.
3020  <para>  <para>
3021  To control most of what <systemitem role="package">debhelper</systemitem> does  To control most of what <systemitem role="package">debhelper</systemitem> does
3022  while building the package, you put optional configuration files under the  while building the package, you put optional configuration files under the
3023  <filename>debian</filename> directory.  This chapter will make an overview of  <filename>debian</filename> directory.  This chapter will provide an overview of
3024  what each of these does and its format.  Please read <ulink url="&debian-policy;">Debian Policy  what each of these does and its format.  Please read the <ulink url="&debian-policy;">Debian Policy
3025  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's
3026  Reference</ulink> for guidelines for the packaging.  Reference</ulink> for guidelines for packaging.
3027  </para>  </para>
3028  <para>  <para>
3029  The <command>dh_make</command> command will create some template configuration  The <command>dh_make</command> command will create some template configuration
# Line 2949  prefixed by the binary package name such Line 3034  prefixed by the binary package name such
3034  them.  them.
3035  <footnote><para>  <footnote><para>
3036  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
3037  referred without preceding <filename>debian/</filename> for simplicity whenever  referred to without the preceding <filename>debian/</filename> for simplicity whenever
3038  they are obvious.  they are obvious.
3039  </para></footnote>  </para></footnote>
3040  </para>  </para>
3041  <para>  <para>
3042  The <command>dh_make</command> command may not create some template  Some template configuration files for <systemitem role="package">debhelper</systemitem>
3043  configuration files for <systemitem role="package">debhelper</systemitem>.  In  may not be created by the <command>dh_make</command> command.  In
3044  such cases, you need to create them with the editor.  such cases, you need to create them with an editor.
3045  </para>  </para>
3046  <para>  <para>
3047  If you wish or need to activate any of those, please do the following.  If you wish or need to activate any of these, please do the following:
3048  </para>  </para>
3049  <itemizedlist>  <itemizedlist>
3050  <listitem>  <listitem>
3051  <para>  <para>
3052  rename template files by removing the <literal>.ex</literal> or  rename template files by removing the <literal>.ex</literal> or
3053  <literal>.EX</literal> suffix if the template files have one.  <literal>.EX</literal> suffix if they have one;
3054  </para>  </para>
3055  </listitem>  </listitem>
3056  <listitem>  <listitem>
3057  <para>  <para>
3058  rename the name of these configuration files using the actual binary package  rename the configuration files to use the actual binary package
3059  name in place of <literal><replaceable>package</replaceable></literal>.  name in place of <literal><replaceable>package</replaceable></literal>;
3060  </para>  </para>
3061  </listitem>  </listitem>
3062  <listitem>  <listitem>
3063  <para>  <para>
3064  modify template file contents to suit your needs.  modify template file contents to suit your needs;
3065  </para>  </para>
3066  </listitem>  </listitem>
3067  <listitem>  <listitem>
3068  <para>  <para>
3069  remove template files which you do not need.  remove template files which you do not need;
3070  </para>  </para>
3071  </listitem>  </listitem>
3072  <listitem>  <listitem>
3073  <para>  <para>
3074  modify the <filename>control</filename> file (see <xref linkend="control"/>),  modify the <filename>control</filename> file (see <xref linkend="control"/>),
3075  if necessary.  if necessary;
3076  </para>  </para>
3077  </listitem>  </listitem>
3078  <listitem>  <listitem>
# Line 2998  necessary. Line 3083  necessary.
3083  </listitem>  </listitem>
3084  </itemizedlist>  </itemizedlist>
3085  <para>  <para>
3086  Those <systemitem role="package">debhelper</systemitem> configuration files  Any <systemitem role="package">debhelper</systemitem> configuration files
3087  without <filename><replaceable>package</replaceable></filename> prefix such as  without a <filename><replaceable>package</replaceable></filename> prefix, such as
3088  <filename>install</filename> apply to the first binary package.  When there are  <filename>install</filename>, apply to the first binary package.  When there are
3089  many binary packages, their configurations can be specified by prefixing their  many binary packages, their configurations can be specified by prefixing their
3090  name to their configuration filenames such as  name to their configuration filenames such as
3091  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3092  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3093  </para>  </para>
3094  <section id="readme"><title><filename>README.Debian</filename> file</title>  <section id="readme"><title><filename>README.Debian</filename></title>
3095  <para>  <para>
3096  Any extra details or discrepancies between the original package and your Debian  Any extra details or discrepancies between the original package and your Debian
3097  version should be documented here.  version should be documented here.
3098  </para>  </para>
3099  <para>  <para>
3100  <command>dh_make</command> created a default one, this is what it looks like:  <command>dh_make</command> created a default one; this is what it looks like:
3101  </para>  </para>
3102  <screen>  <screen>
3103  gentoo for Debian  gentoo for Debian
# Line 3026  If you have nothing to be documented, re Line 3111  If you have nothing to be documented, re
3111  </citerefentry>.  </citerefentry>.
3112  </para>  </para>
3113  </section>  </section>
3114  <section id="compat"><title><filename>compat</filename> file</title>  <section id="compat"><title><filename>compat</filename></title>
3115  <para>  <para>
3116  The <filename>compat</filename> file defines the <systemitem role="package">debhelper</systemitem> compatibility level.  Currently, you  The <filename>compat</filename> file defines the <systemitem role="package">debhelper</systemitem> compatibility level.  Currently, you
3117  should set it to the <systemitem role="package">debhelper</systemitem> V7 by  should set it to the <systemitem role="package">debhelper</systemitem> v7 as
3118  the following.  follows:
3119  </para>  </para>
3120  <screen>  <screen>
3121  $ echo 7 &gt; debian/compat  $ echo 7 &gt; debian/compat
3122  </screen>  </screen>
3123  </section>  </section>
3124  <section id="conffiles"><title><filename>conffiles</filename> file</title>  <section id="conffiles"><title><filename>conffiles</filename></title>
3125  <para>  <para>
3126  One of the most annoying things about software is when you spend a great deal  One of the most annoying things about software is when you spend a great deal
3127  of time and effort customizing a program, only to have an upgrade stomp all  of time and effort customizing a program, only to have an upgrade stomp all
3128  over your changes.  Debian solves this problem by marking such configuration files as conffiles.  over your changes.  Debian solves this problem by marking such configuration files as conffiles.
3129  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>
3130  <manvolnum>1</manvolnum> </citerefentry> and  <manvolnum>1</manvolnum> </citerefentry> and
3131  <ulink url="&policy-conffiles;">Debian Policy Manual 'D.2.5 Conffiles'</ulink>.  <ulink url="&policy-conffiles;">Debian Policy Manual "D.2.5 Conffiles"</ulink>.
3132  </para></footnote>  </para></footnote>
3133  When you upgrade a package, you'll be prompted whether you want to keep  When you upgrade a package, you'll be asked whether you want to keep
3134  your old configuration files or not.  your old configuration files or not.
3135  </para>  </para>
3136  <para>  <para>
3137  Since <systemitem role="package">debhelper</systemitem> V3, <citerefentry>  <citerefentry><refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>
3138  <refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> <emphasis>automatically</emphasis> flags any files under
 </citerefentry> will <emphasis>automatically</emphasis> flag any files under  
3139  the <filename>/etc</filename> directory as conffiles, so if your program only  the <filename>/etc</filename> directory as conffiles, so if your program only
3140  has conffiles there you do not need to specify them in this file.  For most  has conffiles there you do not need to specify them in this file.  For most
3141  package types, the only place there is (and should be conffiles) is under  package types, the only place conffiles should ever be is under
3142  <filename>/etc</filename> and so this file doesn't need to exist.  <filename>/etc</filename>, and so this file doesn't need to exist.
3143  </para>  </para>
3144  <para>  <para>
3145  If your program uses configuration files but also rewrites them on its own,  If your program uses configuration files but also rewrites them on its own,
3146  it's best not to make them as conffiles because <command>dpkg</command> will  it's best not to make them conffiles because <command>dpkg</command> will
3147  then prompt users to verify the changes all the time.  then prompt users to verify the changes all the time.
3148  </para>  </para>
3149  <para>  <para>
3150  If the program you're packaging requires every user to modify the configuration  If the program you're packaging requires every user to modify the configuration
3151  files in the <filename>/etc</filename> directory, there are 2 popular ways to  files in the <filename>/etc</filename> directory, there are two popular ways to
3152  make them not as conffiles to keep <command>dpkg</command> quiet.  arrange for them to not be conffiles, keeping <command>dpkg</command> quiet.
3153  </para>  </para>
3154  <itemizedlist>  <itemizedlist>
3155  <listitem>  <listitem>
3156  <para>  <para>
3157  You make a symlink under the <filename>/etc</filename> directory pointing to a  Create a symlink under the <filename>/etc</filename> directory pointing to a
3158  file under the <filename>/var</filename> directory generated by the  file under the <filename>/var</filename> directory generated by the
3159  <emphasis>maintainer scripts</emphasis>.  maintainer scripts.
3160  </para>  </para>
3161  </listitem>  </listitem>
3162  <listitem>  <listitem>
3163  <para>  <para>
3164  You make a file generated by the <emphasis>maintainer scripts</emphasis> under  Create a file generated by the maintainer scripts under the <filename>/etc</filename> directory.
 the <filename>/etc</filename> directory.  
3165  </para>  </para>
3166  </listitem>  </listitem>
3167  </itemizedlist>  </itemizedlist>
3168  <para>  <para>
3169  For more information on the <emphasis>maintainer scripts</emphasis>, see <xref linkend="maintscripts"/>.  For information on maintainer scripts, see <xref linkend="maintscripts"/>.
3170  </para>  </para>
3171  </section>  </section>
3172  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename> files</title>  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename></title>
3173  <para>  <para>
3174  If your package requires regularly scheduled tasks to operate properly, you can  If your package requires regularly scheduled tasks to operate properly, you can
3175  use this file to set it up.  You can either setup regular tasks that happen  use these files to set that up.  You can set up regular tasks that either happen
3176  hourly, daily, weekly or monthly or alternatively happen any other time that  hourly, daily, weekly, or monthly, or alternatively happen at any other time that
3177  you wish.  The filenames are:  you wish.  The filenames are:
3178  </para>  </para>
3179  <itemizedlist>  <itemizedlist>
3180  <listitem>  <listitem>
3181  <para>  <para>
3182  <filename>cron.hourly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.hourly</filename> - Installed as
3183  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>; run
3184  once an hour every hour.  once an hour.
3185  </para>  </para>
3186  </listitem>  </listitem>
3187  <listitem>  <listitem>
3188  <para>  <para>
3189  <filename>cron.daily</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.daily</filename> - Installed as
3190  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>; run
3191  once a day, usually early morning.  once a day.
3192  </para>  </para>
3193  </listitem>  </listitem>
3194  <listitem>  <listitem>
3195  <para>  <para>
3196  <filename>cron.weekly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.weekly</filename> - Installed as
3197  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>; run
3198  once a week, usually early Sunday morning.  once a week.
3199  </para>  </para>
3200  </listitem>  </listitem>
3201  <listitem>  <listitem>
3202  <para>  <para>
3203  <filename>cron.monthly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.monthly</filename> - Installed as
3204  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run
3205  once a month, usually early morning on the first of the month.  once a month.
3206  </para>  </para>
3207  </listitem>  </listitem>
3208  <listitem>  <listitem>
3209  <para>  <para>
3210  <filename>cron.d</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.d</filename> - Installed as
3211  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any
3212  other time  other time.
3213  </para>  </para>
3214  </listitem>  </listitem>
3215  </itemizedlist>  </itemizedlist>
3216  <para>  <para>
3217  For the named files, the format of them is the shell script.  The different one  Most of these files are shell scripts, with the exception of
3218  is <filename><replaceable>package</replaceable>.cron.d</filename> which follows  <filename><replaceable>package</replaceable>.cron.d</filename> which follows
3219  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>
3220  <manvolnum>5</manvolnum> </citerefentry>.  <manvolnum>5</manvolnum> </citerefentry>.
3221  </para>  </para>
3222  <para>  <para>
3223  Note that this doesn't include log rotation; for that, see <citerefentry>  No explicit <filename>cron.*</filename> file is needed to set up log rotation;
3224  <refentrytitle>dh_installlogrotate</refentrytitle> <manvolnum>1</manvolnum>  for that, see
3225  </citerefentry> and <citerefentry> <refentrytitle>logrotate</refentrytitle>  <citerefentry><refentrytitle>dh_installlogrotate</refentrytitle>
3226  <manvolnum>8</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum></citerefentry> and
3227    <citerefentry><refentrytitle>logrotate</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
3228  </para>  </para>
3229  </section>  </section>
3230  <section id="dirs"><title><filename>dirs</filename> file</title>  <section id="dirs"><title><filename>dirs</filename></title>
3231  <para>  <para>
3232  This file specifies the directories which we need but the normal installation  This file specifies any directories which we need but which are not created by the normal installation
3233  procedure (<literal>make install DESTDIR=...</literal> invoked by  procedure (<literal>make install DESTDIR=...</literal> invoked by
3234  <literal>dh_auto_install</literal>) somehow doesn't create.  This generally  <literal>dh_auto_install</literal>).  This generally
3235  means there is a problem with the <filename>Makefile</filename>.  means there is a problem with the <filename>Makefile</filename>.
3236  </para>  </para>
3237  <para>  <para>
3238  Files listed in the <filename>install</filename> file doesn't need the  Files listed in an <filename>install</filename> file don't need their
3239  directories created first.  See <xref linkend="install"/>.  directories created first.  See <xref linkend="install"/>.
3240  </para>  </para>
3241  <para>  <para>
3242  It is best to try to run the installation first and only use this if you  It is best to try to run the installation first and only use this if you
3243  run into trouble.  There is no preceding slash on the directory names listed in  run into trouble.  There is no preceding slash on the directory names listed in
3244  the <filename>dirs</filename> file.  the <filename>dirs</filename> file.
3245  </para>  </para>
3246  </section>  </section>
3247  <section id="doc-base"><title><filename><replaceable>package</replaceable>.doc-base</filename> file</title>  <section id="doc-base"><title><filename><replaceable>package</replaceable>.doc-base</filename></title>
3248  <para>  <para>
3249  If your package has documentation other than manual pages and info docs, you  If your package has documentation other than manual and info pages, you
3250  should use the <systemitem role="package">doc-base</systemitem> file to  should use the <systemitem role="package">doc-base</systemitem> file to
3251  register it, so the user can find it with e.g.  <citerefentry>  register it, so the user can find it with e.g.  <citerefentry>
3252  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,
3253  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>
3254  </citerefentry> or <citerefentry> <refentrytitle>doccentral</refentrytitle>  </citerefentry>, or <citerefentry> <refentrytitle>doccentral</refentrytitle>
3255  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
3256  </para>  </para>
3257  <para>  <para>
# Line 3175  This usually includes HTML, PS and PDF f Line 3259  This usually includes HTML, PS and PDF f
3259  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.
3260  </para>  </para>
3261  <para>  <para>
3262  This is how <systemitem role="package">gentoo</systemitem>'s doc-base file  This is what <systemitem role="package">gentoo</systemitem>'s doc-base file
3263  <filename>gentoo.doc-base</filename> looks like:  <filename>gentoo.doc-base</filename> looks like:
3264  </para>  </para>
3265  <screen>  <screen>
# Line 3198  manual, in <ulink url="&doc-base;">Debia Line 3282  manual, in <ulink url="&doc-base;">Debia
3282  For more details on installing additional documentation, look in <xref linkend="destdir"/>.  For more details on installing additional documentation, look in <xref linkend="destdir"/>.
3283  </para>  </para>
3284  </section>  </section>
3285  <section id="docs"><title><filename>docs</filename> file</title>  <section id="docs"><title><filename>docs</filename></title>
3286  <para>  <para>
3287  This file specifies the file names of documentation files we can have  This file specifies the file names of documentation files we can have
3288  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
# Line 3211  directory that are called <filename>BUGS Line 3295  directory that are called <filename>BUGS
3295  <filename>README*</filename>, <filename>TODO</filename> etc.  <filename>README*</filename>, <filename>TODO</filename> etc.
3296  </para>  </para>
3297  <para>  <para>
3298  For <systemitem role="package">gentoo</systemitem>, I also included some other  For <systemitem role="package">gentoo</systemitem>, some other files
3299  files:  are also included:
3300  </para>  </para>
3301  <screen>  <screen>
3302  BUGS  BUGS
# Line 3224  README.gtkrc Line 3308  README.gtkrc
3308  TODO  TODO
3309  </screen>  </screen>
3310  </section>  </section>
3311  <section id="emacsen"><title><filename>emacsen-*</filename> file</title>  <section id="emacsen"><title><filename>emacsen-*</filename></title>
3312  <para>  <para>
3313  If your package supplies Emacs files that can be bytecompiled at package  If your package supplies Emacs files that can be bytecompiled at package
3314  installation time, you can use these files to set it up.  installation time, you can use these files to set it up.
# Line 3238  They are installed into the temporary di Line 3322  They are installed into the temporary di
3322  If you don't need these, remove them.  If you don't need these, remove them.
3323  </para>  </para>
3324  </section>  </section>
3325  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename> file</title>  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename></title>
3326  <para>  <para>
3327  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>
3328  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories
3329  listed in this file as example files.  listed in this file as example files.
3330  </para>  </para>
3331  </section>  </section>
3332  <section id="initd"><title><filename><replaceable>package</replaceable>.init</filename> and <filename><replaceable>package</replaceable>.default</filename> files</title>  <section id="initd"><title><filename><replaceable>package</replaceable>.init</filename> and <filename><replaceable>package</replaceable>.default</filename></title>
3333  <para>  <para>
3334  If your package is a daemon that needs to be run at the system start-up, you've  If your package is a daemon that needs to be run at system start-up, you've
3335  obviously disregarded my initial recommendation, haven't you?  :-)  obviously disregarded my initial recommendation, haven't you?  :-)
3336  </para>  </para>
3337  <para>  <para>
3338  The <filename><replaceable>package</replaceable>.init</filename> file is  The <filename><replaceable>package</replaceable>.init</filename> file is
3339  installed as the  installed as the
3340  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script
3341  for the <emphasis>init script</emphasis> which starts and stops a daemon.  which starts and stops the daemon.
3342  Its fairly generic skeleton template is provided by the  Its fairly generic skeleton template is provided by the
3343  <command>dh_make</command> command as <filename>init.d.ex</filename>.  You'll  <command>dh_make</command> command as <filename>init.d.ex</filename>.  You'll
3344  likely have to rename and edit it, a lot, while making sure to provide  likely have to rename and edit it, a lot, while making sure to provide
# Line 3265  gets installed into the temporary direct Line 3349  gets installed into the temporary direct
3349  </para>  </para>
3350  <para>  <para>
3351  The <filename><replaceable>package</replaceable>.default</filename> file will  The <filename><replaceable>package</replaceable>.default</filename> file will
3352  be installed into  be installed as
3353  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This
3354  file sets defaults that are sourced by the <emphasis>init script</emphasis>.  Most times this  file sets defaults that are sourced by the init script.  This
3355  <filename><replaceable>package</replaceable>.default</filename> file is used to disable running a daemon, set some default flags or  <filename><replaceable>package</replaceable>.default</filename> file
3356  timeouts.  If your <emphasis>init script</emphasis> has certain <emphasis>settable</emphasis>  is most often used to disable running a daemon, or to set some default flags or
3357  features you want to install these into the <filename><replaceable>package</replaceable>.default</filename> file, not the <emphasis>init script</emphasis>.  timeouts.  If your init script has certain configurable
3358    features, you can set them in the <filename><replaceable>package</replaceable>.default</filename> file,
3359    instead of in the init script itself.
3360  </para>  </para>
3361  <para>  <para>
3362  If your upstream program provides a file for the <emphasis>init script</emphasis>, you can either use it or not.  If you  If your upstream program provides a file for the init script, you can either use it or not.  If you
3363  don't use their <emphasis>init script</emphasis> then create a new one in  don't use their init script then create a new one in
3364  <filename><replaceable>package</replaceable>.init</filename>.  However  <filename><replaceable>package</replaceable>.init</filename>.  However
3365  if the upstream <emphasis>init script</emphasis> looks fine and installs in the right place you  if the upstream init script looks fine and installs in the right place you
3366  still need to setup the <filename>rc*</filename> symlinks.  To do this you will  still need to set up the <filename>rc*</filename> symlinks.  To do this you will
3367  need to override <command>dh_installinit</command> in the  need to override <command>dh_installinit</command> in the
3368  <filename>rules</filename> file with the following lines:  <filename>rules</filename> file with the following lines:
3369  </para>  </para>
# Line 3289  override_dh_installinit: Line 3375  override_dh_installinit:
3375  If you don't need this, remove the files.  If you don't need this, remove the files.
3376  </para>  </para>
3377  </section>  </section>
3378  <section id="install"><title><filename>install</filename> file</title>  <section id="install"><title><filename>install</filename></title>
3379  <para>  <para>
3380  If there are files that need to be installed into your package but your  If there are files that need to be installed into your package but your
3381  standard <literal>make install</literal> won't do it, you put the filenames and  standard <literal>make install</literal> won't do it, put the filenames and
3382  destinations into this <filename>install</filename> file.  They are installed  destinations into this <filename>install</filename> file.  They are installed
3383  by <citerefentry> <refentrytitle>dh_install</refentrytitle>  by <citerefentry> <refentrytitle>dh_install</refentrytitle>
3384  <manvolnum>1</manvolnum> </citerefentry>.<footnote><para> This replaces the  <manvolnum>1</manvolnum> </citerefentry>.<footnote><para> This replaces the
# Line 3305  the <filename>docs</filename> file and n Line 3391  the <filename>docs</filename> file and n
3391  <para>  <para>
3392  This <filename>install</filename> file has one line per file installed, with  This <filename>install</filename> file has one line per file installed, with
3393  the name of the file (relative to the top build directory) then a space then  the name of the file (relative to the top build directory) then a space then
3394  the installation directory (relative to the install directory).  One example of  the installation directory (relative to the install directory).  One example of where this is used is if a binary <filename>src/<replaceable>bar</replaceable></filename> is left uninstalled; the
3395  this is when a binary executable is forgotten to be installed, the  <filename>install</filename> file might look like:
 <filename>install</filename> file would look like:  
3396  </para>  </para>
3397  <screen>  <screen>
3398  src/foo/mybin usr/bin  src/<replaceable>bar</replaceable> usr/bin
3399  </screen>  </screen>
3400  <para>  <para>
3401  This will mean when this package is installed, there will be a binary executable  This means when this package is installed, there will be a binary executable
3402  <filename>/usr/bin/mybin</filename>.  <filename>/usr/bin/<replaceable>bar</replaceable></filename>.
3403  </para>  </para>
3404  <para>  <para>
3405  Alternatively, this <filename>install</filename> can have the name of the file  Alternatively, this <filename>install</filename> can have the name of the file
3406  only without the installation directory when the relative directory path does  only without the installation directory when the relative directory path does
3407  not change.  This format is usually used for a large package that splits build  not change.  This format is usually used for a large package that splits the
3408  result into multiple binary packages using  output of its build into multiple binary packages using
3409  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3410  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3411  </para>  </para>
3412  <para>  <para>
3413  The <command>dh_install</command> command will fall back to look in  The <command>dh_install</command> command will fall back to looking in
3414  <filename>debian/tmp</filename> for files, if it doesn't find them in the  <filename>debian/tmp</filename> for files, if it doesn't find them in the
3415  current directory (or wherever you've told it to look using  current directory (or wherever you've told it to look using
3416  <literal>--sourcedir</literal>).  <literal>--sourcedir</literal>).
3417  </para>  </para>
3418  </section>  </section>
3419  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename> file</title>  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename></title>
3420  <para>  <para>
3421  If your package has info pages, you should install them using <citerefentry>  If your package has info pages, you should install them using <citerefentry>
3422  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>
3423  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3424  <filename><replaceable>package</replaceable>.info</filename> files.  <filename><replaceable>package</replaceable>.info</filename> file.
3425  </para>  </para>
3426  </section>  </section>
3427  <section id="lintian"><title><filename>{<replaceable>package</replaceable>.|source/}lintian-overrides</filename> files</title>  <section id="lintian"><title><filename>{<replaceable>package</replaceable>.,source/}lintian-overrides</filename></title>
3428  <para>  <para>
3429  If <systemitem role="package">lintian</systemitem> reports an erroneous  If <systemitem role="package">lintian</systemitem> reports an erroneous
3430  diagnostics for a case when the policy allows exceptions to some rule, you can  diagnostic for a case where Debian policy allows exceptions to some rule, you can
3431  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>
3432  or <filename>source/lintian-overrides</filename> to quiet it.  Please read  or <filename>source/lintian-overrides</filename> to quieten it.  Please read
3433  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain
3434  from abusing this.  from abusing this.
3435  </para>  </para>
3436  <para>  <para>
3437  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is
3438  for the binary package named as <systemitem role="package"><replaceable>package</replaceable></systemitem> and is installed  for the binary package named <systemitem role="package"><replaceable>package</replaceable></systemitem> and is installed
3439  into  into
3440  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>
3441  by the <command>dh_lintian</command> command.  by the <command>dh_lintian</command> command.
# Line 3360  by the <command>dh_lintian</command> com Line 3445  by the <command>dh_lintian</command> com
3445  is not installed.  is not installed.
3446  </para>  </para>
3447  </section>  </section>
3448  <section id="manpage"><title><filename>manpage.*</filename> files</title>  <section id="manpage"><title><filename>manpage.*</filename></title>
3449  <para>  <para>
3450  Your program(s) should have a manual page.  If they don't, you should create  Your program(s) should have a manual page.  If they don't, you should create
3451  them.  The <command>dh_make</command> command creates few template files for a  them.  The <command>dh_make</command> command creates some template files for
3452  manual page.  These need to be copied and edited for each command without its  manual pages.  These need to be copied and edited for each command missing its
3453  manual page.  Please make sure to remove unused templates.  manual page.  Please make sure to remove unused templates.
3454  </para>  </para>
3455  <section id="manpage1"><title><filename>manpage.1.ex</filename> file</title>  <section id="manpage1"><title><filename>manpage.1.ex</filename></title>
3456  <para>  <para>
3457  Manual pages are normally written in <citerefentry>  Manual pages are normally written in <citerefentry>
3458  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
# Line 3377  The <filename>manpage.1.ex</filename> te Line 3462  The <filename>manpage.1.ex</filename> te
3462  manual page for a brief description of how to edit such a file.  manual page for a brief description of how to edit such a file.
3463  </para>  </para>
3464  <para>  <para>
3465  The final manual page file name should include the name of the program it is  The final manual page file name should give the name of the program it is
3466  documenting, so we will rename it from <literal>manpage</literal> to  documenting, so we will rename it from <literal>manpage</literal> to
3467  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>
3468  as the first suffix, which means it's a manual page for a user command.  Be  as the first suffix, which means it's a manual page for a user command.  Be
3469  sure to verify that this section is indeed the correct one.  Here's a short  sure to verify that this section is indeed the correct one.  Here's a short
3470  list of manual page sections:  list of manual page sections:
3471  </para>  </para>
3472  <table id="manpage-sections" pgwide="0" frame="topbot" rowsep="1" colsep="1">  <informaltable id="manpage-sections" pgwide="0" frame="topbot" rowsep="1" colsep="1">
 <title>manual page sections</title>  
3473  <tgroup cols="3">  <tgroup cols="3">
3474    <colspec colwidth="8*" align="left"/> <colspec colwidth="24*" align="left"/> <colspec colwidth="40*" align="left"/>    <colspec colwidth="8*" align="left"/> <colspec colwidth="24*" align="left"/> <colspec colwidth="40*" align="left"/>
3475    <thead>    <thead>
# Line 3403  list of manual page sections: Line 3487  list of manual page sections:
3487      <row> <entry>9</entry> <entry>Kernel routines</entry> <entry>Non-standard calls and internals</entry> </row>      <row> <entry>9</entry> <entry>Kernel routines</entry> <entry>Non-standard calls and internals</entry> </row>
3488    </tbody>    </tbody>
3489  </tgroup>  </tgroup>
3490  </table>  </informaltable>
3491  <para>  <para>
3492  So <systemitem role="package">gentoo</systemitem>'s man page should be called  So <systemitem role="package">gentoo</systemitem>'s man page should be called
3493  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>
3494  man page in the original source, you should create it by renaming the  man page in the original source, you should create it by renaming the
3495  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and
3496  edit it by using information from the example and from upstream docs.  editing it using information from the example and from the upstream docs.
3497  </para>  </para>
3498  <para>  <para>
3499  You can use the <command>help2man</command> command to generate a man page out  You can use the <command>help2man</command> command to generate a man page out
3500  of <literal>--help</literal> and <literal>--version</literal> output of each  of the <literal>--help</literal> and <literal>--version</literal> output of each
3501  program, too.  <footnote><para> If the command is missing  program, too.  <footnote><para> Note that <command>help2man</command>'s
3502  <command>info</command> page but have documentation files in the  placeholder man page will claim that more detailed documentation is
3503  <filename>/usr/share/<replaceable>package</replaceable></filename> directory,  available in the info system. If the command is missing an
3504  you should manually edit generated the man page created by the  <command>info</command> page, you
3505    should manually edit the man page created by the
3506  <command>help2man</command> command.  </para> </footnote>  <command>help2man</command> command.  </para> </footnote>
3507  </para>  </para>
3508  </section>  </section>
3509  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename> file</title>  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename></title>
3510  <para>  <para>
3511  If on the other hand you prefer writing SGML instead of  If on the other hand you prefer writing SGML instead of
3512  <command>nroff</command>, you can use the <filename>manpage.sgml.ex</filename>  <command>nroff</command>, you can use the <filename>manpage.sgml.ex</filename>
# Line 3446  line in the <filename>control</filename> Line 3531  line in the <filename>control</filename>
3531  </listitem>  </listitem>
3532  <listitem>  <listitem>
3533  <para>  <para>
3534  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3535  <filename>rules</filename> file:  <filename>rules</filename> file:
3536  </para>  </para>
3537  <screen>  <screen>
# Line 3457  override_dh_auto_build: Line 3542  override_dh_auto_build:
3542  </listitem>  </listitem>
3543  </itemizedlist>  </itemizedlist>
3544  </section>  </section>
3545  <section id="manpagexml"><title><filename>manpage.xml.ex</filename> file</title>  <section id="manpagexml"><title><filename>manpage.xml.ex</filename></title>
3546  <para>  <para>
3547  If you prefer XML over SGML, you can use the <literal>manpage.xml.ex</literal>  If you prefer XML over SGML, you can use the <literal>manpage.xml.ex</literal>
3548  template.  If you do this, you have to:  template.  If you do this, you have to:
# Line 3477  XSLT processor like <systemitem role="pa Line 3562  XSLT processor like <systemitem role="pa
3562  </listitem>  </listitem>
3563  <listitem>  <listitem>
3564  <para>  <para>
3565  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal> and  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal>, and
3566  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>
3567  line in the <literal>control</literal> file  line in the <literal>control</literal> file
3568  </para>  </para>
3569  </listitem>  </listitem>
3570  <listitem>  <listitem>
3571  <para>  <para>
3572  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3573  <filename>rules</filename> file:  <filename>rules</filename> file:
3574  </para>  </para>
3575  <screen>  <screen>
# Line 3506  override_dh_auto_build: Line 3591  override_dh_auto_build:
3591  <para>  <para>
3592  If your package has manual pages, you should install them using <citerefentry>  If your package has manual pages, you should install them using <citerefentry>
3593  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>
3594  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3595  <filename><replaceable>package</replaceable>.manpages</filename> files.  <filename><replaceable>package</replaceable>.manpages</filename> file.
3596  </para>  </para>
3597  <para>  <para>
3598  To install <filename>docs/gentoo.1</filename> for the <systemitem role="package">gentoo</systemitem> package as its manpage, you create a  To install <filename>docs/gentoo.1</filename> as a manpage for the <systemitem role="package">gentoo</systemitem> package, create a
3599  <filename>gentoo.manpages</filename> file as the following.  <filename>gentoo.manpages</filename> file as follows.
3600  </para>  </para>
3601  <screen>  <screen>
3602  docs/gentoo.1  docs/gentoo.1
3603  </screen>  </screen>
3604  </section>  </section>
3605  <section id="menu"><title><filename>menu</filename> file</title>  <section id="menu"><title><filename>menu</filename></title>
3606  <para>  <para>
3607  X Window System users usually have a window manager with a menu that can be  X Window System users usually have a window manager with a menu that can be
3608  customized to launch programs.  If they have installed the Debian <systemitem role="package">menu</systemitem> package, a set of menus for every program on  customized to launch programs.  If they have installed the Debian <systemitem role="package">menu</systemitem> package, a set of menus for every program on
# Line 3538  specifies what kind of interface the pro Line 3623  specifies what kind of interface the pro
3623  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.
3624  </para>  </para>
3625  <para>  <para>
3626  The next is <literal>section</literal>, where the menu and submenu entry  The next is the <literal>section</literal> that the menu and submenu entry
3627  should appear in.  should appear in.
3628  <footnote><para> The current list of sections is at  <footnote><para> The current list of sections is in
3629  <ulink url="&menu-structure;">The Debian Menu sub-policy 2.1 'Preferred menu structure'</ulink>.  <ulink url="&menu-structure;">The Debian Menu sub-policy 2.1 "Preferred menu structure"</ulink>.
3630  There were a major reorganization of menu structure for <literal>squeeze</literal>.  There was a major reorganization of menu structure for <literal>squeeze</literal>.
3631  </para> </footnote>  </para> </footnote>
3632  </para>  </para>
3633  <para>  <para>
# Line 3569  You can also add other fields like <lite Line 3654  You can also add other fields like <lite
3654  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>
3655  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>
3656  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>
3657  </citerefentry> and  </citerefentry>, and
3658  <ulink url="&menu-policy;">The Debian Menu sub-policy</ulink> for more  <ulink url="&policy-menu;">The Debian Menu sub-policy</ulink> for more
3659  information.  information.
3660  </para>  </para>
3661  </section>  </section>
3662  <section id="news"><title><filename>NEWS</filename> file</title>  <section id="news"><title><filename>NEWS</filename></title>
3663  <para>  <para>
3664  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>
3665  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3666  </para>  </para>
3667  </section>  </section>
3668  <section id="maintscripts"><title><filename>{post|pre}{inst|rm}</filename> files</title>  <section id="maintscripts"><title><filename>{pre,post}{inst,rm}</filename></title>
3669  <para>  <para>
3670  These <filename>postinst</filename>, <filename>preinst</filename>,  These <filename>postinst</filename>, <filename>preinst</filename>,
3671  <filename>postrm</filename>, and <filename>prerm</filename> files  <filename>postrm</filename>, and <filename>prerm</filename> files
3672  <footnote><para> Although I used Bash short hand expression to indicate these  <footnote><para> Despite this use of the <command>bash</command>
3673  files as <filename>{post|pre}{inst|rm}</filename> here, I recommend you to use  shorthand expression <filename>{pre,post}{inst,rm}</filename> to indicate these
3674  pure POSIX (non-Bash) shell for these <emphasis>maintainer scripts</emphasis>  filenames, you should use pure POSIX syntax for these maintainer scripts for
3675  as much as possible for the better compatibility.  </para> </footnote> are  compatibility with <command>dash</command> as the system shell.  </para> </footnote> are
3676  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put
3677  in the control area of the package and run by <command>dpkg</command> when your  in the control area of the package and run by <command>dpkg</command> when your
3678  package is installed, upgraded or removed.  package is installed, upgraded, or removed.
3679  </para>  </para>
3680  <para>  <para>
3681  As a novice maintainer, you should avoid any manual editing of  As a novice maintainer, you should avoid any manual editing of
3682  <emphasis>maintainer scripts</emphasis> because they are problematic.  For more  maintainer scripts because they are problematic.  For more
3683  information look in the <ulink url="&policy-mantainerscripts;">Debian  information refer to the <ulink url="&policy-mantainerscripts;">Debian
3684  Policy Manual, 6 'Package maintainer scripts and installation  Policy Manual, 6 "Package maintainer scripts and installation
3685  procedure'</ulink>, and take a look at these example files provided by  procedure"</ulink>, and take a look at the example files provided by
3686  <command>dh_make</command>.  <command>dh_make</command>.
3687  </para>  </para>
3688  <para>  <para>
3689  If you did not listen to me and made your custom <emphasis>maintainer  If you did not listen to me and have created custom maintainer
3690  scripts</emphasis> for a package, you should make sure to test them not only  scripts for a package, you should make sure to test them not only
3691  for <emphasis role="strong">install</emphasis> and <emphasis role="strong">upgrade</emphasis> but also for <emphasis role="strong">remove</emphasis> and <emphasis role="strong">purge</emphasis>.  for <emphasis role="strong">install</emphasis> and
3692    <emphasis role="strong">upgrade</emphasis> but also for
3693    <emphasis role="strong">remove</emphasis> and
3694    <emphasis role="strong">purge</emphasis>.
3695  </para>  </para>
3696  <para>  <para>
3697  Upgrades to the new version should be silent and non-intrusive (existing users  Upgrades to the new version should be silent and non-intrusive (existing users
3698  should not notice the upgrade except by discovering that old bugs have been  should not notice the upgrade except by discovering that old bugs have been
3699  fixed and there perhaps are new features).  fixed and perhaps that there are new features).
3700  </para>  </para>
3701  <para>  <para>
3702  When the upgrade is necessarily intrusive (eg., config files scattered through  When the upgrade is necessarily intrusive (eg., config files scattered through
3703  various home directories with totally different structure), you may consider to  various home directories with totally different structure), you may
3704  set package to the safe default (e.g., disabled service) and provide proper  consider as the last resort switching the package to a safe fallback state
3705  documentations required by the policy (<filename>README.Debian</filename> and  (e.g., disabling a service) and providing the proper documentation
3706  <filename>NEWS.Debian</filename>) as the last resort.  Don't bother user with  required by policy (<filename>README.Debian</filename> and
3707  the <command>debconf</command> note invoked from these <emphasis>maintainer  <filename>NEWS.Debian</filename>).  Don't bother the user with
3708  scripts</emphasis> for upgrades.  <command>debconf</command> notes invoked from these maintainer scripts
3709    for upgrades.
3710  </para>  </para>
3711  <para>  <para>
3712  The <systemitem role="package">ucf</systemitem> package provides  The <systemitem role="package">ucf</systemitem> package provides a
3713  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user
3714  changes for files that may not be labeled <emphasis>conffiles</emphasis> such  changes for files that may not be labeled as <emphasis>conffiles</emphasis> such
3715  as ones managed by the <emphasis>maintainer scripts</emphasis>.  This should  as those managed by the maintainer scripts.  This should
3716  minimize issues associated with them.  minimize issues associated with them.
3717  </para>  </para>
3718  <para>  <para>
3719  These <emphasis>maintainer scripts</emphasis> are the Debian enhancements that  These maintainer scripts are among the Debian enhancements that
3720  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must
3721  be very careful not to annoy them with these.  be very careful not to turn them into a source of annoyance.
3722  </para>  </para>
3723  </section>  </section>
3724  <section id="todo"><title><filename>TODO</filename> file</title>  <section id="todo"><title><filename>TODO</filename></title>
3725  <para>  <para>
3726  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
3727  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3728  </para>  </para>
3729  </section>  </section>
3730  <section id="watch"><title><filename>watch</filename> file</title>  <section id="watch"><title><filename>watch</filename></title>
3731  <para>  <para>
3732  The <filename>watch</filename> file format is documented in the <citerefentry>  The <filename>watch</filename> file format is documented in the <citerefentry>
3733  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
3734  manpage.  The <filename>watch</filename> file configures the  manpage.  The <filename>watch</filename> file configures the
3735  <command>uscan</command> program (in the <systemitem role="package">devscripts</systemitem> package) to watch the site where you  <command>uscan</command> program (in the <systemitem role="package">devscripts</systemitem> package) to watch the site where you
3736  originally got the source from.  This is also used by <ulink url="&dehs;">Debian External Health Status (DEHS)</ulink>.  originally got the source from.  This is also used by the
3737    <ulink url="&dehs;">Debian External Health Status (DEHS)</ulink> service.
3738  </para>  </para>
3739  <para>  <para>
3740  Here's what I put in it:  Here are its contents:
3741  </para>  </para>
3742  <screen>  <screen>
3743  # watch control file for uscan  # watch control file for uscan
# Line 3655  version=3 Line 3745  version=3
3745  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate
3746  </screen>  </screen>
3747  <para>  <para>
3748  Normally with this <filename>watch</filename> file, the URL at  Normally with a <filename>watch</filename> file, the URL at
3749  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of
3750  the form <literal>&lt;a href=...&gt;</literal>.  The base name (just the part  the form <literal>&lt;a href=...&gt;</literal>.  The basename (just the part
3751  after the final <literal>/</literal>) of these linked URLs are matched against  after the final <literal>/</literal>) of each linked URL is compared against
3752  Perl regular expression (see <citerefentry> <refentrytitle>perlre</refentrytitle>  the Perl regular expression pattern (see <citerefentry> <refentrytitle>perlre</refentrytitle>
3753  <manvolnum>1</manvolnum> </citerefentry>) pattern  <manvolnum>1</manvolnum> </citerefentry>)
3754  <literal>gentoo-(.+)\.tar\.gz</literal>.  Out of matched files, the file with  <literal>gentoo-(.+)\.tar\.gz</literal>.  Out of the files that match, the one with
3755  the greatest version number is downloaded and the <command>uupdate</command>  the greatest version number is downloaded and the <command>uupdate</command>
3756  program is run to create the updated source tree from them.  program is run to create an updated source tree.
3757  </para>  </para>
3758  <para>  <para>
3759  Although this is true for other sites, the SourceForge download service at  Although this is true for other sites, the SourceForge download service at
3760  <ulink url="&sf-net;"/> is an exception.  When the  <ulink url="&sf-net;"/> is an exception.  When the
3761  <filename>watch</filename> file has an URL matching with the Perl regexp  <filename>watch</filename> file has an URL matching the Perl regexp
3762  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program
3763  substitutes it with <literal>&qa-do;watch/sf.php/</literal> and  replaces it with <literal>&qa-do;watch/sf.php/</literal> and
3764  then applies this rule.  The URL redirector service at this <ulink url="&qa-do;"/> is designed to offer  then applies this rule.  The URL redirector service at <ulink url="&qa-do;"/> is designed to offer
3765  a stable redirect service to the desired file for the  a stable redirect service to the desired file for any
3766  <filename>watch</filename> file having  <filename>watch</filename> pattern of the form
3767  <literal>&sf-net;/<replaceable>project</replaceable>/<replaceable>tar-name</replaceable>-(.+)\.tar\.gz</literal>.  <literal>&sf-net;/<replaceable>project</replaceable>/<replaceable>tar-name</replaceable>-(.+)\.tar\.gz</literal>.
3768  This solves issues related to the periodically changing URL there.  This solves issues related to periodically changing SourceForge URLs.
3769  </para>  </para>
3770  </section>  </section>
3771  <section id="sourcef"><title><filename>source/format</filename> file</title>  <section id="sourcef"><title><filename>source/format</filename></title>
3772  <para>  <para>
3773  In the <filename>debian/source/format</filename> file, there should be a single  In the <filename>debian/source/format</filename> file, there should be a single
3774  line indicating the desired format for the source package (check <citerefentry>  line indicating the desired format for the source package (check <citerefentry>
# Line 3702  should say either: Line 3792  should say either:
3792  The newer <literal>3.0 (quilt)</literal> source format records modifications in  The newer <literal>3.0 (quilt)</literal> source format records modifications in
3793  a <command>quilt</command> patch series within  a <command>quilt</command> patch series within
3794  <filename>debian/patches</filename>.  Those changes are then automatically  <filename>debian/patches</filename>.  Those changes are then automatically
3795  applied during extraction of the source package.  <footnote><para> See <ulink url="&debsrc3;">DebSrc3.0</ulink> for the  applied during extraction of the source package.  <footnote><para> See
3796  summary information concerning the switch to the new <literal>3.0  <ulink url="&debsrc3;">DebSrc3.0</ulink> for a summary on the switch to the new <literal>3.0
3797  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>
3798  </footnote> The Debian modifications are simply stored in a  </footnote> The Debian modifications are simply stored in a
3799  <filename>debian.tar.gz</filename> archive containing all files under the  <filename>debian.tar.gz</filename> archive containing all files under the
# Line 3720  When <command>dpkg-source</command> extr Line 3810  When <command>dpkg-source</command> extr
3810  the end of the extraction with the <literal>--skip-patches</literal> option.  the end of the extraction with the <literal>--skip-patches</literal> option.
3811  </para>  </para>
3812  </section>  </section>
3813  <section id="sourcel"><title><filename>source/local-options</filename> file</title>  <section id="sourcel"><title><filename>source/local-options</filename></title>
3814  <para>  <para>
3815  When you want to manage Debian packaging activities under a VCS, you typically  When you want to manage Debian packaging activities under a VCS, you typically
3816  create one branch (e.g.  <literal>upstream</literal>) tracking the upstream  create one branch (e.g.  <literal>upstream</literal>) tracking the upstream
# Line 3745  unapply-patches Line 3835  unapply-patches
3835  abort-on-upstream-changes  abort-on-upstream-changes
3836  </screen>  </screen>
3837  </section>  </section>
3838  <section id="sourceopt"><title><filename>source/options</filename> file</title>  <section id="sourceopt"><title><filename>source/options</filename></title>
3839  <para>  <para>
3840  The autogenerated files in the source tree can be quite annoying for packaging  The autogenerated files in the source tree can be quite annoying for packaging
3841  since they generate meaningless large patch files.  There are custom modules  since they generate meaningless large patch files.  There are custom modules
# Line 3760  You can provide a Perl regular expressio Line 3850  You can provide a Perl regular expressio
3850  creating the source package.  creating the source package.
3851  </para>  </para>
3852  <para>  <para>
3853  You can store such <command>dpkg-source</command> option argument in the  As a general solution to address this problem of the autogenerated files,
3854  <filename>source/options</filename> file of the source package as the generic  you can store such a <command>dpkg-source</command> option argument in the
3855  solution to address this problem of the autogenerated files.  The following  <filename>source/options</filename> file of the source package.  The following
3856  will skip creating patch files for <filename>config.sub</filename>,  will skip creating patch files for <filename>config.sub</filename>,
3857  <filename>config.guess</filename> and <filename>Makefile</filename>.  <filename>config.guess</filename>, and <filename>Makefile</filename>.
3858  </para>  </para>
3859  <screen>  <screen>
3860  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"
3861  </screen>  </screen>
3862  </section>  </section>
3863  <section id="patches"><title><filename>patches/*</filename> files</title>  <section id="patches"><title><filename>patches/*</filename></title>
3864  <para>  <para>
3865  The old <literal>1.0</literal> source format created a single large  The old <literal>1.0</literal> source format created a single large
3866  <filename>diff.gz</filename> file which contains package maintenance files in  <filename>diff.gz</filename> file containing package maintenance files in
3867  <filename>debian</filename> and patch files to the source.  Such a package is a  <filename>debian</filename> and patch files for the source.  Such a package is a
3868  bit cumbersome to inspect and understand for each source tree modification  bit cumbersome to inspect and understand for each source tree modification
3869  later.  This is not so nice.  later.  This is not so nice.
3870  </para>  </para>
3871  <para>  <para>
3872  The newer <literal>3.0 (quilt)</literal> source format stores patches in  The newer <literal>3.0 (quilt)</literal> source format stores patches in
3873  <filename>debian/patches/*</filename> files using the <command>quilt</command>  <filename>debian/patches/*</filename> files using the <command>quilt</command>
3874  command.  These patches and other package data which are all constrained under  command.  These patches and other package data which are all contained under
3875  the <filename>debian</filename> directory are packaged as the  the <filename>debian</filename> directory are packaged as the
3876  <filename>debian.tar.gz</filename> file.  Since the  <filename>debian.tar.gz</filename> file.  Since the
3877  <command>dpkg-source</command> command can handle <command>quilt</command>  <command>dpkg-source</command> command can handle <command>quilt</command>
3878  formatted patch data in the <literal>3.0 (quilt)</literal> source without the  formatted patch data in the <literal>3.0 (quilt)</literal> source without the
3879  <systemitem role="package">quilt</systemitem> package, it does not need to  <systemitem role="package">quilt</systemitem> package, it does not need a
3880  <literal>Build-Depends</literal> on the <systemitem role="package">quilt</systemitem> package.  <footnote><para> Several methods  <literal>Build-Depends</literal> on <systemitem role="package">quilt</systemitem>.
3881  for the patch set maintenance have been proposed and are in use with Debian  <footnote><para> Several methods of patch set maintenance have been proposed and are in use for Debian
3882  packages.  The <command>quilt</command> system is the preferred maintenance  packages.  The <command>quilt</command> system is the preferred maintenance
3883  system in use.  Other ones are <command>dpatch</command>,  system in use.  Others include <command>dpatch</command>,
3884  <command>dbs</command>, <command>cdbs</command>, etc.  Many of these keep such  <command>dbs</command>, and <command>cdbs</command>.  Many of these keep such
3885  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>
3886  </para>  </para>
3887  <para>  <para>
# Line 3800  The <command>quilt</command> command is Line 3890  The <command>quilt</command> command is
3890  It records modifications to the source as a stack of <literal>-p1</literal>  It records modifications to the source as a stack of <literal>-p1</literal>
3891  patch files in the <filename>debian/patches</filename> directory and the source  patch files in the <filename>debian/patches</filename> directory and the source
3892  tree is untouched outside of the <filename>debian</filename> directory.  The  tree is untouched outside of the <filename>debian</filename> directory.  The
3893  order of these patches are recorded in the  order of these patches is recorded in the
3894  <filename>debian/patches/series</filename> file.  You can apply (=push),  <filename>debian/patches/series</filename> file.  You can apply (=push),
3895  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are
3896  asking a sponsor to upload your package, this kind of clear separation and  asking a sponsor to upload your package, this kind of clear separation and
3897  documentation of your changes are very important to expedite the package review  documentation of your changes is very important to expedite the package review
3898  by your sponsor.  </para> </footnote>  by your sponsor.  </para> </footnote>
3899  </para>  </para>
3900  <para>  <para>
3901  For <xref linkend="modify"/>, we created 3 patches in  For <xref linkend="modify"/>, we created three patches in
3902  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
3903  </para>  </para>
3904  <para>  <para>
3905  Since Debian patches are located in <filename>debian/patches</filename>, please  Since Debian patches are located in <filename>debian/patches</filename>, please
3906  make sure to setup the <command>dquilt</command> command properly as described  make sure to set up the <command>dquilt</command> command properly as described
3907  in <xref linkend="quiltrc"/>.  in <xref linkend="quiltrc"/>.
3908  </para>  </para>
3909  <para>  <para>
3910  When someone (including yourself) provides you with a patch  When anyone (including yourself) provides a patch
3911  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,
3912  then the modification of a <literal>3.0 (quilt)</literal> source package is  modifying a <literal>3.0 (quilt)</literal> source package is
3913  quite simple:  quite simple:
3914  </para>  </para>
3915  <screen>  <screen>
# Line 3833  $ dquilt header -e Line 3923  $ dquilt header -e
3923  </screen>  </screen>
3924  <para>  <para>
3925  The patches stored in the newer <literal>3.0 (quilt)</literal> source format  The patches stored in the newer <literal>3.0 (quilt)</literal> source format
3926  must be <emphasis>fuzz</emphasis> free.  You should ensure it as <literal>dquilt  must be <emphasis>fuzz</emphasis> free.  You can ensure this with <literal>dquilt
3927  pop -a; while dquilt push; do dquilt refresh; done</literal>.  pop -a; while dquilt push; do dquilt refresh; done</literal>.
3928  </para>  </para>
3929  </section>  </section>
# Line 3844  We should now be ready to build the pack Line 3934  We should now be ready to build the pack
3934  </para>  </para>
3935  <section id="completebuild"><title>Complete (re)build</title>  <section id="completebuild"><title>Complete (re)build</title>
3936  <para>  <para>
3937  In order to properly make complete (re)build of a package, you have to ensure  In order to perform a complete (re)build of a package properly, you
3938  to install  need to make sure you have installed
3939  </para>  </para>
3940  <itemizedlist>  <itemizedlist>
3941  <listitem>  <listitem>
# Line 3918  Debian archives.  See Line 4008  Debian archives.  See
4008  <ulink url="&keycreate;">Creating a new GPG key</ulink> and  <ulink url="&keycreate;">Creating a new GPG key</ulink> and
4009  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
4010  </para></footnote>  </para></footnote>
4011    If you are building Debian packages only for your local use, you can skip
4012    promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4013    <filename>.changes</filename> file as:
4014  </para>  </para>
4015    <screen>
4016    $ dpkg-buildpackage -us -uc
4017    </screen>
4018  <para>  <para>
4019  After all this is done, you will see the following files in the directory above  For the non-native Debian package, e.g.,
4020  (<filename>~/gentoo</filename>):  <systemitem role="package">gentoo</systemitem>, you will see the following
4021    files in the parent directory (<filename>~/gentoo</filename>) after building
4022    packages:
4023  </para>  </para>
4024  <itemizedlist>  <itemizedlist>
4025  <listitem>  <listitem>
# Line 3929  After all this is done, you will see the Line 4027  After all this is done, you will see the
4027  <filename>gentoo_0.9.12.orig.tar.gz</filename>  <filename>gentoo_0.9.12.orig.tar.gz</filename>
4028  </para>  </para>
4029  <para>  <para>
4030  This is the original source code tarball, merely renamed to the above so that  This is the original upstream source code tarball, merely renamed to the above so that
4031  it adheres to the Debian standard.  Note that this was created initially by the  it adheres to the Debian standard.  Note that this was created initially by the
4032  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.
4033  </para>  </para>
# Line 3952  people can be sure that it's really your Line 4050  people can be sure that it's really your
4050  </para>  </para>
4051  <para>  <para>
4052  This compressed tarball contains your <filename>debian</filename> directory  This compressed tarball contains your <filename>debian</filename> directory
4053  contents.  Each and every addition you made to the original source code are  contents.  Each and every addition you made to the original source code is
4054  stored as <command>quilt</command> patches in  stored as a <command>quilt</command> patch in
4055  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
4056  </para>  </para>
4057  <para>  <para>
# Line 3981  install and remove this just like any ot Line 4079  install and remove this just like any ot
4079  <filename>gentoo_0.9.12-1_i386.changes</filename>  <filename>gentoo_0.9.12-1_i386.changes</filename>
4080  </para>  </para>
4081  <para>  <para>
4082  This file describes all the changes made in the current package revision, and  This file describes all the changes made in the current package revision;
4083  it is used by the Debian FTP archive maintenance programs to install the binary  it is used by the Debian FTP archive maintenance programs to install the binary
4084  and source packages in it.  It is partly generated from the  and source packages.  It is partly generated from the
4085  <filename>changelog</filename> file and the <filename>.dsc</filename> file.  <filename>changelog</filename> file and the <filename>.dsc</filename> file.
4086  This file is GPG signed, so that people can be sure that it's really yours.  This file is GPG signed, so that people can be sure that it's really yours.
4087  </para>  </para>
4088  <para>  <para>
4089  As you keep working on the package, behavior will change and new features will  As you keep working on the package, its behavior will change and new features will
4090  be added.  People downloading your package can look at this file and quickly  be added.  People downloading your package can look at this file and quickly
4091  see what has changed.  Debian archive maintenance programs will also post the  see what has changed.  Debian archive maintenance programs will also post the
4092  contents of this file to the <ulink url="&debian-devel-announce-ldo;">debian-devel-announce@lists.debian.org</ulink>  contents of this file to the <ulink url="&debian-devel-announce-ldo;">debian-devel-announce@lists.debian.org</ulink>
# Line 3998  mailing list. Line 4096  mailing list.
4096  </itemizedlist>  </itemizedlist>
4097  <para>  <para>
4098  The long strings of numbers in the <filename>.dsc</filename> and  The long strings of numbers in the <filename>.dsc</filename> and
4099  <filename>.changes</filename> files are MD5/SHA1/SHA256 checksums for the files  <filename>.changes</filename> files are SHA1/SHA256 checksums for the files
4100  mentioned.  A person downloading your files can test them with <citerefentry>  mentioned.  Anyone downloading your files can test them with <citerefentry>
4101  <refentrytitle>md5sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>
4102  <citerefentry> <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> or <citerefentry> <refentrytitle>sha256sum</refentrytitle>
 </citerefentry>, or <citerefentry> <refentrytitle>sha256sum</refentrytitle>  
4103  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,
4104  they'll know the file is corrupt or has been tampered with.  they'll know the file is corrupt or has been tampered with.
4105  </para>  </para>
4106    <para>
4107    For the native Debian package, e.g.,
4108    <systemitem role="package">mypackage</systemitem>, you will see the following
4109    files in the parent directory after building packages:
4110    </para>
4111    <itemizedlist>
4112    <listitem>
4113    <para>
4114    <filename>mypackage_1.0.tar.gz</filename>
4115    </para>
4116    <para>
4117    This is the source code tarball merely created from the
4118    <filename>mypackage-1.0</filename> directory by the
4119    <command>dpkg-source</command>.  (Its suffix is not <filename>orig.tar.gz</filename>.)
4120    </para>
4121    </listitem>
4122    <listitem>
4123    <para>
4124    <filename>mypackage_1.0.dsc</filename>
4125    </para>
4126    <para>
4127    This is a summary of the contents of the source code as in the non-native
4128    Debian package. (There is no Debian revision.)
4129    </para>
4130    </listitem>
4131    <listitem>
4132    <para>
4133    <filename>mypackage_1.0_i386.deb</filename>
4134    </para>
4135    <para>
4136    This is your completed binary package as in the non-native Debian package.
4137    (There is no Debian revision.)
4138    </para>
4139    </listitem>
4140    <listitem>
4141    <para>
4142    <filename>mypackage_1.0_i386.changes</filename>
4143    </para>
4144    <para>
4145    This file describes all the changes made in the current package version as in
4146    the non-native Debian package. (There is no Debian revision.)
4147    </para>
4148    </listitem>
4149    </itemizedlist>
4150  </section>  </section>
4151  <section id="autobuilder"><title>Autobuilder</title>  <section id="autobuilder"><title>Autobuilder</title>
4152  <para>  <para>
4153  Debian supports many <ulink url="&ports;">ports</ulink>  Debian supports many <ulink url="&ports;">ports</ulink>
4154  with the <ulink url="&buildd;">autobuilder  with the <ulink url="&buildd;">autobuilder
4155  network</ulink> running <command>buildd</command> daemons on many different  network</ulink> running <command>buildd</command> daemons on computers
4156  architecture computers.  Although you do not need to do this by yourself, you  of many different architectures.  Although you do not need to do this yourself, you
4157  should be aware of what will happen on your packages.  Let's look into roughly  should be aware of what will happen to your packages.  Let's look into roughly
4158  how your packages are rebuild for many different architectures by them.  how they rebuild your packages for multiple architectures.
4159  <footnote><para> The actual autobuilder system involves much more complicated  <footnote><para> The actual autobuilder system involves much more complicated
4160  schemes than the one documented here.  Such details are beyond the scope of  schemes than the one documented here.  Such details are beyond the scope of
4161  this document.  </para> </footnote>  this document.  </para> </footnote>
4162  </para>  </para>
4163  <para>  <para>
4164  For <literal>Architecture: any</literal> packages, the autobuilder system  For <literal>Architecture: any</literal> packages, the autobuilder system
4165  rebuild them.  It ensures to install  performs a rebuild.  It ensures the installation of
4166  </para>  </para>
4167  <itemizedlist>  <itemizedlist>
4168  <listitem>  <listitem>
# Line 4078  create and sign the upload <filename>.ch Line 4219  create and sign the upload <filename>.ch
4219  This is why you see your package for other architectures.  This is why you see your package for other architectures.
4220  </para>  </para>
4221  <para>  <para>
4222  Although packages listed in the <literal>Build-Depends-indep</literal> field  Although packages listed in the <literal>Build-Depends-Indep</literal> field
4223  are required to be installed for the normal packaging by us (see <xref linkend="completebuild"/>), they are not required to be installed for the  are required to be installed for our normal packaging work (see
4224  autobuilder system since it build only architecture dependent binary packages.  <xref linkend="completebuild"/>), they are not required to be installed for the
4225    autobuilder system since it builds only architecture dependent binary packages.
4226  <footnote><para> Unlike under the <systemitem role="package">pbuilder</systemitem> package, the <command>chroot</command>  <footnote><para> Unlike under the <systemitem role="package">pbuilder</systemitem> package, the <command>chroot</command>
4227  environment under the <systemitem role="package">sbuild</systemitem> package  environment under the <systemitem role="package">sbuild</systemitem> package
4228  used by the autobuilder system does not force the minimal system and may leave  used by the autobuilder system does not enforce the use of a minimal
4229  many packages installed.  </para> </footnote> This difference between normal  system and may have many leftover packages installed.  </para>
4230  packaging and autobuilder situation dictates whether you record such required  </footnote> This distinction between normal packaging and autobuilding
4231    procedures is what dictates whether you should record such required
4232  packages in the <literal>Build-Depends</literal> or  packages in the <literal>Build-Depends</literal> or
4233  <literal>Build-Depends-indep</literal> fields of the  <literal>Build-Depends-Indep</literal> fields of the
4234  <filename>debian/control</filename> file (see <xref linkend="control"/>).  <filename>debian/control</filename> file (see <xref linkend="control"/>).
4235  </para>  </para>
4236  </section>  </section>
 <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>  
 <para>  
 When you first upload the package to the archive, you need to include the  
 original <filename>orig.tar.gz</filename> source, too.  If the Debian revision  
 number of such package is neither <literal>1</literal> nor  
 <literal>0</literal>, you must provide <command>dpkg-buildpackage</command>  
 command with the <literal>-sa</literal> option.  On the other hand, the  
 <literal>-sd</literal> option will force to exclude the original  
 <filename>orig.tar.gz</filename> source.  
 </para>  
 </section>  
4237  <section id="debuild"><title><command>debuild</command> command</title>  <section id="debuild"><title><command>debuild</command> command</title>
4238  <para>  <para>
4239  You can automate package build process of the  You can automate the <command>dpkg-buildpackage</command> command's
4240  <command>dpkg-buildpackage</command> command further with the  package build process further with the
4241  <command>debuild</command> command.  See <citerefentry>  <command>debuild</command> command.  See <citerefentry>
4242  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>
4243  </citerefentry>.  </citerefentry>.
# Line 4113  You can automate package build process o Line 4245  You can automate package build process o
4245  <para>  <para>
4246  Customization of the <command>debuild</command> command can be done through  Customization of the <command>debuild</command> command can be done through
4247  <filename>/etc/devscripts.conf</filename> or  <filename>/etc/devscripts.conf</filename> or
4248  <filename>~/.devscripts</filename>.  I would suggest at least following items:  <filename>~/.devscripts</filename>.  I would suggest at least the following items:
4249  </para>  </para>
4250  <screen>  <screen>
4251  DEBSIGN_KEYID=Your_GPG_keyID  DEBSIGN_KEYID=Your_GPG_keyID
 DEBUILD_LINTIAN=yes  
4252  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides
4253  </screen>  </screen>
4254  <para>  <para>
4255  With these, packages are signed by your specified GPG key ID (good for  With these, packages are signed by your specified GPG key ID (good for
4256  sponsoring packages) and checked by the <command>lintian</command> command in  sponsoring packages) and checked in detail by the <command>lintian</command> command.
 details.  
4257  </para>  </para>
4258  <para>  <para>
4259  Cleaning source and rebuilding package from a user account is as simple as:  Cleaning the source and rebuilding the package from your user account is as simple as:
4260  </para>  </para>
4261  <screen>  <screen>
4262  $ debuild  $ debuild
4263  </screen>  </screen>
4264  <para>  <para>
4265  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4266  <literal>-sa</literal> to include the original <filename>orig.tar.gz</filename>  promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4267  source can be specified as:  <filename>.changes</filename> file as:
4268  </para>  </para>
4269  <screen>  <screen>
4270  $ debuild -sa  $ debuild -us -uc
4271  </screen>  </screen>
4272  <para>  <para>
4273  You can clean source tree as simple as:  You can clean the source tree as simply as:
4274  </para>  </para>
4275  <screen>  <screen>
4276  $ debuild clean  $ debuild clean
# Line 4150  $ debuild clean Line 4280  $ debuild clean
4280  <para>  <para>
4281  For a clean room (<command>chroot</command>) build environment to verify the  For a clean room (<command>chroot</command>) build environment to verify the
4282  build dependencies, the <systemitem role="package">pbuilder</systemitem>  build dependencies, the <systemitem role="package">pbuilder</systemitem>
4283  package is very useful.  <footnote><para> Since the <systemitem role="package">pbuilder</systemitem> package is still evolving, you have to  package is very useful.  <footnote><para> Since the <systemitem
4284    role="package">pbuilder</systemitem> package is still evolving, you should
4285  check the actual configuration situation by consulting the latest official  check the actual configuration situation by consulting the latest official
4286  documentation.</para> </footnote> This ensures a clean build from the source  documentation.</para> </footnote> This ensures a clean build from the source
4287  under the <literal>sid</literal> auto-builder for different architectures and  under the <literal>sid</literal> auto-builder for different architectures and
4288  avoids the severity serious FTBFS (Fails To Build From Source) bug which is  avoids a severity serious FTBFS (Fails To Build From Source) bug which is
4289  always in the RC (release critical) category.  always in the RC (release critical) category.
4290  <footnote><para>See <ulink url="&buildd-do;"/> for more on the  <footnote><para>See <ulink url="&buildd-do;"/> for more on
4291  auto-builder of the Debian package.</para></footnote>  Debian package auto-building.</para></footnote>
4292  </para>  </para>
4293  <para>  <para>
4294  Let's customize the <systemitem role="package">pbuilder</systemitem> package by  Let's customize the <systemitem role="package">pbuilder</systemitem> package as
4295  the following.  follows:
4296  </para>  </para>
4297  <itemizedlist>  <itemizedlist>
4298  <listitem>  <listitem>
4299  <para>  <para>
4300  setting <filename>/var/cache/pbuilder/result</filename> directory writable by  setting the <filename>/var/cache/pbuilder/result</filename> directory writable by
4301  the user.  for your user account.
4302  </para>  </para>
4303  </listitem>  </listitem>
4304  <listitem>  <listitem>
4305  <para>  <para>
4306  creating a directory, e.g.  creating a directory, e.g.
4307  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,
4308  writable by the user to place hook scripts.  writable by the user, to place hook scripts in.
4309  </para>  </para>
4310  </listitem>  </listitem>
4311  <listitem>  <listitem>
4312  <para>  <para>
4313  setting <filename>~/.pbuilderrc</filename> or  configuring <filename>~/.pbuilderrc</filename> or
4314  <filename>/etc/pbuilderrc</filename> to include as follows.  <filename>/etc/pbuilderrc</filename> to include the followsing.
4315  </para>  </para>
4316  <screen>  <screen>
4317  AUTO_DEBSIGN=yes  AUTO_DEBSIGN=${AUTO_DEBSIGN:-yes}
4318  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>
4319  </screen>  </screen>
4320  </listitem>  </listitem>
# Line 4193  This will allow you to sign generated pa Line 4324  This will allow you to sign generated pa
4324  <filename>~/.gnupg/</filename> directory.  <filename>~/.gnupg/</filename> directory.
4325  </para>  </para>
4326  <para>  <para>
4327  Let's then initialize the local <systemitem role="package">pbuilder</systemitem> <command>chroot</command> system first as  First let's initialize the local <systemitem role="package">pbuilder</systemitem> <command>chroot</command> system as
4328  follows.  follows.
4329  </para>  </para>
4330  <screen>  <screen>
4331  $ sudo pbuilder create  $ sudo pbuilder create
4332  </screen>  </screen>
4333  <para>  <para>
4334  If you already have the completed source packages, issue the following commands  If you already have a completed source package, issue the following commands
4335  in the directory where the  in the directory where the
4336  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,
4337  <filename><replaceable>foo</replaceable>.debian.tar.gz</filename>, and  <filename><replaceable>foo</replaceable>.debian.tar.gz</filename>, and
# Line 4210  the local <systemitem role="package">pbu Line 4341  the local <systemitem role="package">pbu
4341  </para>  </para>
4342  <screen>  <screen>
4343  $ sudo pbuilder --update  $ sudo pbuilder --update
4344  $ sudo pbuilder --build <replaceable>foo</replaceable>.dsc  $ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc
4345  </screen>  </screen>
4346  <para>  <para>
4347  Please note that the <command>dpkg-buildpackage</command> option  The newly built packages without the GPG signatures will be located in
4348  <literal>-sa</literal> to include the original <filename>orig.tar.gz</filename>  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.
 source can be specified as:  
4349  </para>  </para>
 <screen>  
 $ sudo pbuilder --build --debbuildopts -sa <replaceable>foo</replaceable>.dsc  
 </screen>  
4350  <para>  <para>
4351  The newly built packages will be located in  The GPG signatures on the <filename>.dsc</filename> file and the
4352  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.  <filename>.changes</filename> file can be generated as:
4353  </para>  </para>
4354    <screen>
4355    $ cd /var/cache/pbuilder/result/
4356    $ debsign <replaceable>foo_version</replaceable>.dsc
4357    $ debsign <replaceable>foo_version_arch</replaceable>.changes
4358    </screen>
4359  <para>  <para>
4360  If you already have the updated source tree without generating the matching  If you have an updated source tree but have not generated the matching
4361  source packages, issue the following commands in the source directory where the  source package, issue the following commands in the source directory where the
4362  <filename>debian</filename> directory exists, instead.  <filename>debian</filename> directory exists, instead.
4363  </para>  </para>
4364  <screen>  <screen>
# Line 4234  $ sudo pbuilder --update Line 4366  $ sudo pbuilder --update
4366  $ pdebuild  $ pdebuild
4367  </screen>  </screen>
4368  <para>  <para>
4369  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4370  <literal>-sa</literal> to include the original <filename>orig.tar.gz</filename>  promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4371  source can be specified as:  <filename>.changes</filename> file as:
4372  </para>  </para>
4373  <screen>  <screen>
4374  $ pdebuild --debbuildopts -sa  $ AUTO_DEBSIGN=no pdebuild
4375  </screen>  </screen>
4376  <para>  <para>
4377  You can log into its <command>chroot</command> environment with the  You can log into its <command>chroot</command> environment with the
# Line 4253  the <literal>chroot</literal> environmen Line 4385  the <literal>chroot</literal> environmen
4385  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>
4386  configured as follows.  <footnote><para> This assumes  configured as follows.  <footnote><para> This assumes
4387  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many
4388  examples of the hook script in the  examples of hook scripts in the
4389  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>
4390  </footnote>  </footnote>
4391  </para>  </para>
# Line 4272  echo +++ end of lintian output +++ Line 4404  echo +++ end of lintian output +++
4404  </screen>  </screen>
4405  <para>  <para>
4406  You need to have access to the latest <literal>sid</literal> environment to  You need to have access to the latest <literal>sid</literal> environment to
4407  build packages properly for <literal>sid</literal>.  In reality,  build packages properly for <literal>sid</literal>.  In practice,
4408  <literal>sid</literal> may be experiencing issues which makes it not desirable  <literal>sid</literal> may be experiencing issues which makes it undesirable
4409  for you to migrate your whole system.  The <systemitem role="package">pbuilder</systemitem> package can help you to cope with this  for you to migrate your whole system.  The <systemitem role="package">pbuilder</systemitem> package can help you to cope with this
4410  kind of situation.  kind of situation.
4411  </para>  </para>
# Line 4282  You may need to update your <literal>sta Line 4414  You may need to update your <literal>sta
4414  release for <literal>stable-proposed-updates</literal>,  release for <literal>stable-proposed-updates</literal>,
4415  <literal>stable/updates</literal>, etc.  <footnote><para> There are some  <literal>stable/updates</literal>, etc.  <footnote><para> There are some
4416  restrictions for such updates of your <literal>stable</literal> package.  restrictions for such updates of your <literal>stable</literal> package.
4417  </para> </footnote> For such occasions, I am running <literal>sid</literal>  </para> </footnote> For such occasions, the fact you may be running a <literal>sid</literal>
4418  system is not good enough excuse not to update them promptly.  The <systemitem role="package">pbuilder</systemitem> package can help you to access  system is not a good enough excuse for failing to update them promptly.  The <systemitem role="package">pbuilder</systemitem> package can help you to access
4419  environments of almost any Debian derivative distributions of the same CPU  environments of almost any Debian derivative distribution of the same CPU
4420  architecture.  architecture.
4421  </para>  </para>
4422  <para>  <para>
# Line 4298  See <ulink url="&pbuilder;"/>, Line 4430  See <ulink url="&pbuilder;"/>,
4430  </section>  </section>
4431  <section id="git-buildpackage"><title><command>git-buildpackage</command> command and similars</title>  <section id="git-buildpackage"><title><command>git-buildpackage</command> command and similars</title>
4432  <para>  <para>
4433  If your upstream uses the source code management system (VCS)  If your upstream uses a source code management system (VCS)
4434  <footnote><para>See <ulink url="&debref-vcs;">Version control systems</ulink> for more.</para></footnote>  <footnote><para>See <ulink url="&debref-vcs;">Version control systems</ulink> for more.</para></footnote>
4435  to maintain their code, you should consider to use them.  That makes merging  to maintain their code, you should consider using it as well.  This makes merging
4436  and cherry-picking upstream patches much easier.  There are several specialized  and cherry-picking upstream patches much easier.  There are several specialized
4437  wrapper script packages for the Debian package building for each VCS.  wrapper script packages for Debian package building for each VCS.
4438  </para>  </para>
4439  <itemizedlist>  <itemizedlist>
4440  <listitem>  <listitem>
4441  <para>  <para>
4442  <systemitem role="package">git-buildpackage</systemitem>: Suite to help with  <systemitem role="package">git-buildpackage</systemitem>: a suite to help with
4443  Debian packages in Git repositories.  Debian packages in Git repositories.
4444  </para>  </para>
4445  </listitem>  </listitem>
# Line 4319  maintain Debian packages with Subversion Line 4451  maintain Debian packages with Subversion
4451  </listitem>  </listitem>
4452  <listitem>  <listitem>
4453  <para>  <para>
4454  <systemitem role="package">cvs-buildpackage</systemitem>: A set of Debian  <systemitem role="package">cvs-buildpackage</systemitem>: a set of Debian
4455  package scripts for CVS source trees.  package scripts for CVS source trees.
4456  </para>  </para>
4457  </listitem>  </listitem>
4458  </itemizedlist>  </itemizedlist>
4459  <para>  <para>
4460  There are packages which <emphasis>automate</emphasis> building of packages  For advanced audiences, there are packages which <emphasis>automate</emphasis>
4461  under VCS managed source tree for advanced audiences.  I will not explain them  the building of packages under a VCS-managed source tree.  I will not explain them
4462  in this tutorial.  in this tutorial.
4463  <footnote><para> Here are few web resources available for advanced audiences.  </para>  <footnote><para> Here are some web resources available for advanced audiences.  </para>
4464  <itemizedlist>  <itemizedlist>
4465  <listitem> <para> <ulink url="&git-buildpackage-doc;">Building Debian Packages with git-buildpackage</ulink> </para> </listitem>  <listitem> <para> <ulink url="&git-buildpackage-doc;">Building Debian Packages with git-buildpackage</ulink> </para> </listitem>
4466  <listitem> <para> <ulink url="&debian-packages-git;">debian packages in git</ulink> </para> </listitem>  <listitem> <para> <ulink url="&debian-packages-git;">debian packages in git</ulink> </para> </listitem>
4467  <listitem> <para> <ulink url="&git-debian-packaging;">Using Git for Debian Packaging</ulink> </para> </listitem>  <listitem> <para> <ulink url="&git-debian-packaging;">Using Git for Debian Packaging</ulink> </para> </listitem>
4468  <listitem> <para> <ulink url="&git-dpm;">git-dpm: Debian packages in Git manager</ulink> </para> </listitem>  <listitem> <para> <ulink url="&git-dpm;">git-dpm: Debian packages in Git manager</ulink> </para> </listitem>
4469  <listitem> <para> <ulink url="&topgit;">Using TopGit to generate quilt series for Debian packaging</ulink> </para> </listitem>  <listitem> <para> <ulink url="&topgit;">Using TopGit to generate quilt series for Debian packaging</ulink> </para> </listitem>
# Line 4342  in this tutorial. Line 4474  in this tutorial.
4474  <section id="quickrebuild"><title>Quick rebuild</title>  <section id="quickrebuild"><title>Quick rebuild</title>
4475  <para>  <para>
4476  With a large package, you may not want to rebuild from scratch every time while  With a large package, you may not want to rebuild from scratch every time while
4477  you tune details in <filename>debian/rules</filename>.  For testing purposes,  you're tuning details in <filename>debian/rules</filename>.  For testing purposes,
4478  you can make a <filename>.deb</filename> file without rebuilding the upstream  you can make a <filename>.deb</filename> file without rebuilding the upstream
4479  sources like this <footnote><para> Environment variables which are normally  sources like this<footnote><para> Environment variables which are normally
4480  configured to proper values are not set by this method.  Never create real  configured to proper values are not set by this method.  Never create real
4481  packages to be uploaded using this <emphasis role="strong">quick</emphasis>  packages to be uploaded using this <emphasis role="strong">quick</emphasis>
4482  method.  </para> </footnote>:  method.  </para> </footnote>:
# Line 4353  method.  </para> </footnote>: Line 4485  method.  </para> </footnote>:
4485  $ fakeroot debian/rules binary  $ fakeroot debian/rules binary
4486  </screen>  </screen>
4487  <para>  <para>
4488  Or, simply as following to see if it build or not.  Or simply do the following to see if it builds or not:
4489  </para>  </para>
4490  <screen>  <screen>
4491  $ fakeroot debian/rules build  $ fakeroot debian/rules build
# Line 4367  proper procedure.  You may not be able t Line 4499  proper procedure.  You may not be able t
4499  </chapter>  </chapter>
4500  <chapter id="checkit"><title>Checking the package for errors</title>  <chapter id="checkit"><title>Checking the package for errors</title>
4501  <para>  <para>
4502  There are few chores you should know to check the package for errors by  There are some techniques you should know for checking a package for errors
4503  yourself before uploading packages to public archives.  before uploading it to the public archives.
4504    </para>
4505    <para>
4506    It's also a good idea to carry out testing on a machine other than your own.  You must watch
4507    closely for any warnings or errors for all the tests described here.
4508  </para>  </para>
4509    <section id="inadvent"><title>Suspicious changes</title>
4510  <para>  <para>
4511  Testing on machine other than your own is also good idea.  You must watch  If you find a new autogenerated patch file such as
4512  closely for any warnings or errors for all the test described here.  <filename>debian-changes-*</filename> in the
4513    <filename>debian/patches</filename> directory after building your non-native
4514    Debian package in <literal>3.0 (quilt)</literal> format, chances are you
4515    changed some files by accident or the build script modified the upstream
4516    source.  If it is your mistake, fix it.  If it is caused by the build script,
4517    fix the root cause with <command>dh-autoreconf</command> as in
4518    <xref linkend="customrules"/> or work around it with
4519    <filename>source/options</filename> as in <xref linkend="sourceopt"/>.
4520  </para>  </para>
4521  <section id="pinstall"><title>Verifying package for install</title>  </section>
4522    <section id="pinstall"><title>Verifying a package's installation</title>
4523  <para>  <para>
4524  You must test your package if it installs without problem.  The <citerefentry>  You must test your package for whether it installs without problem.  The <citerefentry>
4525  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4526  command helps you to test to install all the generated binary packages.  command helps you to test installing all the generated binary packages.
4527  </para>  </para>
4528  <screen>  <screen>
4529  $ sudo debi gentoo_0.9.12-1_i386.changes  $ sudo debi gentoo_0.9.12-1_i386.changes
4530  </screen>  </screen>
4531  <para>  <para>
4532  You have to make sure that there are no overlapped files with other existing  To prevent installation problem on different systems, you must make
4533  packages using the  sure that there are no filenames conflicting with other existing packages,
4534    using the
4535  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded
4536  from the Debian archive to prevent installation problem on different systems.  from the Debian archive,
4537  The <command>apt-file</command> command may be handy for this task.  If there  The <command>apt-file</command> command may be handy for this task.  If there
4538  are overlapped files, please take actions to avoid the real problem using the  are collisions, please take action to avoid this real problem, whether by
4539  alternatives mechanism (see <citerefentry>  renaming the file, moving a common file to a separate package that
4540  <refentrytitle>update-alternatives</refentrytitle> <manvolnum>1</manvolnum>  multiple packages can depend on, using the alternatives mechanism (see
4541  </citerefentry>) by coordinating with other affected packages or by setting the  <citerefentry><refentrytitle>update-alternatives</refentrytitle>
4542  <literal>Conflicts</literal> entry in the <filename>debian/control</filename>  <manvolnum>1</manvolnum></citerefentry>) in coordination with the
4543  file.  maintainers of other affected packages, or declaring a
4544    <literal>Conflicts</literal> relationship in the
4545    <filename>debian/control</filename> file.
4546  </para>  </para>
4547  </section>  </section>
4548  <section id="pmaintscripts"><title>Verifying package for <emphasis>maintainer scripts</emphasis></title>  <section id="pmaintscripts"><title>Verifying a package's maintainer scripts</title>
4549  <para>  <para>
4550  All <emphasis>maintainer scripts</emphasis>, i.e.,  All maintainer scripts (that is,
4551  <filename>preinst</filename>, <filename>prerm</filename>,  <filename>preinst</filename>, <filename>prerm</filename>,
4552  <filename>postinst</filename>, and <filename>postrm</filename> files, are  <filename>postinst</filename>, and <filename>postrm</filename> files) are
4553  non-trivial unless they are auto-generated by the <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are  hard to write correctly unless they are auto-generated by the
4554    <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are
4555  a novice maintainer (see <xref linkend="maintscripts"/>).  a novice maintainer (see <xref linkend="maintscripts"/>).
4556  </para>  </para>
4557  <para>  <para>
4558  If the package makes use of these non-trivial <emphasis>maintainer  If the package makes use of these non-trivial maintainer scripts, be sure to test not only for install but also for remove,
4559  scripts</emphasis>, be sure to test not only for install but also for remove,  purge, and upgrade processes.  Many maintainer script bugs show up
 purge, and upgrade.  Many <emphasis>maintainer script</emphasis> bugs show up  
4560  when packages are removed or purged.  Use the <command>dpkg</command> command  when packages are removed or purged.  Use the <command>dpkg</command> command
4561  as follows to test them.  as follows to test them.
4562  </para>  </para>
# Line 4472  people will often be upgrading to your p Line 4620  people will often be upgrading to your p
4620  last Debian release.  Remember to test upgrades from that version too.  last Debian release.  Remember to test upgrades from that version too.
4621  </para>  </para>
4622  <para>  <para>
4623  Although downgrade is not officially supported, it should be nice to support  Although downgrading is not officially supported, supporting it is a
4624  it.  friendly gesture.
4625  </para>  </para>
4626  </section>  </section>
4627  <section id="lintians"><title><systemitem role="package">lintian</systemitem> package</title>  <section id="lintians"><title>Using <systemitem role="package">lintian</systemitem></title>
4628  <para>  <para>
4629  Run <citerefentry> <refentrytitle>lintian</refentrytitle>  Run <citerefentry> <refentrytitle>lintian</refentrytitle>
4630  <manvolnum>1</manvolnum> </citerefentry> on your <filename>.changes</filename>  <manvolnum>1</manvolnum> </citerefentry> on your <filename>.changes</filename>
# Line 4493  $ lintian -i -I --show-overrides gentoo_ Line 4641  $ lintian -i -I --show-overrides gentoo_
4641  <para>  <para>
4642  Of course, replace the filename with the name of the  Of course, replace the filename with the name of the
4643  <filename>.changes</filename> file generated for your package.  The output of  <filename>.changes</filename> file generated for your package.  The output of
4644  the <command>lintian</command> command are marked as follows.  the <command>lintian</command> command uses the following flags.
4645  </para>  </para>
4646  <itemizedlist>  <itemizedlist>
4647  <listitem>  <listitem>
4648  <para>  <para>
4649  <literal>E:</literal> for error; a sure policy violation or a packaging error.  <literal>E:</literal> for error; a sure policy violation or packaging error.
4650  </para>  </para>
4651  </listitem>  </listitem>
4652  <listitem>  <listitem>
4653  <para>  <para>
4654  <literal>W:</literal> for warning; a possible policy violation or a packaging  <literal>W:</literal> for warning; a possible policy violation or packaging
4655  error.  error.
4656  </para>  </para>
4657  </listitem>  </listitem>
4658  <listitem>  <listitem>
4659  <para>  <para>
4660  <literal>I:</literal> for info; a information on certain packaging aspects.  <literal>I:</literal> for info; information on certain aspects of packaging.
4661  </para>  </para>
4662  </listitem>  </listitem>
4663  <listitem>  <listitem>
# Line 4526  error. Line 4674  error.
4674  </listitem>  </listitem>
4675  </itemizedlist>  </itemizedlist>
4676  <para>  <para>
4677  For warnings, tune the package to avoid them or verify that the warnings are  When you see warnings, tune the package to avoid them or verify that the warnings are
4678  spurious.  If spurious, set the <filename>lintian-overrides</filename> files as  spurious.  If spurious, set up <filename>lintian-overrides</filename> files as
4679  described in <xref linkend="lintian"/>.  described in <xref linkend="lintian"/>.
4680  </para>  </para>
4681  <para>  <para>
4682  Note that you can build the package with <command>dpkg-buildpackage</command>  Note that you can build the package with <command>dpkg-buildpackage</command>
4683  and run <command>lintian</command> on it in one command with <citerefentry>  and run <command>lintian</command> on it in one command, if you use <citerefentry>
4684  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4685  or with <citerefentry> <refentrytitle>pdebuild</refentrytitle>  or <citerefentry> <refentrytitle>pdebuild</refentrytitle>
4686  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
4687  </para>  </para>
4688  </section>  </section>
4689  <section id="debc"><title><command>debc</command> command</title>  <section id="debc"><title>The <command>debc</command> command</title>
4690  <para>  <para>
4691  You can list files in the binary Debian package by <citerefentry>  You can list files in the binary Debian package with the <citerefentry>
4692  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4693  command.  command.
4694  </para>  </para>
# Line 4548  command. Line 4696  command.
4696  $ debc <replaceable>package</replaceable>.changes  $ debc <replaceable>package</replaceable>.changes
4697  </screen>  </screen>
4698  </section>  </section>
4699  <section id="debdiff"><title><command>debdiff</command> command</title>  <section id="debdiff"><title>The <command>debdiff</command> command</title>
4700  <para>  <para>
4701  You can compare file contents in two source Debian packages with the  You can compare file contents in two source Debian packages with the
4702  <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum>
# Line 4566  You can also compare file lists in two s Line 4714  You can also compare file lists in two s
4714  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes
4715  </screen>  </screen>
4716  <para>  <para>
4717  These are useful to identify what has been changed in the source packages, if  These are useful to identify what has been changed in the source packages
4718  no files have been unintentionally misplaced or removed in the binary packages,  and to check for inadvertent changes made when updating binary
4719  and if no other inadvertent changes were made when updating binary packages.  packages, such as unintentionally misplacing or removing files.
4720  </para>  </para>
4721  </section>  </section>
4722  <section id="interdiff"><title><command>interdiff</command> command</title>  <section id="interdiff"><title>The <command>interdiff</command> command</title>
4723  <para>  <para>
4724  You can compare two <filename>diff.gz</filename> files with the <citerefentry>  You can compare two <filename>diff.gz</filename> files with the <citerefentry>
4725  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>
# Line 4588  files as described in <xref linkend="pat Line 4736  files as described in <xref linkend="pat
4736  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.
4737  </para>  </para>
4738  </section>  </section>
4739  <section id="mc"><title><command>mc</command> command</title>  <section id="mc"><title>The <command>mc</command> command</title>
4740  <para>  <para>
4741  Many of these file inspection operations can be made into an intuitive process  Many of these file inspection operations can be made into an intuitive process
4742  by using a file manager like <citerefentry> <refentrytitle>mc</refentrytitle>  by using a file manager like <citerefentry> <refentrytitle>mc</refentrytitle>
# Line 4600  contents of <filename>*.deb</filename> p Line 4748  contents of <filename>*.deb</filename> p
4748  <para>  <para>
4749  Be on the lookout for extra unneeded files or zero length files, both in the  Be on the lookout for extra unneeded files or zero length files, both in the
4750  binary and source package.  Often cruft doesn't get cleaned up properly; adjust  binary and source package.  Often cruft doesn't get cleaned up properly; adjust
4751  your <filename>rules</filename> file to compensate for that.  your <filename>rules</filename> file to compensate for this.
4752  </para>  </para>
4753  </section>  </section>
4754  </chapter>  </chapter>
# Line 4613  a public archive to share it. Line 4761  a public archive to share it.
4761  <para>  <para>
4762  Once you become an official developer,  Once you become an official developer,
4763  <footnote><para>  <footnote><para>
4764  See <xref linkend="socialdynamism"/>.  See <xref linkend="socialdynamics"/>.
4765  </para></footnote>  </para></footnote>
4766  you can upload the package to the Debian archive.  you can upload the package to the Debian archive.
4767  <footnote><para>  <footnote><para>
4768  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>
4769  which work almost the same way as Debian archive and provide upload area for  which work almost the same way as the Debian archive and provide an upload area for
4770  the non-DD.  You can set up an equivalent archive by yourself using tools  non-DDs.  You can set up an equivalent archive by yourself using the tools
4771  listed at <ulink url="&deb-archive;"/>.  So this section is useful for the  listed at <ulink url="&deb-archive;"/>.  So this section is useful for
4772  non-DD, too.  non-DDs, too.
4773  </para></footnote>  </para></footnote>
4774  You can do this manually, but it's easier to use the existing  You can do this manually, but it's easier to use the existing
4775  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>
# Line 4629  automated tools, like <citerefentry> <re Line 4777  automated tools, like <citerefentry> <re
4777  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
4778  We'll describe how it's done with <command>dupload</command>.  <footnote><para>  We'll describe how it's done with <command>dupload</command>.  <footnote><para>
4779  The <systemitem role="package">dput</systemitem> package seems to come with  The <systemitem role="package">dput</systemitem> package seems to come with
4780  more features and becoming more popular than the <systemitem role="package">dupload</systemitem> package.  It uses the  more features and to be becoming more popular than the <systemitem role="package">dupload</systemitem> package.  It uses the
4781  <filename>/etc/dput</filename> file for the global configuration and the  file <filename>/etc/dput</filename> for its global configuration and the
4782  <filename>~/.dput.cf</filename> file for the per-user one.  It supports Ubuntu  file <filename>~/.dput.cf</filename> for per-user configuration.  It supports
4783  related services out-of-box, too.  </para> </footnote>  Ubuntu-related services out-of-the-box, too.  </para> </footnote>
4784  </para>  </para>
4785  <para>  <para>
4786  First you have to set up <command>dupload</command>'s config file.  You can  First you have to set up <command>dupload</command>'s config file.  You can
# Line 4649  these options means. Line 4797  these options means.
4797  The <literal>$default_host</literal> option determines which of the upload  The <literal>$default_host</literal> option determines which of the upload
4798  queues will be used by default.  <literal>anonymous-ftp-master</literal> is the  queues will be used by default.  <literal>anonymous-ftp-master</literal> is the
4799  primary one, but it's possible that you will want to use another one.  primary one, but it's possible that you will want to use another one.
4800  <footnote><para>See <ulink url="&devref-upload;">Debian Developer's Reference 5.6. 'Uploading a package'</ulink>.</para></footnote>  <footnote><para>See <ulink url="&devref-upload;">Debian Developer's Reference 5.6. "Uploading a package"</ulink>.</para></footnote>
4801  </para>  </para>
4802  <para>  <para>
4803  While connected to the Internet, you can upload your package by the following:  While connected to the Internet, you can upload your package as follows:
4804  </para>  </para>
4805  <screen>  <screen>
4806  $ dupload gentoo_0.9.12-1_i386.changes  $ dupload gentoo_0.9.12-1_i386.changes
4807  </screen>  </screen>
4808  <para>  <para>
4809  <command>dupload</command> checks that the MD5/SHA1/SHA256 checksums of the  <command>dupload</command> checks that the SHA1/SHA256 file checksums
4810  files match those from the <filename>.changes</filename> file.  If they do not  match those listed in the <filename>.changes</filename> file.  If they do not
4811  match, it will warn you to rebuild it as described in <xref linkend="completebuild"/> so it can be properly uploaded.  match, it will warn you to rebuild it as described in <xref linkend="completebuild"/> so it can be properly uploaded.
4812  </para>  </para>
4813  <!--  <!--
# Line 4669  will ask for your password on Debian mac Line 4817  will ask for your password on Debian mac
4817  -->  -->
4818  <para>  <para>
4819  If you encounter an upload problem at <ulink url="&uploadqueue;"/>, you can fix this  If you encounter an upload problem at <ulink url="&uploadqueue;"/>, you can fix this
4820  by manually uploading GPG signed <filename>*.commands</filename> file to there  by manually uploading a GPG-signed <filename>*.commands</filename> file to there
4821  with <command>ftp</command>.  <footnote><para> See <ulink url="&uploadqueue-readme;"/>.  Alternatively, you may  with <command>ftp</command>.  <footnote><para> See <ulink url="&uploadqueue-readme;"/>.  Alternatively, you can
4822  use <command>dcut</command> command from the <systemitem role="package">dput</systemitem> package.  </para> </footnote> For example, use  use the <command>dcut</command> command from the <systemitem
4823    role="package">dput</systemitem> package.  </para> </footnote> For example, using
4824  <filename>hello.commands</filename>:  <filename>hello.commands</filename>:
4825  </para>  </para>
4826  <screen>  <screen>
4827  -----BEGIN PGP SIGNED MESSAGE-----  -----BEGIN PGP SIGNED MESSAGE-----
4828    Hash: SHA1
4829  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;
4830  Commands:  Commands:
4831   rm hello_1.0-1_i386.deb   rm hello_1.0-1_i386.deb
4832   mv hello_1.0-1.dsx hello_1.0-1.dsc   mv hello_1.0-1.dsx hello_1.0-1.dsc
4833  -----BEGIN PGP SIGNATURE-----  -----BEGIN PGP SIGNATURE-----
4834  Version: 2.6.3ia  Version: GnuPG v1.4.10 (GNU/Linux)
4835  iQCVAwUBNFiQSXVhJ0HiWnvJAQG58AP+IDJVeSWmDvzMUphScg1EK0mvChgnuD7h  
4836  BRiVQubXkB2DphLJW5UUSRnjw1iuFcYwH/lFpNpl7XP95LkLX3iFza9qItw4k2/q  [...]
 tvylZkmIA9jxCyv/YB6zZCbHmbvUnL473eLRoxlnYZd3JFaCZMJ86B0Ph4GFNPAf  
 Z4jxNrgh7Bc=  
 =pH94  
4837  -----END PGP SIGNATURE-----  -----END PGP SIGNATURE-----
4838  </screen>  </screen>
4839  </section>  </section>
4840    <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>
4841    <para>
4842    When you first upload the package to the archive, you need to include the
4843    original <filename>orig.tar.gz</filename> source, too.  If the Debian revision
4844    number of this package is neither <literal>1</literal> nor
4845    <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command>
4846    option <literal>-sa</literal>.
4847    </para>
4848    <para>
4849    For the <command>dpkg-buildpackage</command> command:
4850    </para>
4851    <screen>
4852    $ dpkg-buildpackage -sa
4853    </screen>
4854    <para>
4855    For the <command>debuild</command> command:
4856    </para>
4857    <screen>
4858    $ debuild -sa
4859    </screen>
4860    <para>
4861    For the <command>debuild</command> command:
4862    </para>
4863    <screen>
4864    $ pdebuild --debbuildopts -sa
4865    </screen>
4866    <para>
4867    On the other hand, the <literal>-sd</literal> option will force the exclusion
4868    of the original <filename>orig.tar.gz</filename> source.
4869    </para>
4870    </section>
4871  <section id="skipped-uploads"><title>Skipped uploads</title>  <section id="skipped-uploads"><title>Skipped uploads</title>
4872  <para>  <para>
4873  If you created multiple entries in <filename>debian/changelog</filename> by  If you created multiple entries in <filename>debian/changelog</filename> by
4874  skipping uploads, you must create a proper <filename>*_.changes</filename> file  skipping uploads, you must create a proper <filename>*_.changes</filename> file
4875  which includes all changes from the last upload.  which includes all changes from the last upload.
4876    This can be done by specifying the <command>dpkg-buildpackage</command> option
4877    <literal>-v</literal> with the version, e.g.,
4878    <literal><replaceable>1.2</replaceable></literal>.
4879  </para>  </para>
4880  <para>  <para>
4881  This can be done by specifying <literal>-v</literal> option to the package  For the <command>dpkg-buildpackage</command> command:
 building programs such as <command>dpkg-buildpackage</command>,  
 <command>debuild</command>, <command>pdebuild</command>, etc.  
4882  </para>  </para>
4883    <screen>
4884    $ dpkg-buildpackage -v<replaceable>1.2</replaceable>
4885    </screen>
4886    <para>
4887    For the <command>debuild</command> command:
4888    </para>
4889    <screen>
4890    $ debuild -v<replaceable>1.2</replaceable>
4891    </screen>
4892    <para>
4893    For the <command>debuild</command> command:
4894    </para>
4895    <screen>
4896    $ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>"
4897    </screen>
4898  </section>  </section>
4899  </chapter>  </chapter>
4900  <chapter id="update"><title>Updating the package</title>  <chapter id="update"><title>Updating the package</title>
4901  <para>  <para>
4902  Once you release a package, you need to update it soon.  After you release a package, you will soon need to update it.
4903  </para>  </para>
4904  <section id="newrevision"><title>New Debian revision</title>  <section id="newrevision"><title>New Debian revision</title>
4905  <para>  <para>
4906  Let's say that a bug report was filed against your package as  Let's say that a bug report was filed against your package as
4907  <literal>#54321</literal>, and it describes a problem that you can solve.  To  <literal>#654321</literal>, and it describes a problem that you can solve.
4908  create a new Debian revision of the package, you need to:  Here's what you need to do to create a new Debian revision of the package.
4909  </para>  </para>
4910  <itemizedlist>  <itemizedlist>
4911  <listitem>  <listitem>
# Line 4722  If this is to be recorded as a new patch Line 4916  If this is to be recorded as a new patch
4916  <listitem>  <listitem>
4917  <para>  <para>
4918  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set
4919  patch name;  the patch name;
4920  </para>  </para>
4921  </listitem>  </listitem>
4922  <listitem>  <listitem>
4923  <para>  <para>
4924  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare
4925  file to be modified;  the file to be modified;
4926  </para>  </para>
4927  </listitem>  </listitem>
4928  <listitem>  <listitem>
# Line 4738  Correct the problem in the package sourc Line 4932  Correct the problem in the package sourc
4932  </listitem>  </listitem>
4933  <listitem>  <listitem>
4934  <para>  <para>
4935  <literal>dquilt refresh</literal> to record to  <literal>dquilt refresh</literal> to record it to
4936  <filename><replaceable>bugname.patch</replaceable></filename>;  <filename><replaceable>bugname.patch</replaceable></filename>;
4937  </para>  </para>
4938  </listitem>  </listitem>
# Line 4757  If this is to update an existing patch, Line 4951  If this is to update an existing patch,
4951  <listitem>  <listitem>
4952  <para>  <para>
4953  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall
4954  existing <filename><replaceable>foo.patch</replaceable></filename>;  the existing <filename><replaceable>foo.patch</replaceable></filename>;
4955  </para>  </para>
4956  </listitem>  </listitem>
4957  <listitem>  <listitem>
# Line 4791  Add a new revision at the top of the Deb Line 4985  Add a new revision at the top of the Deb
4985  file, for example with <literal>dch -i</literal>, or explicitly with  file, for example with <literal>dch -i</literal>, or explicitly with
4986  <literal>dch -v  <literal>dch -v
4987  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>
4988  and then insert the comments using your preferred editor.  <footnote><para> To  and then insert the comments using your preferred editor.  <footnote><para>To
4989  get the date in the required format, use <literal>LANG=C date -R</literal>.  get the date in the required format, use <literal>LANG=C date -R</literal>.
4990  </para> </footnote>  </para> </footnote>
4991  </para>  </para>
# Line 4799  get the date in the required format, use Line 4993  get the date in the required format, use
4993  <listitem>  <listitem>
4994  <para>  <para>
4995  Include a short description of the bug and the solution in the changelog entry,  Include a short description of the bug and the solution in the changelog entry,
4996  followed by <literal>Closes: #54321</literal>.  That way, the bug report will  followed by <literal>Closes: #654321</literal>.  That way, the bug report will
4997  be <emphasis>automagically</emphasis> closed by the archive maintenance  be <emphasis>automagically</emphasis> closed by the archive maintenance
4998  software the moment your package gets accepted in the Debian archive.  software the moment your package gets accepted into the Debian archive.
4999  </para>  </para>
5000  </listitem>  </listitem>
5001  <listitem>  <listitem>
# Line 4818  changed and it already exists in the Deb Line 5012  changed and it already exists in the Deb
5012  </para>  </para>
5013  </listitem>  </listitem>
5014  </itemizedlist>  </itemizedlist>
5015    <para>
5016    One of the tricky case happens when you make a local package to experiment with
5017    the packaging before uploading to the official archive with the normal version,
5018    e.g.,
5019    <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>.
5020    For the smoother upgrade, it is a good idea to create a
5021    <filename>changelog</filename> entry with a version string as
5022    <literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>.
5023    You may unclutter <filename>changelog</filename>
5024    by consolidating such local change entries into a single entry for the official package.
5025    See <xref linkend="namever"/> for the order of version strings.
5026    </para>
5027    <para>
5028    </para>
5029  </section>  </section>
5030  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>
5031  <para>  <para>
5032  When preparing packages of the new upstream release for the Debian archive, you  When preparing packages of a new upstream release for the Debian archive, you
5033  must check the new upstream release, first.  must check the new upstream release, first.
5034  </para>  </para>
5035  <para>  <para>
5036  You start this by reading the upstream <filename>changelog</filename>,  Start by reading the upstream <filename>changelog</filename>,
5037  <filename>NEWS</filename>, and whatever other documentations they may have  <filename>NEWS</filename>, and whatever other documentation they may have
5038  released with the new version.  released with the new version.
5039  </para>  </para>
5040  <para>  <para>
5041  You then inspect changes between the old and new upstream sources as follow to  You can then inspect changes between the old and new upstream sources as follows,
5042  watch out for anything suspicious.  watching out for anything suspicious.
5043  </para>  </para>
5044  <screen>  <screen>
5045  $ diff -urN <replaceable>foo</replaceable>-<replaceable>oldversion</replaceable> <replaceable>foo</replaceable>-<replaceable>newversion</replaceable>  $ diff -urN <replaceable>foo</replaceable>-<replaceable>oldversion</replaceable> <replaceable>foo</replaceable>-<replaceable>newversion</replaceable>
# Line 4843  Changes to some auto-generated files by Line 5051  Changes to some auto-generated files by
5051  <filename>config.sub</filename>, <filename>configure</filename>,  <filename>config.sub</filename>, <filename>configure</filename>,
5052  <filename>depcomp</filename>, <filename>install-sh</filename>,  <filename>depcomp</filename>, <filename>install-sh</filename>,
5053  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be
5054  ignored.  You may erase them before running <command>diff</command> to the  ignored.  You may delete them before running <command>diff</command> on the
5055  source for inspection.  source for inspection.
5056  </para>  </para>
5057  </section>  </section>
# Line 4859  in the new extracted source.  <footnote> Line 5067  in the new extracted source.  <footnote>
5067  old <literal>1.0</literal> format, this can be done by running <literal>zcat  old <literal>1.0</literal> format, this can be done by running <literal>zcat
5068  /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.diff.gz|patch  /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.diff.gz|patch
5069  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of
5070  course, you need to do few obvious chores.  course, you need to do some obvious chores.
5071  </para>  </para>
5072  <itemizedlist>  <itemizedlist>
5073  <listitem>  <listitem>
5074  <para>  <para>
5075  Create a copy of upstream source as the  Create a copy of the upstream source as the
5076  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.
5077  </para>  </para>
5078  </listitem>  </listitem>
# Line 4907  in <filename>.rej</filename> files). Line 5115  in <filename>.rej</filename> files).
5115  <itemizedlist>  <itemizedlist>
5116  <listitem>  <listitem>
5117  <para>  <para>
5118  If a patch you applied to the source was integrated to the upstream source,  If a patch you applied to the source was integrated into the upstream source,
5119  </para>  </para>
5120  <itemizedlist>  <itemizedlist>
5121  <listitem>  <listitem>
# Line 4932  upstream source, Line 5140  upstream source,
5140  <listitem>  <listitem>
5141  <para>  <para>
5142  Edit the <filename><replaceable>baz</replaceable></filename> file manually to  Edit the <filename><replaceable>baz</replaceable></filename> file manually to
5143  realize intended effect of  bring about the intended effect of
5144  <filename><replaceable>baz</replaceable>.rej</filename>.  <filename><replaceable>baz</replaceable>.rej</filename>.
5145  </para>  </para>
5146  </listitem>  </listitem>
# Line 4945  realize intended effect of Line 5153  realize intended effect of
5153  </listitem>  </listitem>
5154  <listitem>  <listitem>
5155  <para>  <para>
5156  Continue back to <literal>while dquilt push; do dquilt refresh; done</literal>.  Continue as usual with <literal>while dquilt push; do dquilt refresh; done</literal>.
5157  </para>  </para>
5158  </listitem>  </listitem>
5159  </itemizedlist>  </itemizedlist>
# Line 4993  You can release this updated source by r Line 5201  You can release this updated source by r
5201  <section id="packagestyle"><title>Updating the packaging style</title>  <section id="packagestyle"><title>Updating the packaging style</title>
5202  <para>  <para>
5203  Updating the package style is not a required activity for the update of a  Updating the package style is not a required activity for the update of a
5204  package.  But, you can use the full capability of the modern <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal>  package.  However, doing so lets you use the full capabilities of the modern
5205  source format by doing this.  <footnote><para> If your sponsor or other  <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal>
5206  maintainers object to updating the existing packaging style, it is not worth  source format.  <footnote><para> If your sponsor or other
5207  bothering nor arguing.  There are more important things to do.  </para>  maintainers object to updating the existing packaging style, don't bother
5208    arguing.  There are more important things to do.  </para>
5209  </footnote>  </footnote>
5210  </para>  </para>
5211  <itemizedlist>  <itemizedlist>
5212  <listitem>  <listitem>
5213  <para>  <para>
5214  If you need to add erased template files for any reason, you may run  If you need to recreate deleted template files for any reason, you can run
5215  <command>dh_make</command> again in the same Debian package source tree with  <command>dh_make</command> again in the same Debian package source tree with
5216  <literal>--addmissing</literal> option.  Then edit them properly.  the <literal>--addmissing</literal> option.  Then edit them appropriately.
5217  </para>  </para>
5218  </listitem>  </listitem>
5219  <listitem>  <listitem>
5220  <para>  <para>
5221  If the package has not updated to use the <systemitem role="package">debhelper</systemitem> V7 <command>dh</command> syntax for the  If the package has not been updated to use the <systemitem role="package">debhelper</systemitem> v7 <command>dh</command> syntax for the
5222  <filename>debian/rules</filename> file, update it to use <command>dh</command>.  <filename>debian/rules</filename> file, update it to use <command>dh</command>.
5223  Update the <filename>debian/control</filename> file accordingly.  Update the <filename>debian/control</filename> file accordingly.
5224  </para>  </para>
# Line 5021  If you want to update the <filename>rule Line 5230  If you want to update the <filename>rule
5230  System (<systemitem role="package">cdbs</systemitem>) to the  System (<systemitem role="package">cdbs</systemitem>) to the
5231  <command>dh</command> syntax, see  <command>dh</command> syntax, see
5232  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its
5233  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the  <literal>DEB_*</literal> configuration variables.
5234    <!--
5235    <footnote><para> In the
5236  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some
5237  negative descriptions of the <filename>rules</filename> file created by the  negative descriptions of the <filename>rules</filename> file created by the
5238  <command>dh_make</command> command for the non-<systemitem role="package">cdbs</systemitem> choices.  Do not worry about it.  It applies  <command>dh_make</command> command for the non-<systemitem role="package">cdbs</systemitem> choices.  Do not worry about it.  It applies
5239  only for <literal>lenny</literal> which created explicit targets with long list  only for <literal>lenny</literal> which created explicit targets with long lists
5240  of <command>dh_*</command> commands.  </para> </footnote>  of <command>dh_*</command> commands.  </para> </footnote>
5241    -->
5242  </para>  </para>
5243  </listitem>  </listitem>
5244  <listitem>  <listitem>
# Line 5035  If you have a <literal>1.0</literal> sou Line 5247  If you have a <literal>1.0</literal> sou
5247  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5248  update it to the newer <literal>3.0 (native)</literal> source format by  update it to the newer <literal>3.0 (native)</literal> source format by
5249  creating <filename>debian/source/format</filename> with <literal>3.0  creating <filename>debian/source/format</filename> with <literal>3.0
5250  (native)</literal>.  The rest of <filename>debian/*</filename> files can be  (native)</literal>.  The rest of the <filename>debian/*</filename> files can just be
5251  just copied.  copied.
5252  </para>  </para>
5253  </listitem>  </listitem>
5254  <listitem>  <listitem>
# Line 5045  If you have a <literal>1.0</literal> sou Line 5257  If you have a <literal>1.0</literal> sou
5257  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5258  update it to the newer <literal>3.0 (quilt)</literal> source format by creating  update it to the newer <literal>3.0 (quilt)</literal> source format by creating
5259  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.
5260  The rest of <filename>debian/*</filename> files can be just copied.  Import the  The rest of the <filename>debian/*</filename> files can just be copied.  Import the
5261  <filename>big.diff</filename> file generated by the <literal>filterdiff -z -x  <filename>big.diff</filename> file generated by the command <literal>filterdiff -z -x
5262  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>
5263  command to your <command>quilt</command> system, if needed.  <footnote><para>  to your <command>quilt</command> system, if needed.  <footnote><para>
5264  You may split <filename>big.diff</filename> into many small incremental patches  You can split <filename>big.diff</filename> into many small incremental patches
5265  using the <command>splitdiff</command> command.  </para> </footnote>  using the <command>splitdiff</command> command.  </para> </footnote>
5266  </para>  </para>
5267  </listitem>  </listitem>
5268  <listitem>  <listitem>
5269  <para>  <para>
5270  If it was packaged with another patch system such as <systemitem role="package">dpatch</systemitem>, <systemitem role="package">dbs</systemitem>, or <systemitem role="package">cdbs</systemitem> with <literal>-p0</literal>,  If it was packaged using another patch system such as <systemitem role="package">dpatch</systemitem>, <systemitem role="package">dbs</systemitem>, or <systemitem role="package">cdbs</systemitem> with <literal>-p0</literal>,
5271  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the
5272  <systemitem role="package">quilt</systemitem> command using  <systemitem role="package">quilt</systemitem> command using
5273  <filename>deb3</filename> at <ulink url="&deb3;"/>.  <filename>deb3</filename> at <ulink url="&deb3;"/>.
# Line 5066  If it was packaged with another patch sy Line 5278  If it was packaged with another patch sy
5278  If it was packaged with the <command>dh</command> command with the  If it was packaged with the <command>dh</command> command with the
5279  <literal>--with quilt</literal> option or with the  <literal>--with quilt</literal> option or with the
5280  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>
5281  commands, remove such things and make it use the newer <literal>3.0  commands, remove these and make it use the newer <literal>3.0
5282  (native)</literal> source format.  (native)</literal> source format.
5283  </para>  </para>
5284  </listitem>  </listitem>
5285  </itemizedlist>  </itemizedlist>
5286  <para>  <para>
5287  You need to do other tasks described in <xref linkend="newupstream"/>, too.  You need to do the other tasks described in <xref linkend="newupstream"/>, too.
5288  </para>  </para>
5289  </section>  </section>
5290  <section id="reminders"><title>Reminders for updating packages</title>  <section id="reminders"><title>Reminders for updating packages</title>
# Line 5083  Here are few reminders for updating pack Line 5295  Here are few reminders for updating pack
5295  <listitem>  <listitem>
5296  <para>  <para>
5297  Preserve old <filename>changelog</filename> entries (sounds obvious, but there  Preserve old <filename>changelog</filename> entries (sounds obvious, but there
5298  have been incidents to type <literal>dch</literal> when you should have typed  have been cases of people typing <literal>dch</literal> when they should have typed
5299  <literal>dch -i</literal>.)  <literal>dch -i</literal>.)
5300  </para>  </para>
5301  </listitem>  </listitem>
# Line 5104  and <filename>debian/control</filename> Line 5316  and <filename>debian/control</filename>
5316  </listitem>  </listitem>
5317  <listitem>  <listitem>
5318  <para>  <para>
5319  Check to see <ulink url="&bts;">Debian Bug Tracking  Check the <ulink url="&bts;">Debian Bug Tracking
5320  System (BTS)</ulink> if someone have provided patches to bugs that are  System (BTS)</ulink> to see if someone has provided patches to bugs that are
5321  currently open in it.  currently open.
5322  </para>  </para>
5323  </listitem>  </listitem>
5324  <listitem>  <listitem>
5325  <para>  <para>
5326  Check the contents of the <filename>.changes</filename> file to make sure you  Check the contents of the <filename>.changes</filename> file to make sure you
5327  are uploading to the correct distribution, the proper bugs closures are listed  are uploading to the correct distribution, the proper bug closures are listed
5328  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and
5329  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.
5330  </para>  </para>

Legend:
Removed from v.8719  
changed lines
  Added in v.8760

  ViewVC Help
Powered by ViewVC 1.1.5