/[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 8757 by taffit-guest, Sat Apr 30 05:09:16 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    <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="socialdynamism"><title>Social dynamics of Debian</title>  <section id="socialdynamism"><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
# 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>  <listitem>
821  <para>  <para>
822  The program certainly should <emphasis role="strong">not</emphasis> run setuid  The program should <emphasis role="strong">not</emphasis> introduce security
823  root, or even better, it shouldn't need to be setuid or setgid to anything.  and maintenance concerns to the Debian system.
824  </para>  </para>
825  </listitem>  </listitem>
826    <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 923  or simply with freshly unpacked sources. Line 999  or simply with freshly unpacked sources.
999  </section>  </section>
1000  <section id="simplemake"><title>Simple build systems</title>  <section id="simplemake"><title>Simple build systems</title>
1001  <para>  <para>
1002  Simple programs come with a <filename>Makefile</filename> and can  Simple programs usually come with a <filename>Makefile</filename> and can
1003  be compiled just by invoking <literal>make</literal>.<footnote><para>  be compiled just by invoking <literal>make</literal>.<footnote><para>
1004  Many modern programs come with a script <filename>configure</filename> which  Many modern programs come with a script <filename>configure</filename> which
1005  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 1037  system comprising <ulink url="&autoconf;
1037  such sources by the <filename>configure.ac</filename>,  such sources by the <filename>configure.ac</filename>,
1038  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.
1039  <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
1040  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
1041  <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and  <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and
1042  <ulink url="&autotools-readme;"/>, if you need to use it.</para></footnote>  <ulink url="&autotools-readme;"/>, if you need to use it.</para></footnote>
1043  </para>  </para>
# Line 990  files requires some knowledge of <comman Line 1066  files requires some knowledge of <comman
1066  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
1067  distributed source and runs <literal>./configure &amp;&amp; make</literal> in  distributed source and runs <literal>./configure &amp;&amp; make</literal> in
1068  the source directory to compile the program into a  the source directory to compile the program into a
1069  <command><replaceable>binary</replaceable> executables</command>.  <command><replaceable>binary</replaceable></command> executable.
1070  </para>  </para>
1071  <screen>  <screen>
1072  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 1108  These are used in the <filename>debian/c
1108  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
1109  <emphasis role="strong">package name</emphasis> and  <emphasis role="strong">package name</emphasis> and
1110  <emphasis role="strong">upstream version</emphasis> by renaming the upstream  <emphasis role="strong">upstream version</emphasis> by renaming the upstream
1111  source to follow the Debian policy and the existing convention.  source to follow the Debian Policy and the existing convention.
1112  </para>  </para>
1113  <para>  <para>
1114  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 1117  to consist only of lower case letters (<
1117  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be
1118  at least two characters long, must start with an alphanumeric character, and  at least two characters long, must start with an alphanumeric character, and
1119  must not be the same as existing ones.  must not be the same as existing ones.
1120  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.
1121  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>
1122  </para>  </para>
1123  <!--  <!--
1124  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 1137  If upstream source uses generic words su
1137  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
1138  package name and to identify its contents explicitly.  package name and to identify its contents explicitly.
1139  <footnote><para>If you follow the  <footnote><para>If you follow the
1140  <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>,
1141  the ITP process will usually catch this kind of issues.</para></footnote>.  the ITP process will usually catch this kind of issues.</para></footnote>
1142  </para>  </para>
1143  <para>  <para>
1144  You should choose the <emphasis role="strong">upstream version</emphasis>  You should choose the <emphasis role="strong">upstream version</emphasis>
1145  to consist only of  to consist only of
1146  alphanumerics (<literal>0-9A-Za-z</literal>), plus (<literal>+</literal>),  alphanumerics (<literal>0-9A-Za-z</literal>), plus (<literal>+</literal>),
1147  tilde (<literal>~</literal>), and periods (<literal>.</literal>). It must  tildes (<literal>~</literal>), and periods (<literal>.</literal>). It must
1148  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter
1149  rule should help you avoid confusing file names.</para></footnote>  rule should help you avoid confusing file names.</para></footnote>
1150  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.
1151    <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>
1152  </para>  </para>
1153  <!--  <!--
1154  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 1175  aptitude display 10 = 8char for up + 1ch
1175  <para>  <para>
1176  If the upstream software does not use normal version system like  If the upstream software does not use normal version system like
1177  <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
1178  <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
1179  of version, make sure to remove them from the  of version, make sure to remove them from the
1180  <emphasis role="strong">upstream version</emphasis>.  Such information can be  <emphasis role="strong">upstream version</emphasis>.  Such information can be
1181  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 1184  invent a version string, use the <litera
1184  <command>dpkg</command> properly sees later versions as upgrades.  <command>dpkg</command> properly sees later versions as upgrades.
1185  </para>  </para>
1186  <para>  <para>
1187  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
1188    <emphasis role="strong">upstream version</emphasis>
1189    (<literal><replaceable>version</replaceable></literal>),
1190    <emphasis role="strong">Debian revision</emphasis>
1191    (<literal><replaceable>revision</replaceable></literal>), or
1192    <emphasis role="strong">version</emphasis>
1193    (<literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>).
1194    See <xref linkend="newrevision"/> for how the
1195    <emphasis role="strong">Debian revision</emphasis> is incremented.
1196    </para></footnote>
1197    can be compared with <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as the following.
1198  </para>  </para>
1199  <screen>  <screen>
1200   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>
1201  </screen>  </screen>
1202  <para>  <para>
1203  The version comparison rule can be summarized as the folowing.  The version comparison rule can be summarized as the following.
1204  </para>  </para>
1205  <itemizedlist>  <itemizedlist>
1206  <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>
1207  <listitem><para>Alphabets are larger than numbers.</para></listitem>  <listitem><para>Alphabets are larger than numbers.</para></listitem>
1208  <listitem><para>Numbers are compared as the integer.</para></listitem>  <listitem><para>Numbers are compared as the integer.</para></listitem>
1209  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>
1210  <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>
1211    <para>    <para>
1212    <literal>0.0</literal> &lt;    <literal>0.0</literal> &lt;
1213    <literal>0.5</literal> &lt;    <literal>0.5</literal> &lt;
# Line 1144  sure that the upgrade works properly by Line 1231  sure that the upgrade works properly by
1231  <filename>gentoo-0.9.12~rc99.tar.gz</filename>.  <filename>gentoo-0.9.12~rc99.tar.gz</filename>.
1232  </para>  </para>
1233  </section>  </section>
1234  <section id="dh-make"><title>Initial Debian package</title>  <section id="dh-make"><title>Setting up <command>dh_make</command></title>
1235  <para>  <para>
1236  Set up the shell environment variables <literal>$DEBEMAIL</literal> and  Set up the shell environment variables <literal>$DEBEMAIL</literal> and
1237  <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 1246  DEBEMAIL=your.email.address@example.org
1246  DEBFULLNAME=Firstname Lastname  DEBFULLNAME=Firstname Lastname
1247  export DEBEMAIL DEBFULLNAME  export DEBEMAIL DEBFULLNAME
1248  EOF  EOF
1249    $ . ~/.bashrc
1250  </screen>  </screen>
1251    </section>
1252    <section id="non-native-dh-make"><title>Initial non-native Debian package</title>
1253  <para>  <para>
1254  You can create an initial Debian package by issuing the  Normal Debian packages are non-native Debian packages made from upstream
1255  <command>dh_make</command> command as follows.  programs.  If you wish to create a non-native Debian package of an upstream
1256    source <filename>gentoo-0.9.12.tar.gz</filename>, you can create an initial
1257    non-native Debian package for it by issuing the <command>dh_make</command>
1258    command as follows.
1259  </para>  </para>
1260  <screen>  <screen>
1261  $ . ~/.bashrc  $ cd ~/gentoo
1262  $ cd ~/gentoo/gentoo-0.9.12  $ wget http://example.org/gentoo-0.9.12.tar.gz
1263    $ tar -xvzf gentoo-0.9.12.tar.gz
1264    $ cd gentoo-0.9.12
1265  $ dh_make -f ../gentoo-0.9.12.tar.gz  $ dh_make -f ../gentoo-0.9.12.tar.gz
1266  </screen>  </screen>
1267  <para>  <para>
# Line 1182  provided by the upstream for your Debian Line 1277  provided by the upstream for your Debian
1277  </para>  </para>
1278  <para>  <para>
1279  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
1280  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,
1281  one <filename>.deb</filename> file - so we will select the first option  one <filename>.deb</filename> file - so we will select the first option
1282  (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
1283  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.
1284  <footnote><para> There are several choices here: <literal>s</literal> for  <footnote><para> There are several choices here: <literal>s</literal> for
1285  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
1286  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
1287  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>
1288  for <systemitem role="package">cdbs</systemitem> package.  This document focuses on the  for <systemitem role="package">cdbs</systemitem> package.  This document focuses on the
1289  use of the <command>dh</command> command (from the package  use of the <command>dh</command> command (from the package
1290  <systemitem role="package">debhelper</systemitem>) to create a single-binary package,  <systemitem role="package">debhelper</systemitem>) to create a single binary package,
1291  but also touches on how to use it for arch-independent or  but also touches on how to use it for arch-independent or
1292  multiple-binary packages.  The package  multiple binary packages.  The package
1293  <systemitem role="package">cdbs</systemitem> offers an alternative packaging script  <systemitem role="package">cdbs</systemitem> offers an alternative packaging script
1294  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
1295  this document.  </para> </footnote>  this document.  </para> </footnote>
# Line 1240  testing them (<xref linkend="checkit"/>) Line 1335  testing them (<xref linkend="checkit"/>)
1335  All the steps will be explained.  All the steps will be explained.
1336  </para>  </para>
1337  <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>  
1338  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
1339  recover them by running <command>dh_make</command> with the  recover them by running <command>dh_make</command> with the
1340  <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 1344  Updating an existing package may get com
1344  techniques.  While learning the basics, please stick to creating a fresh  techniques.  While learning the basics, please stick to creating a fresh
1345  package; further explanations are given in <xref linkend="update"/>.  package; further explanations are given in <xref linkend="update"/>.
1346  </para>  </para>
1347    <para>
1348    Please note that the source file does not need to contain any build system
1349    discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It
1350    could be just a collection of graphics data etc.  Installation of files may be
1351    enabled by <systemitem role="package">debhelper</systemitem> configuration
1352    files such as <filename>debian/install</filename> (see
1353    <xref linkend="install"/>) only.
1354    </para>
1355    </section>
1356    <section id="native-dh-make"><title>Initial native Debian package</title>
1357    <para>
1358    Debian native packages are simpler to manage if they contain source files you
1359    manage only for Debian, possibly only for local uses.  If you have source
1360    files in <filename>~/mypackage-1.0</filename>, you can create an initial native
1361    Debian package for it by issuing the <command>dh_make</command> command as
1362    follows.
1363    </para>
1364    <screen>
1365    $ cd ~/mypackage-1.0
1366    $ dh_make --native
1367    </screen>
1368    <para>
1369    Then the <filename>debian</filename> directory and its contents are created
1370    just like <xref linkend="non-native-dh-make"/>.  This does not create a tarball
1371    since this is a native Debian package.  But that is the only difference.
1372    The rest of the packaging activities are practically the same.
1373    </para>
1374  </section>  </section>
1375  </chapter>  </chapter>
1376  <chapter id="modify"><title>Modifying the source</title>  <chapter id="modify"><title>Modifying the source</title>
# Line 1433  installation.  The packaging script will Line 1514  installation.  The packaging script will
1514  <literal>$(DESTDIR)</literal> to the temporary directory.  <literal>$(DESTDIR)</literal> to the temporary directory.
1515  </para>  </para>
1516  <para>  <para>
1517  For packages of the single-binary type, the temporary directory used  For packages of the single binary type, the temporary directory used
1518  by the <command>dh_auto_install</command> command will be set to  by the <command>dh_auto_install</command> command will be set to
1519  <filename>debian/<replaceable>package</replaceable></filename>.  <filename>debian/<replaceable>package</replaceable></filename>.
1520  <footnote><para> For packages of the multiple-binary type, the  <footnote><para> For packages of the multiple binary type, the
1521  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>
1522  as the temporary directory while the <command>dh_install</command> command with  as the temporary directory while the <command>dh_install</command> command with
1523  the help of  the help of
# Line 1680  they are obvious. Line 1761  they are obvious.
1761  This file contains various values which <command>dpkg</command>,  This file contains various values which <command>dpkg</command>,
1762  <command>dselect</command>, <command>apt-get</command>,  <command>dselect</command>, <command>apt-get</command>,
1763  <command>apt-cache</command>, <command>aptitude</command>, and other package  <command>apt-cache</command>, <command>aptitude</command>, and other package
1764  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
1765  Policy Manual, 5 'Control files and their fields'</ulink>.  <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.
1766  </para>  </para>
1767  <para>  <para>
1768  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 1809  for e-mail readers and daemons, <literal
1809  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,
1810  and many more.  and many more.
1811  <footnote> <para>See  <footnote> <para>See
1812  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 'Sections'</ulink> and  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 "Sections"</ulink> and
1813  <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>
1814  </footnote>  </footnote>
1815  </para>  </para>
# Line 1739  we can omit it.) Line 1820  we can omit it.)
1820  <para>  <para>
1821  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.
1822  <footnote> <para>See  <footnote> <para>See
1823  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 'Priorities'</ulink>.  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 "Priorities"</ulink>.
1824  </para>  </para>
1825  </footnote>  </footnote>
1826  </para>  </para>
# Line 1778  you.  Avoid using commas, ampersands and Line 1859  you.  Avoid using commas, ampersands and
1859  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
1860  the <literal>Build-Depends</literal> field.  You can also have the  the <literal>Build-Depends</literal> field.  You can also have the
1861  <literal>Build-Depends-Indep</literal> field as an additional line, here.  <literal>Build-Depends-Indep</literal> field as an additional line, here.
1862  <footnote><para>See <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian  <footnote><para>See
1863  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>
1864  Build-Depends, Build-Depends-Indep, Build-Conflicts,  Some packages like
 Build-Conflicts-Indep'</ulink>.</para></footnote>  Some packages like  
1865  <systemitem role="package">gcc</systemitem> and  <systemitem role="package">gcc</systemitem> and
1866  <systemitem role="package">make</systemitem> which are required by the  <systemitem role="package">make</systemitem> which are required by the
1867  <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 1986  these relations; if not, it will be expl
1986  <para>  <para>
1987  Here is a simplified description of package relationships.  Here is a simplified description of package relationships.
1988  <footnote><para>See  <footnote><para>See
1989  <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>.
1990  </para></footnote>  </para></footnote>
1991  </para>  </para>
1992  <itemizedlist>  <itemizedlist>
# Line 2084  English.  Translations of these descript Line 2164  English.  Translations of these descript
2164  Let's insert <literal>Vcs-*</literal> fields to document the Version Control  Let's insert <literal>Vcs-*</literal> fields to document the Version Control
2165  System (VCS) location between line 6 and 7.  System (VCS) location between line 6 and 7.
2166  <footnote><para>See  <footnote><para>See
2167  <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>.
2168  </para></footnote>  </para></footnote>
2169  Let's assume that the <systemitem role="package">gentoo</systemitem>  Let's assume that the <systemitem role="package">gentoo</systemitem>
2170  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 2211  Finally, here is the updated <filename>c
2211  <para>  <para>
2212  This file contains the information about package upstream resources, copyright  This file contains the information about package upstream resources, copyright
2213  and license information.  and license information.
2214  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 'Copyright information'</ulink>  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink>
2215  dictates its content and  dictates its content and
2216  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>
2217  provides guidelines for its format.  provides guidelines for its format.
# Line 2201  debian-devel-announce: <ulink url="&howt Line 2281  debian-devel-announce: <ulink url="&howt
2281  <section id="changelog"><title><filename>changelog</filename> file</title>  <section id="changelog"><title><filename>changelog</filename> file</title>
2282  <para>  <para>
2283  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
2284  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 'debian/changelog'</ulink>.  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.
2285  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
2286  version number, revision, distribution and urgency of your package.  version number, revision, distribution and urgency of your package.
2287  </para>  </para>
# Line 2282  is marked as executable. Line 2362  is marked as executable.
2362  Every <filename>rules</filename> file, as any other  Every <filename>rules</filename> file, as any other
2363  <filename>Makefile</filename>, consists of several targets and their rules  <filename>Makefile</filename>, consists of several targets and their rules
2364  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian
2365  Policy Manual, 4.9 'Main building script: debian/rules'</ulink> explains its  Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains its
2366  details.  details.
2367  </para>  </para>
2368  <para>  <para>
# Line 2935  possible. Line 3015  possible.
3015  <para>  <para>
3016  To control most of what <systemitem role="package">debhelper</systemitem> does  To control most of what <systemitem role="package">debhelper</systemitem> does
3017  while building the package, you put optional configuration files under the  while building the package, you put optional configuration files under the
3018  <filename>debian</filename> directory.  This chapter will make an overview of  <filename>debian</filename> directory.  This chapter will provide an overview of
3019  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
3020  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's
3021  Reference</ulink> for guidelines for the packaging.  Reference</ulink> for guidelines for packaging.
3022  </para>  </para>
3023  <para>  <para>
3024  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 3029  prefixed by the binary package name such
3029  them.  them.
3030  <footnote><para>  <footnote><para>
3031  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
3032  referred without preceding <filename>debian/</filename> for simplicity whenever  referred to without the preceding <filename>debian/</filename> for simplicity whenever
3033  they are obvious.  they are obvious.
3034  </para></footnote>  </para></footnote>
3035  </para>  </para>
3036  <para>  <para>
3037  The <command>dh_make</command> command may not create some template  Some template configuration files for <systemitem role="package">debhelper</systemitem>
3038  configuration files for <systemitem role="package">debhelper</systemitem>.  In  may not be created by the <command>dh_make</command> command.  In
3039  such cases, you need to create them with the editor.  such cases, you need to create them with an editor.
3040  </para>  </para>
3041  <para>  <para>
3042  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:
3043  </para>  </para>
3044  <itemizedlist>  <itemizedlist>
3045  <listitem>  <listitem>
3046  <para>  <para>
3047  rename template files by removing the <literal>.ex</literal> or  rename template files by removing the <literal>.ex</literal> or
3048  <literal>.EX</literal> suffix if the template files have one.  <literal>.EX</literal> suffix if they have one;
3049  </para>  </para>
3050  </listitem>  </listitem>
3051  <listitem>  <listitem>
3052  <para>  <para>
3053  rename the name of these configuration files using the actual binary package  rename the configuration files to use the actual binary package
3054  name in place of <literal><replaceable>package</replaceable></literal>.  name in place of <literal><replaceable>package</replaceable></literal>;
3055  </para>  </para>
3056  </listitem>  </listitem>
3057  <listitem>  <listitem>
3058  <para>  <para>
3059  modify template file contents to suit your needs.  modify template file contents to suit your needs;
3060  </para>  </para>
3061  </listitem>  </listitem>
3062  <listitem>  <listitem>
3063  <para>  <para>
3064  remove template files which you do not need.  remove template files which you do not need;
3065  </para>  </para>
3066  </listitem>  </listitem>
3067  <listitem>  <listitem>
3068  <para>  <para>
3069  modify the <filename>control</filename> file (see <xref linkend="control"/>),  modify the <filename>control</filename> file (see <xref linkend="control"/>),
3070  if necessary.  if necessary;
3071  </para>  </para>
3072  </listitem>  </listitem>
3073  <listitem>  <listitem>
# Line 2998  necessary. Line 3078  necessary.
3078  </listitem>  </listitem>
3079  </itemizedlist>  </itemizedlist>
3080  <para>  <para>
3081  Those <systemitem role="package">debhelper</systemitem> configuration files  Any <systemitem role="package">debhelper</systemitem> configuration files
3082  without <filename><replaceable>package</replaceable></filename> prefix such as  without a <filename><replaceable>package</replaceable></filename> prefix, such as
3083  <filename>install</filename> apply to the first binary package.  When there are  <filename>install</filename>, apply to the first binary package.  When there are
3084  many binary packages, their configurations can be specified by prefixing their  many binary packages, their configurations can be specified by prefixing their
3085  name to their configuration filenames such as  name to their configuration filenames such as
3086  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3087  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3088  </para>  </para>
3089  <section id="readme"><title><filename>README.Debian</filename> file</title>  <section id="readme"><title><filename>README.Debian</filename></title>
3090  <para>  <para>
3091  Any extra details or discrepancies between the original package and your Debian  Any extra details or discrepancies between the original package and your Debian
3092  version should be documented here.  version should be documented here.
3093  </para>  </para>
3094  <para>  <para>
3095  <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:
3096  </para>  </para>
3097  <screen>  <screen>
3098  gentoo for Debian  gentoo for Debian
# Line 3026  If you have nothing to be documented, re Line 3106  If you have nothing to be documented, re
3106  </citerefentry>.  </citerefentry>.
3107  </para>  </para>
3108  </section>  </section>
3109  <section id="compat"><title><filename>compat</filename> file</title>  <section id="compat"><title><filename>compat</filename></title>
3110  <para>  <para>
3111  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
3112  should set it to the <systemitem role="package">debhelper</systemitem> V7 by  should set it to the <systemitem role="package">debhelper</systemitem> v7 as
3113  the following.  follows:
3114  </para>  </para>
3115  <screen>  <screen>
3116  $ echo 7 &gt; debian/compat  $ echo 7 &gt; debian/compat
3117  </screen>  </screen>
3118  </section>  </section>
3119  <section id="conffiles"><title><filename>conffiles</filename> file</title>  <section id="conffiles"><title><filename>conffiles</filename></title>
3120  <para>  <para>
3121  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
3122  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
3123  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.
3124  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>
3125  <manvolnum>1</manvolnum> </citerefentry> and  <manvolnum>1</manvolnum> </citerefentry> and
3126  <ulink url="&policy-conffiles;">Debian Policy Manual 'D.2.5 Conffiles'</ulink>.  <ulink url="&policy-conffiles;">Debian Policy Manual "D.2.5 Conffiles"</ulink>.
3127  </para></footnote>  </para></footnote>
3128  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
3129  your old configuration files or not.  your old configuration files or not.
3130  </para>  </para>
3131  <para>  <para>
3132  Since <systemitem role="package">debhelper</systemitem> V3, <citerefentry>  <citerefentry><refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>
3133  <refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> <emphasis>automatically</emphasis> flags any files under
 </citerefentry> will <emphasis>automatically</emphasis> flag any files under  
3134  the <filename>/etc</filename> directory as conffiles, so if your program only  the <filename>/etc</filename> directory as conffiles, so if your program only
3135  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
3136  package types, the only place there is (and should be conffiles) is under  package types, the only place conffiles should ever be is under
3137  <filename>/etc</filename> and so this file doesn't need to exist.  <filename>/etc</filename>, and so this file doesn't need to exist.
3138  </para>  </para>
3139  <para>  <para>
3140  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,
3141  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
3142  then prompt users to verify the changes all the time.  then prompt users to verify the changes all the time.
3143  </para>  </para>
3144  <para>  <para>
3145  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
3146  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
3147  make them not as conffiles to keep <command>dpkg</command> quiet.  arrange for them to not be conffiles, keeping <command>dpkg</command> quiet.
3148  </para>  </para>
3149  <itemizedlist>  <itemizedlist>
3150  <listitem>  <listitem>
3151  <para>  <para>
3152  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
3153  file under the <filename>/var</filename> directory generated by the  file under the <filename>/var</filename> directory generated by the
3154  <emphasis>maintainer scripts</emphasis>.  maintainer scripts.
3155  </para>  </para>
3156  </listitem>  </listitem>
3157  <listitem>  <listitem>
3158  <para>  <para>
3159  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.  
3160  </para>  </para>
3161  </listitem>  </listitem>
3162  </itemizedlist>  </itemizedlist>
3163  <para>  <para>
3164  For more information on the <emphasis>maintainer scripts</emphasis>, see <xref linkend="maintscripts"/>.  For information on maintainer scripts, see <xref linkend="maintscripts"/>.
3165  </para>  </para>
3166  </section>  </section>
3167  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename> files</title>  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename></title>
3168  <para>  <para>
3169  If your package requires regularly scheduled tasks to operate properly, you can  If your package requires regularly scheduled tasks to operate properly, you can
3170  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
3171  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
3172  you wish.  The filenames are:  you wish.  The filenames are:
3173  </para>  </para>
3174  <itemizedlist>  <itemizedlist>
3175  <listitem>  <listitem>
3176  <para>  <para>
3177  <filename>cron.hourly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.hourly</filename> - Installed as
3178  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>; run
3179  once an hour every hour.  once an hour.
3180  </para>  </para>
3181  </listitem>  </listitem>
3182  <listitem>  <listitem>
3183  <para>  <para>
3184  <filename>cron.daily</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.daily</filename> - Installed as
3185  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>; run
3186  once a day, usually early morning.  once a day.
3187  </para>  </para>
3188  </listitem>  </listitem>
3189  <listitem>  <listitem>
3190  <para>  <para>
3191  <filename>cron.weekly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.weekly</filename> - Installed as
3192  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>; run
3193  once a week, usually early Sunday morning.  once a week.
3194  </para>  </para>
3195  </listitem>  </listitem>
3196  <listitem>  <listitem>
3197  <para>  <para>
3198  <filename>cron.monthly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.monthly</filename> - Installed as
3199  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run
3200  once a month, usually early morning on the first of the month.  once a month.
3201  </para>  </para>
3202  </listitem>  </listitem>
3203  <listitem>  <listitem>
3204  <para>  <para>
3205  <filename>cron.d</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.d</filename> - Installed as
3206  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any
3207  other time  other time.
3208  </para>  </para>
3209  </listitem>  </listitem>
3210  </itemizedlist>  </itemizedlist>
3211  <para>  <para>
3212  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
3213  is <filename><replaceable>package</replaceable>.cron.d</filename> which follows  <filename><replaceable>package</replaceable>.cron.d</filename> which follows
3214  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>
3215  <manvolnum>5</manvolnum> </citerefentry>.  <manvolnum>5</manvolnum> </citerefentry>.
3216  </para>  </para>
3217  <para>  <para>
3218  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;
3219  <refentrytitle>dh_installlogrotate</refentrytitle> <manvolnum>1</manvolnum>  for that, see
3220  </citerefentry> and <citerefentry> <refentrytitle>logrotate</refentrytitle>  <citerefentry><refentrytitle>dh_installlogrotate</refentrytitle>
3221  <manvolnum>8</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum></citerefentry> and
3222    <citerefentry><refentrytitle>logrotate</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
3223  </para>  </para>
3224  </section>  </section>
3225  <section id="dirs"><title><filename>dirs</filename> file</title>  <section id="dirs"><title><filename>dirs</filename></title>
3226  <para>  <para>
3227  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
3228  procedure (<literal>make install DESTDIR=...</literal> invoked by  procedure (<literal>make install DESTDIR=...</literal> invoked by
3229  <literal>dh_auto_install</literal>) somehow doesn't create.  This generally  <literal>dh_auto_install</literal>).  This generally
3230  means there is a problem with the <filename>Makefile</filename>.  means there is a problem with the <filename>Makefile</filename>.
3231  </para>  </para>
3232  <para>  <para>
3233  Files listed in the <filename>install</filename> file doesn't need the  Files listed in an <filename>install</filename> file don't need their
3234  directories created first.  See <xref linkend="install"/>.  directories created first.  See <xref linkend="install"/>.
3235  </para>  </para>
3236  <para>  <para>
3237  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
3238  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
3239  the <filename>dirs</filename> file.  the <filename>dirs</filename> file.
3240  </para>  </para>
3241  </section>  </section>
3242  <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>
3243  <para>  <para>
3244  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
3245  should use the <systemitem role="package">doc-base</systemitem> file to  should use the <systemitem role="package">doc-base</systemitem> file to
3246  register it, so the user can find it with e.g.  <citerefentry>  register it, so the user can find it with e.g.  <citerefentry>
3247  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,
3248  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>
3249  </citerefentry> or <citerefentry> <refentrytitle>doccentral</refentrytitle>  </citerefentry>, or <citerefentry> <refentrytitle>doccentral</refentrytitle>
3250  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
3251  </para>  </para>
3252  <para>  <para>
# Line 3175  This usually includes HTML, PS and PDF f Line 3254  This usually includes HTML, PS and PDF f
3254  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.
3255  </para>  </para>
3256  <para>  <para>
3257  This is how <systemitem role="package">gentoo</systemitem>'s doc-base file  This is what <systemitem role="package">gentoo</systemitem>'s doc-base file
3258  <filename>gentoo.doc-base</filename> looks like:  <filename>gentoo.doc-base</filename> looks like:
3259  </para>  </para>
3260  <screen>  <screen>
# Line 3198  manual, in <ulink url="&doc-base;">Debia Line 3277  manual, in <ulink url="&doc-base;">Debia
3277  For more details on installing additional documentation, look in <xref linkend="destdir"/>.  For more details on installing additional documentation, look in <xref linkend="destdir"/>.
3278  </para>  </para>
3279  </section>  </section>
3280  <section id="docs"><title><filename>docs</filename> file</title>  <section id="docs"><title><filename>docs</filename></title>
3281  <para>  <para>
3282  This file specifies the file names of documentation files we can have  This file specifies the file names of documentation files we can have
3283  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
# Line 3211  directory that are called <filename>BUGS Line 3290  directory that are called <filename>BUGS
3290  <filename>README*</filename>, <filename>TODO</filename> etc.  <filename>README*</filename>, <filename>TODO</filename> etc.
3291  </para>  </para>
3292  <para>  <para>
3293  For <systemitem role="package">gentoo</systemitem>, I also included some other  For <systemitem role="package">gentoo</systemitem>, some other files
3294  files:  are also included:
3295  </para>  </para>
3296  <screen>  <screen>
3297  BUGS  BUGS
# Line 3224  README.gtkrc Line 3303  README.gtkrc
3303  TODO  TODO
3304  </screen>  </screen>
3305  </section>  </section>
3306  <section id="emacsen"><title><filename>emacsen-*</filename> file</title>  <section id="emacsen"><title><filename>emacsen-*</filename></title>
3307  <para>  <para>
3308  If your package supplies Emacs files that can be bytecompiled at package  If your package supplies Emacs files that can be bytecompiled at package
3309  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 3317  They are installed into the temporary di
3317  If you don't need these, remove them.  If you don't need these, remove them.
3318  </para>  </para>
3319  </section>  </section>
3320  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename> file</title>  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename></title>
3321  <para>  <para>
3322  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>
3323  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories
3324  listed in this file as example files.  listed in this file as example files.
3325  </para>  </para>
3326  </section>  </section>
3327  <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>
3328  <para>  <para>
3329  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
3330  obviously disregarded my initial recommendation, haven't you?  :-)  obviously disregarded my initial recommendation, haven't you?  :-)
3331  </para>  </para>
3332  <para>  <para>
3333  The <filename><replaceable>package</replaceable>.init</filename> file is  The <filename><replaceable>package</replaceable>.init</filename> file is
3334  installed as the  installed as the
3335  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script
3336  for the <emphasis>init script</emphasis> which starts and stops a daemon.  which starts and stops the daemon.
3337  Its fairly generic skeleton template is provided by the  Its fairly generic skeleton template is provided by the
3338  <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
3339  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 3344  gets installed into the temporary direct
3344  </para>  </para>
3345  <para>  <para>
3346  The <filename><replaceable>package</replaceable>.default</filename> file will  The <filename><replaceable>package</replaceable>.default</filename> file will
3347  be installed into  be installed as
3348  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This
3349  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
3350  <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
3351  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
3352  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
3353    features, you can set them in the <filename><replaceable>package</replaceable>.default</filename> file,
3354    instead of in the init script itself.
3355  </para>  </para>
3356  <para>  <para>
3357  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
3358  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
3359  <filename><replaceable>package</replaceable>.init</filename>.  However  <filename><replaceable>package</replaceable>.init</filename>.  However
3360  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
3361  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
3362  need to override <command>dh_installinit</command> in the  need to override <command>dh_installinit</command> in the
3363  <filename>rules</filename> file with the following lines:  <filename>rules</filename> file with the following lines:
3364  </para>  </para>
# Line 3289  override_dh_installinit: Line 3370  override_dh_installinit:
3370  If you don't need this, remove the files.  If you don't need this, remove the files.
3371  </para>  </para>
3372  </section>  </section>
3373  <section id="install"><title><filename>install</filename> file</title>  <section id="install"><title><filename>install</filename></title>
3374  <para>  <para>
3375  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
3376  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
3377  destinations into this <filename>install</filename> file.  They are installed  destinations into this <filename>install</filename> file.  They are installed
3378  by <citerefentry> <refentrytitle>dh_install</refentrytitle>  by <citerefentry> <refentrytitle>dh_install</refentrytitle>
3379  <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 3386  the <filename>docs</filename> file and n
3386  <para>  <para>
3387  This <filename>install</filename> file has one line per file installed, with  This <filename>install</filename> file has one line per file installed, with
3388  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
3389  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
3390  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:  
3391  </para>  </para>
3392  <screen>  <screen>
3393  src/foo/mybin usr/bin  src/<replaceable>bar</replaceable> usr/bin
3394  </screen>  </screen>
3395  <para>  <para>
3396  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
3397  <filename>/usr/bin/mybin</filename>.  <filename>/usr/bin/<replaceable>bar</replaceable></filename>.
3398  </para>  </para>
3399  <para>  <para>
3400  Alternatively, this <filename>install</filename> can have the name of the file  Alternatively, this <filename>install</filename> can have the name of the file
3401  only without the installation directory when the relative directory path does  only without the installation directory when the relative directory path does
3402  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
3403  result into multiple binary packages using  output of its build into multiple binary packages using
3404  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3405  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3406  </para>  </para>
3407  <para>  <para>
3408  The <command>dh_install</command> command will fall back to look in  The <command>dh_install</command> command will fall back to looking in
3409  <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
3410  current directory (or wherever you've told it to look using  current directory (or wherever you've told it to look using
3411  <literal>--sourcedir</literal>).  <literal>--sourcedir</literal>).
3412  </para>  </para>
3413  </section>  </section>
3414  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename> file</title>  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename></title>
3415  <para>  <para>
3416  If your package has info pages, you should install them using <citerefentry>  If your package has info pages, you should install them using <citerefentry>
3417  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>
3418  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3419  <filename><replaceable>package</replaceable>.info</filename> files.  <filename><replaceable>package</replaceable>.info</filename> file.
3420  </para>  </para>
3421  </section>  </section>
3422  <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>
3423  <para>  <para>
3424  If <systemitem role="package">lintian</systemitem> reports an erroneous  If <systemitem role="package">lintian</systemitem> reports an erroneous
3425  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
3426  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>
3427  or <filename>source/lintian-overrides</filename> to quiet it.  Please read  or <filename>source/lintian-overrides</filename> to quieten it.  Please read
3428  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain
3429  from abusing this.  from abusing this.
3430  </para>  </para>
3431  <para>  <para>
3432  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is
3433  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
3434  into  into
3435  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>
3436  by the <command>dh_lintian</command> command.  by the <command>dh_lintian</command> command.
# Line 3360  by the <command>dh_lintian</command> com Line 3440  by the <command>dh_lintian</command> com
3440  is not installed.  is not installed.
3441  </para>  </para>
3442  </section>  </section>
3443  <section id="manpage"><title><filename>manpage.*</filename> files</title>  <section id="manpage"><title><filename>manpage.*</filename></title>
3444  <para>  <para>
3445  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
3446  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
3447  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
3448  manual page.  Please make sure to remove unused templates.  manual page.  Please make sure to remove unused templates.
3449  </para>  </para>
3450  <section id="manpage1"><title><filename>manpage.1.ex</filename> file</title>  <section id="manpage1"><title><filename>manpage.1.ex</filename></title>
3451  <para>  <para>
3452  Manual pages are normally written in <citerefentry>  Manual pages are normally written in <citerefentry>
3453  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
# Line 3377  The <filename>manpage.1.ex</filename> te Line 3457  The <filename>manpage.1.ex</filename> te
3457  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.
3458  </para>  </para>
3459  <para>  <para>
3460  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
3461  documenting, so we will rename it from <literal>manpage</literal> to  documenting, so we will rename it from <literal>manpage</literal> to
3462  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>
3463  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
3464  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
3465  list of manual page sections:  list of manual page sections:
3466  </para>  </para>
3467  <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>  
3468  <tgroup cols="3">  <tgroup cols="3">
3469    <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"/>
3470    <thead>    <thead>
# Line 3403  list of manual page sections: Line 3482  list of manual page sections:
3482      <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>
3483    </tbody>    </tbody>
3484  </tgroup>  </tgroup>
3485  </table>  </informaltable>
3486  <para>  <para>
3487  So <systemitem role="package">gentoo</systemitem>'s man page should be called  So <systemitem role="package">gentoo</systemitem>'s man page should be called
3488  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>
3489  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
3490  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and
3491  edit it by using information from the example and from upstream docs.  editing it using information from the example and from the upstream docs.
3492  </para>  </para>
3493  <para>  <para>
3494  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
3495  of <literal>--help</literal> and <literal>--version</literal> output of each  of the <literal>--help</literal> and <literal>--version</literal> output of each
3496  program, too.  <footnote><para> If the command is missing  program, too.  <footnote><para> Note that <command>help2man</command>'s
3497  <command>info</command> page but have documentation files in the  placeholder man page will claim that more detailed documentation is
3498  <filename>/usr/share/<replaceable>package</replaceable></filename> directory,  available in the info system. If the command is missing an
3499  you should manually edit generated the man page created by the  <command>info</command> page, you
3500    should manually edit the man page created by the
3501  <command>help2man</command> command.  </para> </footnote>  <command>help2man</command> command.  </para> </footnote>
3502  </para>  </para>
3503  </section>  </section>
3504  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename> file</title>  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename></title>
3505  <para>  <para>
3506  If on the other hand you prefer writing SGML instead of  If on the other hand you prefer writing SGML instead of
3507  <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 3526  line in the <filename>control</filename>
3526  </listitem>  </listitem>
3527  <listitem>  <listitem>
3528  <para>  <para>
3529  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3530  <filename>rules</filename> file:  <filename>rules</filename> file:
3531  </para>  </para>
3532  <screen>  <screen>
# Line 3457  override_dh_auto_build: Line 3537  override_dh_auto_build:
3537  </listitem>  </listitem>
3538  </itemizedlist>  </itemizedlist>
3539  </section>  </section>
3540  <section id="manpagexml"><title><filename>manpage.xml.ex</filename> file</title>  <section id="manpagexml"><title><filename>manpage.xml.ex</filename></title>
3541  <para>  <para>
3542  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>
3543  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 3557  XSLT processor like <systemitem role="pa
3557  </listitem>  </listitem>
3558  <listitem>  <listitem>
3559  <para>  <para>
3560  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal> and  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal>, and
3561  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>
3562  line in the <literal>control</literal> file  line in the <literal>control</literal> file
3563  </para>  </para>
3564  </listitem>  </listitem>
3565  <listitem>  <listitem>
3566  <para>  <para>
3567  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3568  <filename>rules</filename> file:  <filename>rules</filename> file:
3569  </para>  </para>
3570  <screen>  <screen>
# Line 3506  override_dh_auto_build: Line 3586  override_dh_auto_build:
3586  <para>  <para>
3587  If your package has manual pages, you should install them using <citerefentry>  If your package has manual pages, you should install them using <citerefentry>
3588  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>
3589  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3590  <filename><replaceable>package</replaceable>.manpages</filename> files.  <filename><replaceable>package</replaceable>.manpages</filename> file.
3591  </para>  </para>
3592  <para>  <para>
3593  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
3594  <filename>gentoo.manpages</filename> file as the following.  <filename>gentoo.manpages</filename> file as follows.
3595  </para>  </para>
3596  <screen>  <screen>
3597  docs/gentoo.1  docs/gentoo.1
3598  </screen>  </screen>
3599  </section>  </section>
3600  <section id="menu"><title><filename>menu</filename> file</title>  <section id="menu"><title><filename>menu</filename></title>
3601  <para>  <para>
3602  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
3603  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 3618  specifies what kind of interface the pro
3618  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.
3619  </para>  </para>
3620  <para>  <para>
3621  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
3622  should appear in.  should appear in.
3623  <footnote><para> The current list of sections is at  <footnote><para> The current list of sections is in
3624  <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>.
3625  There were a major reorganization of menu structure for <literal>squeeze</literal>.  There was a major reorganization of menu structure for <literal>squeeze</literal>.
3626  </para> </footnote>  </para> </footnote>
3627  </para>  </para>
3628  <para>  <para>
# Line 3569  You can also add other fields like <lite Line 3649  You can also add other fields like <lite
3649  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>
3650  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>
3651  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>
3652  </citerefentry> and  </citerefentry>, and
3653  <ulink url="&menu-policy;">The Debian Menu sub-policy</ulink> for more  <ulink url="&policy-menu;">The Debian Menu sub-policy</ulink> for more
3654  information.  information.
3655  </para>  </para>
3656  </section>  </section>
3657  <section id="news"><title><filename>NEWS</filename> file</title>  <section id="news"><title><filename>NEWS</filename></title>
3658  <para>  <para>
3659  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>
3660  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3661  </para>  </para>
3662  </section>  </section>
3663  <section id="maintscripts"><title><filename>{post|pre}{inst|rm}</filename> files</title>  <section id="maintscripts"><title><filename>{pre,post}{inst,rm}</filename></title>
3664  <para>  <para>
3665  These <filename>postinst</filename>, <filename>preinst</filename>,  These <filename>postinst</filename>, <filename>preinst</filename>,
3666  <filename>postrm</filename>, and <filename>prerm</filename> files  <filename>postrm</filename>, and <filename>prerm</filename> files
3667  <footnote><para> Although I used Bash short hand expression to indicate these  <footnote><para> Despite this use of the <command>bash</command>
3668  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
3669  pure POSIX (non-Bash) shell for these <emphasis>maintainer scripts</emphasis>  filenames, you should use pure POSIX syntax for these maintainer scripts for
3670  as much as possible for the better compatibility.  </para> </footnote> are  compatibility with <command>dash</command> as the system shell.  </para> </footnote> are
3671  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put
3672  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
3673  package is installed, upgraded or removed.  package is installed, upgraded, or removed.
3674  </para>  </para>
3675  <para>  <para>
3676  As a novice maintainer, you should avoid any manual editing of  As a novice maintainer, you should avoid any manual editing of
3677  <emphasis>maintainer scripts</emphasis> because they are problematic.  For more  maintainer scripts because they are problematic.  For more
3678  information look in the <ulink url="&policy-mantainerscripts;">Debian  information refer to the <ulink url="&policy-mantainerscripts;">Debian
3679  Policy Manual, 6 'Package maintainer scripts and installation  Policy Manual, 6 "Package maintainer scripts and installation
3680  procedure'</ulink>, and take a look at these example files provided by  procedure"</ulink>, and take a look at the example files provided by
3681  <command>dh_make</command>.  <command>dh_make</command>.
3682  </para>  </para>
3683  <para>  <para>
3684  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
3685  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
3686  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
3687    <emphasis role="strong">upgrade</emphasis> but also for
3688    <emphasis role="strong">remove</emphasis> and
3689    <emphasis role="strong">purge</emphasis>.
3690  </para>  </para>
3691  <para>  <para>
3692  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
3693  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
3694  fixed and there perhaps are new features).  fixed and perhaps that there are new features).
3695  </para>  </para>
3696  <para>  <para>
3697  When the upgrade is necessarily intrusive (eg., config files scattered through  When the upgrade is necessarily intrusive (eg., config files scattered through
3698  various home directories with totally different structure), you may consider to  various home directories with totally different structure), you may
3699  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
3700  documentations required by the policy (<filename>README.Debian</filename> and  (e.g., disabling a service) and providing the proper documentation
3701  <filename>NEWS.Debian</filename>) as the last resort.  Don't bother user with  required by policy (<filename>README.Debian</filename> and
3702  the <command>debconf</command> note invoked from these <emphasis>maintainer  <filename>NEWS.Debian</filename>).  Don't bother the user with
3703  scripts</emphasis> for upgrades.  <command>debconf</command> notes invoked from these maintainer scripts
3704    for upgrades.
3705  </para>  </para>
3706  <para>  <para>
3707  The <systemitem role="package">ucf</systemitem> package provides  The <systemitem role="package">ucf</systemitem> package provides a
3708  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user
3709  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
3710  as ones managed by the <emphasis>maintainer scripts</emphasis>.  This should  as those managed by the maintainer scripts.  This should
3711  minimize issues associated with them.  minimize issues associated with them.
3712  </para>  </para>
3713  <para>  <para>
3714  These <emphasis>maintainer scripts</emphasis> are the Debian enhancements that  These maintainer scripts are among the Debian enhancements that
3715  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must
3716  be very careful not to annoy them with these.  be very careful not to turn them into a source of annoyance.
3717  </para>  </para>
3718  </section>  </section>
3719  <section id="todo"><title><filename>TODO</filename> file</title>  <section id="todo"><title><filename>TODO</filename></title>
3720  <para>  <para>
3721  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
3722  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3723  </para>  </para>
3724  </section>  </section>
3725  <section id="watch"><title><filename>watch</filename> file</title>  <section id="watch"><title><filename>watch</filename></title>
3726  <para>  <para>
3727  The <filename>watch</filename> file format is documented in the <citerefentry>  The <filename>watch</filename> file format is documented in the <citerefentry>
3728  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
3729  manpage.  The <filename>watch</filename> file configures the  manpage.  The <filename>watch</filename> file configures the
3730  <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
3731  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
3732    <ulink url="&dehs;">Debian External Health Status (DEHS)</ulink> service.
3733  </para>  </para>
3734  <para>  <para>
3735  Here's what I put in it:  Here are its contents:
3736  </para>  </para>
3737  <screen>  <screen>
3738  # watch control file for uscan  # watch control file for uscan
# Line 3655  version=3 Line 3740  version=3
3740  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate
3741  </screen>  </screen>
3742  <para>  <para>
3743  Normally with this <filename>watch</filename> file, the URL at  Normally with a <filename>watch</filename> file, the URL at
3744  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of
3745  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
3746  after the final <literal>/</literal>) of these linked URLs are matched against  after the final <literal>/</literal>) of each linked URL is compared against
3747  Perl regular expression (see <citerefentry> <refentrytitle>perlre</refentrytitle>  the Perl regular expression pattern (see <citerefentry> <refentrytitle>perlre</refentrytitle>
3748  <manvolnum>1</manvolnum> </citerefentry>) pattern  <manvolnum>1</manvolnum> </citerefentry>)
3749  <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
3750  the greatest version number is downloaded and the <command>uupdate</command>  the greatest version number is downloaded and the <command>uupdate</command>
3751  program is run to create the updated source tree from them.  program is run to create an updated source tree.
3752  </para>  </para>
3753  <para>  <para>
3754  Although this is true for other sites, the SourceForge download service at  Although this is true for other sites, the SourceForge download service at
3755  <ulink url="&sf-net;"/> is an exception.  When the  <ulink url="&sf-net;"/> is an exception.  When the
3756  <filename>watch</filename> file has an URL matching with the Perl regexp  <filename>watch</filename> file has an URL matching the Perl regexp
3757  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program
3758  substitutes it with <literal>&qa-do;watch/sf.php/</literal> and  replaces it with <literal>&qa-do;watch/sf.php/</literal> and
3759  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
3760  a stable redirect service to the desired file for the  a stable redirect service to the desired file for any
3761  <filename>watch</filename> file having  <filename>watch</filename> pattern of the form
3762  <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>.
3763  This solves issues related to the periodically changing URL there.  This solves issues related to periodically changing SourceForge URLs.
3764  </para>  </para>
3765  </section>  </section>
3766  <section id="sourcef"><title><filename>source/format</filename> file</title>  <section id="sourcef"><title><filename>source/format</filename></title>
3767  <para>  <para>
3768  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
3769  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 3787  should say either:
3787  The newer <literal>3.0 (quilt)</literal> source format records modifications in  The newer <literal>3.0 (quilt)</literal> source format records modifications in
3788  a <command>quilt</command> patch series within  a <command>quilt</command> patch series within
3789  <filename>debian/patches</filename>.  Those changes are then automatically  <filename>debian/patches</filename>.  Those changes are then automatically
3790  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
3791  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
3792  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>
3793  </footnote> The Debian modifications are simply stored in a  </footnote> The Debian modifications are simply stored in a
3794  <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 3805  When <command>dpkg-source</command> extr
3805  the end of the extraction with the <literal>--skip-patches</literal> option.  the end of the extraction with the <literal>--skip-patches</literal> option.
3806  </para>  </para>
3807  </section>  </section>
3808  <section id="sourcel"><title><filename>source/local-options</filename> file</title>  <section id="sourcel"><title><filename>source/local-options</filename></title>
3809  <para>  <para>
3810  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
3811  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 3830  unapply-patches
3830  abort-on-upstream-changes  abort-on-upstream-changes
3831  </screen>  </screen>
3832  </section>  </section>
3833  <section id="sourceopt"><title><filename>source/options</filename> file</title>  <section id="sourceopt"><title><filename>source/options</filename></title>
3834  <para>  <para>
3835  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
3836  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 3845  You can provide a Perl regular expressio
3845  creating the source package.  creating the source package.
3846  </para>  </para>
3847  <para>  <para>
3848  You can store such <command>dpkg-source</command> option argument in the  As a general solution to address this problem of the autogenerated files,
3849  <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
3850  solution to address this problem of the autogenerated files.  The following  <filename>source/options</filename> file of the source package.  The following
3851  will skip creating patch files for <filename>config.sub</filename>,  will skip creating patch files for <filename>config.sub</filename>,
3852  <filename>config.guess</filename> and <filename>Makefile</filename>.  <filename>config.guess</filename>, and <filename>Makefile</filename>.
3853  </para>  </para>
3854  <screen>  <screen>
3855  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"
3856  </screen>  </screen>
3857  </section>  </section>
3858  <section id="patches"><title><filename>patches/*</filename> files</title>  <section id="patches"><title><filename>patches/*</filename></title>
3859  <para>  <para>
3860  The old <literal>1.0</literal> source format created a single large  The old <literal>1.0</literal> source format created a single large
3861  <filename>diff.gz</filename> file which contains package maintenance files in  <filename>diff.gz</filename> file containing package maintenance files in
3862  <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
3863  bit cumbersome to inspect and understand for each source tree modification  bit cumbersome to inspect and understand for each source tree modification
3864  later.  This is not so nice.  later.  This is not so nice.
3865  </para>  </para>
3866  <para>  <para>
3867  The newer <literal>3.0 (quilt)</literal> source format stores patches in  The newer <literal>3.0 (quilt)</literal> source format stores patches in
3868  <filename>debian/patches/*</filename> files using the <command>quilt</command>  <filename>debian/patches/*</filename> files using the <command>quilt</command>
3869  command.  These patches and other package data which are all constrained under  command.  These patches and other package data which are all contained under
3870  the <filename>debian</filename> directory are packaged as the  the <filename>debian</filename> directory are packaged as the
3871  <filename>debian.tar.gz</filename> file.  Since the  <filename>debian.tar.gz</filename> file.  Since the
3872  <command>dpkg-source</command> command can handle <command>quilt</command>  <command>dpkg-source</command> command can handle <command>quilt</command>
3873  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
3874  <systemitem role="package">quilt</systemitem> package, it does not need to  <systemitem role="package">quilt</systemitem> package, it does not need a
3875  <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>.
3876  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
3877  packages.  The <command>quilt</command> system is the preferred maintenance  packages.  The <command>quilt</command> system is the preferred maintenance
3878  system in use.  Other ones are <command>dpatch</command>,  system in use.  Others include <command>dpatch</command>,
3879  <command>dbs</command>, <command>cdbs</command>, etc.  Many of these keep such  <command>dbs</command>, and <command>cdbs</command>.  Many of these keep such
3880  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>
3881  </para>  </para>
3882  <para>  <para>
# Line 3800  The <command>quilt</command> command is Line 3885  The <command>quilt</command> command is
3885  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>
3886  patch files in the <filename>debian/patches</filename> directory and the source  patch files in the <filename>debian/patches</filename> directory and the source
3887  tree is untouched outside of the <filename>debian</filename> directory.  The  tree is untouched outside of the <filename>debian</filename> directory.  The
3888  order of these patches are recorded in the  order of these patches is recorded in the
3889  <filename>debian/patches/series</filename> file.  You can apply (=push),  <filename>debian/patches/series</filename> file.  You can apply (=push),
3890  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are
3891  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
3892  documentation of your changes are very important to expedite the package review  documentation of your changes is very important to expedite the package review
3893  by your sponsor.  </para> </footnote>  by your sponsor.  </para> </footnote>
3894  </para>  </para>
3895  <para>  <para>
3896  For <xref linkend="modify"/>, we created 3 patches in  For <xref linkend="modify"/>, we created three patches in
3897  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
3898  </para>  </para>
3899  <para>  <para>
3900  Since Debian patches are located in <filename>debian/patches</filename>, please  Since Debian patches are located in <filename>debian/patches</filename>, please
3901  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
3902  in <xref linkend="quiltrc"/>.  in <xref linkend="quiltrc"/>.
3903  </para>  </para>
3904  <para>  <para>
3905  When someone (including yourself) provides you with a patch  When anyone (including yourself) provides a patch
3906  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,
3907  then the modification of a <literal>3.0 (quilt)</literal> source package is  modifying a <literal>3.0 (quilt)</literal> source package is
3908  quite simple:  quite simple:
3909  </para>  </para>
3910  <screen>  <screen>
# Line 3833  $ dquilt header -e Line 3918  $ dquilt header -e
3918  </screen>  </screen>
3919  <para>  <para>
3920  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
3921  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
3922  pop -a; while dquilt push; do dquilt refresh; done</literal>.  pop -a; while dquilt push; do dquilt refresh; done</literal>.
3923  </para>  </para>
3924  </section>  </section>
# Line 3844  We should now be ready to build the pack Line 3929  We should now be ready to build the pack
3929  </para>  </para>
3930  <section id="completebuild"><title>Complete (re)build</title>  <section id="completebuild"><title>Complete (re)build</title>
3931  <para>  <para>
3932  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
3933  to install  need to make sure you have installed
3934  </para>  </para>
3935  <itemizedlist>  <itemizedlist>
3936  <listitem>  <listitem>
# Line 3918  Debian archives.  See Line 4003  Debian archives.  See
4003  <ulink url="&keycreate;">Creating a new GPG key</ulink> and  <ulink url="&keycreate;">Creating a new GPG key</ulink> and
4004  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
4005  </para></footnote>  </para></footnote>
4006    If you are building Debian packages only for your local use, you can skip
4007    promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4008    <filename>.changes</filename> file as:
4009  </para>  </para>
4010    <screen>
4011    $ dpkg-buildpackage -us -uc
4012    </screen>
4013  <para>  <para>
4014  After all this is done, you will see the following files in the directory above  For the non-native Debian package, e.g.,
4015  (<filename>~/gentoo</filename>):  <systemitem role="package">gentoo</systemitem>, you will see the following
4016    files in the parent directory (<filename>~/gentoo</filename>) after building
4017    packages:
4018  </para>  </para>
4019  <itemizedlist>  <itemizedlist>
4020  <listitem>  <listitem>
# Line 3929  After all this is done, you will see the Line 4022  After all this is done, you will see the
4022  <filename>gentoo_0.9.12.orig.tar.gz</filename>  <filename>gentoo_0.9.12.orig.tar.gz</filename>
4023  </para>  </para>
4024  <para>  <para>
4025  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
4026  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
4027  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.
4028  </para>  </para>
# Line 3952  people can be sure that it's really your Line 4045  people can be sure that it's really your
4045  </para>  </para>
4046  <para>  <para>
4047  This compressed tarball contains your <filename>debian</filename> directory  This compressed tarball contains your <filename>debian</filename> directory
4048  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
4049  stored as <command>quilt</command> patches in  stored as a <command>quilt</command> patch in
4050  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
4051  </para>  </para>
4052  <para>  <para>
# Line 3981  install and remove this just like any ot Line 4074  install and remove this just like any ot
4074  <filename>gentoo_0.9.12-1_i386.changes</filename>  <filename>gentoo_0.9.12-1_i386.changes</filename>
4075  </para>  </para>
4076  <para>  <para>
4077  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;
4078  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
4079  and source packages in it.  It is partly generated from the  and source packages.  It is partly generated from the
4080  <filename>changelog</filename> file and the <filename>.dsc</filename> file.  <filename>changelog</filename> file and the <filename>.dsc</filename> file.
4081  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.
4082  </para>  </para>
4083  <para>  <para>
4084  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
4085  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
4086  see what has changed.  Debian archive maintenance programs will also post the  see what has changed.  Debian archive maintenance programs will also post the
4087  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 4091  mailing list.
4091  </itemizedlist>  </itemizedlist>
4092  <para>  <para>
4093  The long strings of numbers in the <filename>.dsc</filename> and  The long strings of numbers in the <filename>.dsc</filename> and
4094  <filename>.changes</filename> files are MD5/SHA1/SHA256 checksums for the files  <filename>.changes</filename> files are SHA1/SHA256 checksums for the files
4095  mentioned.  A person downloading your files can test them with <citerefentry>  mentioned.  Anyone downloading your files can test them with <citerefentry>
4096  <refentrytitle>md5sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>
4097  <citerefentry> <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> or <citerefentry> <refentrytitle>sha256sum</refentrytitle>
 </citerefentry>, or <citerefentry> <refentrytitle>sha256sum</refentrytitle>  
4098  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,
4099  they'll know the file is corrupt or has been tampered with.  they'll know the file is corrupt or has been tampered with.
4100  </para>  </para>
4101    <para>
4102    For the native Debian package, e.g.,
4103    <systemitem role="package">mypackage</systemitem>, you will see the following
4104    files in the parent directory after building packages:
4105    </para>
4106    <itemizedlist>
4107    <listitem>
4108    <para>
4109    <filename>mypackage_1.0.tar.gz</filename>
4110    </para>
4111    <para>
4112    This is the source code tarball merely created from the
4113    <filename>mypackage-1.0</filename> directory by the
4114    <command>dpkg-source</command>.  (Its suffix is not <filename>orig.tar.gz</filename>.)
4115    </para>
4116    </listitem>
4117    <listitem>
4118    <para>
4119    <filename>mypackage_1.0.dsc</filename>
4120    </para>
4121    <para>
4122    This is a summary of the contents of the source code as in the non-native
4123    Debian package. (There is no Debian revision.)
4124    </para>
4125    </listitem>
4126    <listitem>
4127    <para>
4128    <filename>mypackage_1.0_i386.deb</filename>
4129    </para>
4130    <para>
4131    This is your completed binary package as in the non-native Debian package.
4132    (There is no Debian revision.)
4133    </para>
4134    </listitem>
4135    <listitem>
4136    <para>
4137    <filename>mypackage_1.0_i386.changes</filename>
4138    </para>
4139    <para>
4140    This file describes all the changes made in the current package version as in
4141    the non-native Debian package. (There is no Debian revision.)
4142    </para>
4143    </listitem>
4144    </itemizedlist>
4145  </section>  </section>
4146  <section id="autobuilder"><title>Autobuilder</title>  <section id="autobuilder"><title>Autobuilder</title>
4147  <para>  <para>
4148  Debian supports many <ulink url="&ports;">ports</ulink>  Debian supports many <ulink url="&ports;">ports</ulink>
4149  with the <ulink url="&buildd;">autobuilder  with the <ulink url="&buildd;">autobuilder
4150  network</ulink> running <command>buildd</command> daemons on many different  network</ulink> running <command>buildd</command> daemons on computers
4151  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
4152  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
4153  how your packages are rebuild for many different architectures by them.  how they rebuild your packages for multiple architectures.
4154  <footnote><para> The actual autobuilder system involves much more complicated  <footnote><para> The actual autobuilder system involves much more complicated
4155  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
4156  this document.  </para> </footnote>  this document.  </para> </footnote>
4157  </para>  </para>
4158  <para>  <para>
4159  For <literal>Architecture: any</literal> packages, the autobuilder system  For <literal>Architecture: any</literal> packages, the autobuilder system
4160  rebuild them.  It ensures to install  performs a rebuild.  It ensures the installation of
4161  </para>  </para>
4162  <itemizedlist>  <itemizedlist>
4163  <listitem>  <listitem>
# Line 4078  create and sign the upload <filename>.ch Line 4214  create and sign the upload <filename>.ch
4214  This is why you see your package for other architectures.  This is why you see your package for other architectures.
4215  </para>  </para>
4216  <para>  <para>
4217  Although packages listed in the <literal>Build-Depends-indep</literal> field  Although packages listed in the <literal>Build-Depends-Indep</literal> field
4218  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
4219  autobuilder system since it build only architecture dependent binary packages.  <xref linkend="completebuild"/>), they are not required to be installed for the
4220    autobuilder system since it builds only architecture dependent binary packages.
4221  <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>
4222  environment under the <systemitem role="package">sbuild</systemitem> package  environment under the <systemitem role="package">sbuild</systemitem> package
4223  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
4224  many packages installed.  </para> </footnote> This difference between normal  system and may have many leftover packages installed.  </para>
4225  packaging and autobuilder situation dictates whether you record such required  </footnote> This distinction between normal packaging and autobuilding
4226    procedures is what dictates whether you should record such required
4227  packages in the <literal>Build-Depends</literal> or  packages in the <literal>Build-Depends</literal> or
4228  <literal>Build-Depends-indep</literal> fields of the  <literal>Build-Depends-Indep</literal> fields of the
4229  <filename>debian/control</filename> file (see <xref linkend="control"/>).  <filename>debian/control</filename> file (see <xref linkend="control"/>).
4230  </para>  </para>
4231  </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>  
4232  <section id="debuild"><title><command>debuild</command> command</title>  <section id="debuild"><title><command>debuild</command> command</title>
4233  <para>  <para>
4234  You can automate package build process of the  You can automate the <command>dpkg-buildpackage</command> command's
4235  <command>dpkg-buildpackage</command> command further with the  package build process further with the
4236  <command>debuild</command> command.  See <citerefentry>  <command>debuild</command> command.  See <citerefentry>
4237  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>
4238  </citerefentry>.  </citerefentry>.
# Line 4113  You can automate package build process o Line 4240  You can automate package build process o
4240  <para>  <para>
4241  Customization of the <command>debuild</command> command can be done through  Customization of the <command>debuild</command> command can be done through
4242  <filename>/etc/devscripts.conf</filename> or  <filename>/etc/devscripts.conf</filename> or
4243  <filename>~/.devscripts</filename>.  I would suggest at least following items:  <filename>~/.devscripts</filename>.  I would suggest at least the following items:
4244  </para>  </para>
4245  <screen>  <screen>
4246  DEBSIGN_KEYID=Your_GPG_keyID  DEBSIGN_KEYID=Your_GPG_keyID
 DEBUILD_LINTIAN=yes  
4247  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides
4248  </screen>  </screen>
4249  <para>  <para>
4250  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
4251  sponsoring packages) and checked by the <command>lintian</command> command in  sponsoring packages) and checked in detail by the <command>lintian</command> command.
 details.  
4252  </para>  </para>
4253  <para>  <para>
4254  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:
4255  </para>  </para>
4256  <screen>  <screen>
4257  $ debuild  $ debuild
4258  </screen>  </screen>
4259  <para>  <para>
4260  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4261  <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
4262  source can be specified as:  <filename>.changes</filename> file as:
4263  </para>  </para>
4264  <screen>  <screen>
4265  $ debuild -sa  $ debuild -us -uc
4266  </screen>  </screen>
4267  <para>  <para>
4268  You can clean source tree as simple as:  You can clean the source tree as simply as:
4269  </para>  </para>
4270  <screen>  <screen>
4271  $ debuild clean  $ debuild clean
# Line 4150  $ debuild clean Line 4275  $ debuild clean
4275  <para>  <para>
4276  For a clean room (<command>chroot</command>) build environment to verify the  For a clean room (<command>chroot</command>) build environment to verify the
4277  build dependencies, the <systemitem role="package">pbuilder</systemitem>  build dependencies, the <systemitem role="package">pbuilder</systemitem>
4278  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
4279    role="package">pbuilder</systemitem> package is still evolving, you should
4280  check the actual configuration situation by consulting the latest official  check the actual configuration situation by consulting the latest official
4281  documentation.</para> </footnote> This ensures a clean build from the source  documentation.</para> </footnote> This ensures a clean build from the source
4282  under the <literal>sid</literal> auto-builder for different architectures and  under the <literal>sid</literal> auto-builder for different architectures and
4283  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
4284  always in the RC (release critical) category.  always in the RC (release critical) category.
4285  <footnote><para>See <ulink url="&buildd-do;"/> for more on the  <footnote><para>See <ulink url="&buildd-do;"/> for more on
4286  auto-builder of the Debian package.</para></footnote>  Debian package auto-building.</para></footnote>
4287  </para>  </para>
4288  <para>  <para>
4289  Let's customize the <systemitem role="package">pbuilder</systemitem> package by  Let's customize the <systemitem role="package">pbuilder</systemitem> package as
4290  the following.  follows:
4291  </para>  </para>
4292  <itemizedlist>  <itemizedlist>
4293  <listitem>  <listitem>
4294  <para>  <para>
4295  setting <filename>/var/cache/pbuilder/result</filename> directory writable by  setting the <filename>/var/cache/pbuilder/result</filename> directory writable by
4296  the user.  for your user account.
4297  </para>  </para>
4298  </listitem>  </listitem>
4299  <listitem>  <listitem>
4300  <para>  <para>
4301  creating a directory, e.g.  creating a directory, e.g.
4302  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,
4303  writable by the user to place hook scripts.  writable by the user, to place hook scripts in.
4304  </para>  </para>
4305  </listitem>  </listitem>
4306  <listitem>  <listitem>
4307  <para>  <para>
4308  setting <filename>~/.pbuilderrc</filename> or  configuring <filename>~/.pbuilderrc</filename> or
4309  <filename>/etc/pbuilderrc</filename> to include as follows.  <filename>/etc/pbuilderrc</filename> to include the followsing.
4310  </para>  </para>
4311  <screen>  <screen>
4312  AUTO_DEBSIGN=yes  AUTO_DEBSIGN=${AUTO_DEBSIGN:-yes}
4313  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>
4314  </screen>  </screen>
4315  </listitem>  </listitem>
# Line 4193  This will allow you to sign generated pa Line 4319  This will allow you to sign generated pa
4319  <filename>~/.gnupg/</filename> directory.  <filename>~/.gnupg/</filename> directory.
4320  </para>  </para>
4321  <para>  <para>
4322  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
4323  follows.  follows.
4324  </para>  </para>
4325  <screen>  <screen>
4326  $ sudo pbuilder create  $ sudo pbuilder create
4327  </screen>  </screen>
4328  <para>  <para>
4329  If you already have the completed source packages, issue the following commands  If you already have a completed source package, issue the following commands
4330  in the directory where the  in the directory where the
4331  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,
4332  <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 4336  the local <systemitem role="package">pbu
4336  </para>  </para>
4337  <screen>  <screen>
4338  $ sudo pbuilder --update  $ sudo pbuilder --update
4339  $ sudo pbuilder --build <replaceable>foo</replaceable>.dsc  $ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc
4340  </screen>  </screen>
4341  <para>  <para>
4342  Please note that the <command>dpkg-buildpackage</command> option  The newly built packages without the GPG signatures will be located in
4343  <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:  
4344  </para>  </para>
 <screen>  
 $ sudo pbuilder --build --debbuildopts -sa <replaceable>foo</replaceable>.dsc  
 </screen>  
4345  <para>  <para>
4346  The newly built packages will be located in  The GPG signatures on the <filename>.dsc</filename> file and the
4347  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.  <filename>.changes</filename> file can be generated as:
4348  </para>  </para>
4349    <screen>
4350    $ cd /var/cache/pbuilder/result/
4351    $ debsign <replaceable>foo_version</replaceable>.dsc
4352    $ debsign <replaceable>foo_version_arch</replaceable>.changes
4353    </screen>
4354  <para>  <para>
4355  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
4356  source packages, issue the following commands in the source directory where the  source package, issue the following commands in the source directory where the
4357  <filename>debian</filename> directory exists, instead.  <filename>debian</filename> directory exists, instead.
4358  </para>  </para>
4359  <screen>  <screen>
# Line 4234  $ sudo pbuilder --update Line 4361  $ sudo pbuilder --update
4361  $ pdebuild  $ pdebuild
4362  </screen>  </screen>
4363  <para>  <para>
4364  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4365  <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
4366  source can be specified as:  <filename>.changes</filename> file as:
4367  </para>  </para>
4368  <screen>  <screen>
4369  $ pdebuild --debbuildopts -sa  $ AUTO_DEBSIGN=no pdebuild
4370  </screen>  </screen>
4371  <para>  <para>
4372  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 4380  the <literal>chroot</literal> environmen
4380  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>
4381  configured as follows.  <footnote><para> This assumes  configured as follows.  <footnote><para> This assumes
4382  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many
4383  examples of the hook script in the  examples of hook scripts in the
4384  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>
4385  </footnote>  </footnote>
4386  </para>  </para>
# Line 4272  echo +++ end of lintian output +++ Line 4399  echo +++ end of lintian output +++
4399  </screen>  </screen>
4400  <para>  <para>
4401  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
4402  build packages properly for <literal>sid</literal>.  In reality,  build packages properly for <literal>sid</literal>.  In practice,
4403  <literal>sid</literal> may be experiencing issues which makes it not desirable  <literal>sid</literal> may be experiencing issues which makes it undesirable
4404  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
4405  kind of situation.  kind of situation.
4406  </para>  </para>
# Line 4282  You may need to update your <literal>sta Line 4409  You may need to update your <literal>sta
4409  release for <literal>stable-proposed-updates</literal>,  release for <literal>stable-proposed-updates</literal>,
4410  <literal>stable/updates</literal>, etc.  <footnote><para> There are some  <literal>stable/updates</literal>, etc.  <footnote><para> There are some
4411  restrictions for such updates of your <literal>stable</literal> package.  restrictions for such updates of your <literal>stable</literal> package.
4412  </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>
4413  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
4414  environments of almost any Debian derivative distributions of the same CPU  environments of almost any Debian derivative distribution of the same CPU
4415  architecture.  architecture.
4416  </para>  </para>
4417  <para>  <para>
# Line 4298  See <ulink url="&pbuilder;"/>, Line 4425  See <ulink url="&pbuilder;"/>,
4425  </section>  </section>
4426  <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>
4427  <para>  <para>
4428  If your upstream uses the source code management system (VCS)  If your upstream uses a source code management system (VCS)
4429  <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>
4430  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
4431  and cherry-picking upstream patches much easier.  There are several specialized  and cherry-picking upstream patches much easier.  There are several specialized
4432  wrapper script packages for the Debian package building for each VCS.  wrapper script packages for Debian package building for each VCS.
4433  </para>  </para>
4434  <itemizedlist>  <itemizedlist>
4435  <listitem>  <listitem>
4436  <para>  <para>
4437  <systemitem role="package">git-buildpackage</systemitem>: Suite to help with  <systemitem role="package">git-buildpackage</systemitem>: a suite to help with
4438  Debian packages in Git repositories.  Debian packages in Git repositories.
4439  </para>  </para>
4440  </listitem>  </listitem>
# Line 4319  maintain Debian packages with Subversion Line 4446  maintain Debian packages with Subversion
4446  </listitem>  </listitem>
4447  <listitem>  <listitem>
4448  <para>  <para>
4449  <systemitem role="package">cvs-buildpackage</systemitem>: A set of Debian  <systemitem role="package">cvs-buildpackage</systemitem>: a set of Debian
4450  package scripts for CVS source trees.  package scripts for CVS source trees.
4451  </para>  </para>
4452  </listitem>  </listitem>
4453  </itemizedlist>  </itemizedlist>
4454  <para>  <para>
4455  There are packages which <emphasis>automate</emphasis> building of packages  For advanced audiences, there are packages which <emphasis>automate</emphasis>
4456  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
4457  in this tutorial.  in this tutorial.
4458  <footnote><para> Here are few web resources available for advanced audiences.  </para>  <footnote><para> Here are some web resources available for advanced audiences.  </para>
4459  <itemizedlist>  <itemizedlist>
4460  <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>
4461  <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>
4462  <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>
4463  <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>
4464  <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 4469  in this tutorial.
4469  <section id="quickrebuild"><title>Quick rebuild</title>  <section id="quickrebuild"><title>Quick rebuild</title>
4470  <para>  <para>
4471  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
4472  you tune details in <filename>debian/rules</filename>.  For testing purposes,  you're tuning details in <filename>debian/rules</filename>.  For testing purposes,
4473  you can make a <filename>.deb</filename> file without rebuilding the upstream  you can make a <filename>.deb</filename> file without rebuilding the upstream
4474  sources like this <footnote><para> Environment variables which are normally  sources like this<footnote><para> Environment variables which are normally
4475  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
4476  packages to be uploaded using this <emphasis role="strong">quick</emphasis>  packages to be uploaded using this <emphasis role="strong">quick</emphasis>
4477  method.  </para> </footnote>:  method.  </para> </footnote>:
# Line 4353  method.  </para> </footnote>: Line 4480  method.  </para> </footnote>:
4480  $ fakeroot debian/rules binary  $ fakeroot debian/rules binary
4481  </screen>  </screen>
4482  <para>  <para>
4483  Or, simply as following to see if it build or not.  Or simply do the following to see if it builds or not:
4484  </para>  </para>
4485  <screen>  <screen>
4486  $ fakeroot debian/rules build  $ fakeroot debian/rules build
# Line 4367  proper procedure.  You may not be able t Line 4494  proper procedure.  You may not be able t
4494  </chapter>  </chapter>
4495  <chapter id="checkit"><title>Checking the package for errors</title>  <chapter id="checkit"><title>Checking the package for errors</title>
4496  <para>  <para>
4497  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
4498  yourself before uploading packages to public archives.  before uploading it to the public archives.
4499  </para>  </para>
4500  <para>  <para>
4501  Testing on machine other than your own is also good idea.  You must watch  It's also a good idea to carry out testing on a machine other than your own.  You must watch
4502  closely for any warnings or errors for all the test described here.  closely for any warnings or errors for all the tests described here.
4503  </para>  </para>
4504  <section id="pinstall"><title>Verifying package for install</title>  <section id="inadvent"><title>Suspicious changes</title>
4505  <para>  <para>
4506  You must test your package if it installs without problem.  The <citerefentry>  If you find a new autogenerated patch file such as
4507    <filename>debian-changes-*</filename> in the
4508    <filename>debian/patches</filename> directory after building your non-native
4509    Debian package in <literal>3.0 (quilt)</literal> format, chances are you
4510    changed some files by accident or the build script modified the upstream
4511    source.  If it is your mistake, fix it.  If it is caused by the build script,
4512    fix the root cause with <command>dh-autoreconf</command> as in
4513    <xref linkend="customrules"/> or work around it with
4514    <filename>source/options</filename> as in <xref linkend="sourceopt"/>.
4515    </para>
4516    </section>
4517    <section id="pinstall"><title>Verifying a package's installation</title>
4518    <para>
4519    You must test your package for whether it installs without problem.  The <citerefentry>
4520  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4521  command helps you to test to install all the generated binary packages.  command helps you to test installing all the generated binary packages.
4522  </para>  </para>
4523  <screen>  <screen>
4524  $ sudo debi gentoo_0.9.12-1_i386.changes  $ sudo debi gentoo_0.9.12-1_i386.changes
4525  </screen>  </screen>
4526  <para>  <para>
4527  You have to make sure that there are no overlapped files with other existing  To prevent installation problem on different systems, you must make
4528  packages using the  sure that there are no filenames conflicting with other existing packages,
4529    using the
4530  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded
4531  from the Debian archive to prevent installation problem on different systems.  from the Debian archive,
4532  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
4533  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
4534  alternatives mechanism (see <citerefentry>  renaming the file, moving a common file to a separate package that
4535  <refentrytitle>update-alternatives</refentrytitle> <manvolnum>1</manvolnum>  multiple packages can depend on, using the alternatives mechanism (see
4536  </citerefentry>) by coordinating with other affected packages or by setting the  <citerefentry><refentrytitle>update-alternatives</refentrytitle>
4537  <literal>Conflicts</literal> entry in the <filename>debian/control</filename>  <manvolnum>1</manvolnum></citerefentry>) in coordination with the
4538  file.  maintainers of other affected packages, or declaring a
4539    <literal>Conflicts</literal> relationship in the
4540    <filename>debian/control</filename> file.
4541  </para>  </para>
4542  </section>  </section>
4543  <section id="pmaintscripts"><title>Verifying package for <emphasis>maintainer scripts</emphasis></title>  <section id="pmaintscripts"><title>Verifying a package's maintainer scripts</title>
4544  <para>  <para>
4545  All <emphasis>maintainer scripts</emphasis>, i.e.,  All maintainer scripts (that is,
4546  <filename>preinst</filename>, <filename>prerm</filename>,  <filename>preinst</filename>, <filename>prerm</filename>,
4547  <filename>postinst</filename>, and <filename>postrm</filename> files, are  <filename>postinst</filename>, and <filename>postrm</filename> files) are
4548  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
4549    <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are
4550  a novice maintainer (see <xref linkend="maintscripts"/>).  a novice maintainer (see <xref linkend="maintscripts"/>).
4551  </para>  </para>
4552  <para>  <para>
4553  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,
4554  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  
4555  when packages are removed or purged.  Use the <command>dpkg</command> command  when packages are removed or purged.  Use the <command>dpkg</command> command
4556  as follows to test them.  as follows to test them.
4557  </para>  </para>
# Line 4472  people will often be upgrading to your p Line 4615  people will often be upgrading to your p
4615  last Debian release.  Remember to test upgrades from that version too.  last Debian release.  Remember to test upgrades from that version too.
4616  </para>  </para>
4617  <para>  <para>
4618  Although downgrade is not officially supported, it should be nice to support  Although downgrading is not officially supported, supporting it is a
4619  it.  friendly gesture.
4620  </para>  </para>
4621  </section>  </section>
4622  <section id="lintians"><title><systemitem role="package">lintian</systemitem> package</title>  <section id="lintians"><title>Using <systemitem role="package">lintian</systemitem></title>
4623  <para>  <para>
4624  Run <citerefentry> <refentrytitle>lintian</refentrytitle>  Run <citerefentry> <refentrytitle>lintian</refentrytitle>
4625  <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 4636  $ lintian -i -I --show-overrides gentoo_
4636  <para>  <para>
4637  Of course, replace the filename with the name of the  Of course, replace the filename with the name of the
4638  <filename>.changes</filename> file generated for your package.  The output of  <filename>.changes</filename> file generated for your package.  The output of
4639  the <command>lintian</command> command are marked as follows.  the <command>lintian</command> command uses the following flags.
4640  </para>  </para>
4641  <itemizedlist>  <itemizedlist>
4642  <listitem>  <listitem>
4643  <para>  <para>
4644  <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.
4645  </para>  </para>
4646  </listitem>  </listitem>
4647  <listitem>  <listitem>
4648  <para>  <para>
4649  <literal>W:</literal> for warning; a possible policy violation or a packaging  <literal>W:</literal> for warning; a possible policy violation or packaging
4650  error.  error.
4651  </para>  </para>
4652  </listitem>  </listitem>
4653  <listitem>  <listitem>
4654  <para>  <para>
4655  <literal>I:</literal> for info; a information on certain packaging aspects.  <literal>I:</literal> for info; information on certain aspects of packaging.
4656  </para>  </para>
4657  </listitem>  </listitem>
4658  <listitem>  <listitem>
# Line 4526  error. Line 4669  error.
4669  </listitem>  </listitem>
4670  </itemizedlist>  </itemizedlist>
4671  <para>  <para>
4672  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
4673  spurious.  If spurious, set the <filename>lintian-overrides</filename> files as  spurious.  If spurious, set up <filename>lintian-overrides</filename> files as
4674  described in <xref linkend="lintian"/>.  described in <xref linkend="lintian"/>.
4675  </para>  </para>
4676  <para>  <para>
4677  Note that you can build the package with <command>dpkg-buildpackage</command>  Note that you can build the package with <command>dpkg-buildpackage</command>
4678  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>
4679  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4680  or with <citerefentry> <refentrytitle>pdebuild</refentrytitle>  or <citerefentry> <refentrytitle>pdebuild</refentrytitle>
4681  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
4682  </para>  </para>
4683  </section>  </section>
4684  <section id="debc"><title><command>debc</command> command</title>  <section id="debc"><title>The <command>debc</command> command</title>
4685  <para>  <para>
4686  You can list files in the binary Debian package by <citerefentry>  You can list files in the binary Debian package with the <citerefentry>
4687  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4688  command.  command.
4689  </para>  </para>
# Line 4548  command. Line 4691  command.
4691  $ debc <replaceable>package</replaceable>.changes  $ debc <replaceable>package</replaceable>.changes
4692  </screen>  </screen>
4693  </section>  </section>
4694  <section id="debdiff"><title><command>debdiff</command> command</title>  <section id="debdiff"><title>The <command>debdiff</command> command</title>
4695  <para>  <para>
4696  You can compare file contents in two source Debian packages with the  You can compare file contents in two source Debian packages with the
4697  <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 4709  You can also compare file lists in two s
4709  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes
4710  </screen>  </screen>
4711  <para>  <para>
4712  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
4713  no files have been unintentionally misplaced or removed in the binary packages,  and to check for inadvertent changes made when updating binary
4714  and if no other inadvertent changes were made when updating binary packages.  packages, such as unintentionally misplacing or removing files.
4715  </para>  </para>
4716  </section>  </section>
4717  <section id="interdiff"><title><command>interdiff</command> command</title>  <section id="interdiff"><title>The <command>interdiff</command> command</title>
4718  <para>  <para>
4719  You can compare two <filename>diff.gz</filename> files with the <citerefentry>  You can compare two <filename>diff.gz</filename> files with the <citerefentry>
4720  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>
# Line 4588  files as described in <xref linkend="pat Line 4731  files as described in <xref linkend="pat
4731  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.
4732  </para>  </para>
4733  </section>  </section>
4734  <section id="mc"><title><command>mc</command> command</title>  <section id="mc"><title>The <command>mc</command> command</title>
4735  <para>  <para>
4736  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
4737  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 4743  contents of <filename>*.deb</filename> p
4743  <para>  <para>
4744  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
4745  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
4746  your <filename>rules</filename> file to compensate for that.  your <filename>rules</filename> file to compensate for this.
4747  </para>  </para>
4748  </section>  </section>
4749  </chapter>  </chapter>
# Line 4618  See <xref linkend="socialdynamism"/>. Line 4761  See <xref linkend="socialdynamism"/>.
4761  you can upload the package to the Debian archive.  you can upload the package to the Debian archive.
4762  <footnote><para>  <footnote><para>
4763  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>
4764  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
4765  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
4766  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
4767  non-DD, too.  non-DDs, too.
4768  </para></footnote>  </para></footnote>
4769  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
4770  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>
# Line 4629  automated tools, like <citerefentry> <re Line 4772  automated tools, like <citerefentry> <re
4772  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
4773  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>
4774  The <systemitem role="package">dput</systemitem> package seems to come with  The <systemitem role="package">dput</systemitem> package seems to come with
4775  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
4776  <filename>/etc/dput</filename> file for the global configuration and the  file <filename>/etc/dput</filename> for its global configuration and the
4777  <filename>~/.dput.cf</filename> file for the per-user one.  It supports Ubuntu  file <filename>~/.dput.cf</filename> for per-user configuration.  It supports
4778  related services out-of-box, too.  </para> </footnote>  Ubuntu-related services out-of-the-box, too.  </para> </footnote>
4779  </para>  </para>
4780  <para>  <para>
4781  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 4792  these options means.
4792  The <literal>$default_host</literal> option determines which of the upload  The <literal>$default_host</literal> option determines which of the upload
4793  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
4794  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.
4795  <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>
4796  </para>  </para>
4797  <para>  <para>
4798  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:
4799  </para>  </para>
4800  <screen>  <screen>
4801  $ dupload gentoo_0.9.12-1_i386.changes  $ dupload gentoo_0.9.12-1_i386.changes
4802  </screen>  </screen>
4803  <para>  <para>
4804  <command>dupload</command> checks that the MD5/SHA1/SHA256 checksums of the  <command>dupload</command> checks that the SHA1/SHA256 file checksums
4805  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
4806  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.
4807  </para>  </para>
4808  <!--  <!--
# Line 4669  will ask for your password on Debian mac Line 4812  will ask for your password on Debian mac
4812  -->  -->
4813  <para>  <para>
4814  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
4815  by manually uploading GPG signed <filename>*.commands</filename> file to there  by manually uploading a GPG-signed <filename>*.commands</filename> file to there
4816  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
4817  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
4818    role="package">dput</systemitem> package.  </para> </footnote> For example, using
4819  <filename>hello.commands</filename>:  <filename>hello.commands</filename>:
4820  </para>  </para>
4821  <screen>  <screen>
4822  -----BEGIN PGP SIGNED MESSAGE-----  -----BEGIN PGP SIGNED MESSAGE-----
4823    Hash: SHA1
4824  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;
4825  Commands:  Commands:
4826   rm hello_1.0-1_i386.deb   rm hello_1.0-1_i386.deb
4827   mv hello_1.0-1.dsx hello_1.0-1.dsc   mv hello_1.0-1.dsx hello_1.0-1.dsc
4828  -----BEGIN PGP SIGNATURE-----  -----BEGIN PGP SIGNATURE-----
4829  Version: 2.6.3ia  Version: GnuPG v1.4.10 (GNU/Linux)
4830  iQCVAwUBNFiQSXVhJ0HiWnvJAQG58AP+IDJVeSWmDvzMUphScg1EK0mvChgnuD7h  
4831  BRiVQubXkB2DphLJW5UUSRnjw1iuFcYwH/lFpNpl7XP95LkLX3iFza9qItw4k2/q  [...]
 tvylZkmIA9jxCyv/YB6zZCbHmbvUnL473eLRoxlnYZd3JFaCZMJ86B0Ph4GFNPAf  
 Z4jxNrgh7Bc=  
 =pH94  
4832  -----END PGP SIGNATURE-----  -----END PGP SIGNATURE-----
4833  </screen>  </screen>
4834  </section>  </section>
4835    <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>
4836    <para>
4837    When you first upload the package to the archive, you need to include the
4838    original <filename>orig.tar.gz</filename> source, too.  If the Debian revision
4839    number of this package is neither <literal>1</literal> nor
4840    <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command>
4841    option <literal>-sa</literal>.
4842    </para>
4843    <para>
4844    For the <command>dpkg-buildpackage</command> command:
4845    </para>
4846    <screen>
4847    $ dpkg-buildpackage -sa
4848    </screen>
4849    <para>
4850    For the <command>debuild</command> command:
4851    </para>
4852    <screen>
4853    $ debuild -sa
4854    </screen>
4855    <para>
4856    For the <command>debuild</command> command:
4857    </para>
4858    <screen>
4859    $ pdebuild --debbuildopts -sa
4860    </screen>
4861    <para>
4862    On the other hand, the <literal>-sd</literal> option will force the exclusion
4863    of the original <filename>orig.tar.gz</filename> source.
4864    </para>
4865    </section>
4866  <section id="skipped-uploads"><title>Skipped uploads</title>  <section id="skipped-uploads"><title>Skipped uploads</title>
4867  <para>  <para>
4868  If you created multiple entries in <filename>debian/changelog</filename> by  If you created multiple entries in <filename>debian/changelog</filename> by
4869  skipping uploads, you must create a proper <filename>*_.changes</filename> file  skipping uploads, you must create a proper <filename>*_.changes</filename> file
4870  which includes all changes from the last upload.  which includes all changes from the last upload.
4871    This can be done by specifying the <command>dpkg-buildpackage</command> option
4872    <literal>-v</literal> with the version, e.g.,
4873    <literal><replaceable>1.2</replaceable></literal>.
4874  </para>  </para>
4875  <para>  <para>
4876  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.  
4877  </para>  </para>
4878    <screen>
4879    $ dpkg-buildpackage -v<replaceable>1.2</replaceable>
4880    </screen>
4881    <para>
4882    For the <command>debuild</command> command:
4883    </para>
4884    <screen>
4885    $ debuild -v<replaceable>1.2</replaceable>
4886    </screen>
4887    <para>
4888    For the <command>debuild</command> command:
4889    </para>
4890    <screen>
4891    $ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>"
4892    </screen>
4893  </section>  </section>
4894  </chapter>  </chapter>
4895  <chapter id="update"><title>Updating the package</title>  <chapter id="update"><title>Updating the package</title>
4896  <para>  <para>
4897  Once you release a package, you need to update it soon.  After you release a package, you will soon need to update it.
4898  </para>  </para>
4899  <section id="newrevision"><title>New Debian revision</title>  <section id="newrevision"><title>New Debian revision</title>
4900  <para>  <para>
4901  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
4902  <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.
4903  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.
4904  </para>  </para>
4905  <itemizedlist>  <itemizedlist>
4906  <listitem>  <listitem>
# Line 4722  If this is to be recorded as a new patch Line 4911  If this is to be recorded as a new patch
4911  <listitem>  <listitem>
4912  <para>  <para>
4913  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set
4914  patch name;  the patch name;
4915  </para>  </para>
4916  </listitem>  </listitem>
4917  <listitem>  <listitem>
4918  <para>  <para>
4919  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare
4920  file to be modified;  the file to be modified;
4921  </para>  </para>
4922  </listitem>  </listitem>
4923  <listitem>  <listitem>
# Line 4738  Correct the problem in the package sourc Line 4927  Correct the problem in the package sourc
4927  </listitem>  </listitem>
4928  <listitem>  <listitem>
4929  <para>  <para>
4930  <literal>dquilt refresh</literal> to record to  <literal>dquilt refresh</literal> to record it to
4931  <filename><replaceable>bugname.patch</replaceable></filename>;  <filename><replaceable>bugname.patch</replaceable></filename>;
4932  </para>  </para>
4933  </listitem>  </listitem>
# Line 4757  If this is to update an existing patch, Line 4946  If this is to update an existing patch,
4946  <listitem>  <listitem>
4947  <para>  <para>
4948  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall
4949  existing <filename><replaceable>foo.patch</replaceable></filename>;  the existing <filename><replaceable>foo.patch</replaceable></filename>;
4950  </para>  </para>
4951  </listitem>  </listitem>
4952  <listitem>  <listitem>
# Line 4791  Add a new revision at the top of the Deb Line 4980  Add a new revision at the top of the Deb
4980  file, for example with <literal>dch -i</literal>, or explicitly with  file, for example with <literal>dch -i</literal>, or explicitly with
4981  <literal>dch -v  <literal>dch -v
4982  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>
4983  and then insert the comments using your preferred editor.  <footnote><para> To  and then insert the comments using your preferred editor.  <footnote><para>To
4984  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>.
4985  </para> </footnote>  </para> </footnote>
4986  </para>  </para>
# Line 4799  get the date in the required format, use Line 4988  get the date in the required format, use
4988  <listitem>  <listitem>
4989  <para>  <para>
4990  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,
4991  followed by <literal>Closes: #54321</literal>.  That way, the bug report will  followed by <literal>Closes: #654321</literal>.  That way, the bug report will
4992  be <emphasis>automagically</emphasis> closed by the archive maintenance  be <emphasis>automagically</emphasis> closed by the archive maintenance
4993  software the moment your package gets accepted in the Debian archive.  software the moment your package gets accepted into the Debian archive.
4994  </para>  </para>
4995  </listitem>  </listitem>
4996  <listitem>  <listitem>
# Line 4818  changed and it already exists in the Deb Line 5007  changed and it already exists in the Deb
5007  </para>  </para>
5008  </listitem>  </listitem>
5009  </itemizedlist>  </itemizedlist>
5010    <para>
5011    One of the tricky case happens when you make an experimental package before
5012    uploading the normal version, e.g.,
5013    <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>.
5014    For such case, you use a version string in the Debian
5015    <filename>changelog</filename> file as
5016    <literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>. See <xref linkend="namever"/> for the order of version strings.
5017    </para>
5018    <para>
5019    </para>
5020  </section>  </section>
5021  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>
5022  <para>  <para>
5023  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
5024  must check the new upstream release, first.  must check the new upstream release, first.
5025  </para>  </para>
5026  <para>  <para>
5027  You start this by reading the upstream <filename>changelog</filename>,  Start by reading the upstream <filename>changelog</filename>,
5028  <filename>NEWS</filename>, and whatever other documentations they may have  <filename>NEWS</filename>, and whatever other documentation they may have
5029  released with the new version.  released with the new version.
5030  </para>  </para>
5031  <para>  <para>
5032  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,
5033  watch out for anything suspicious.  watching out for anything suspicious.
5034  </para>  </para>
5035  <screen>  <screen>
5036  $ 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 5042  Changes to some auto-generated files by
5042  <filename>config.sub</filename>, <filename>configure</filename>,  <filename>config.sub</filename>, <filename>configure</filename>,
5043  <filename>depcomp</filename>, <filename>install-sh</filename>,  <filename>depcomp</filename>, <filename>install-sh</filename>,
5044  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be
5045  ignored.  You may erase them before running <command>diff</command> to the  ignored.  You may delete them before running <command>diff</command> on the
5046  source for inspection.  source for inspection.
5047  </para>  </para>
5048  </section>  </section>
# Line 4859  in the new extracted source.  <footnote> Line 5058  in the new extracted source.  <footnote>
5058  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
5059  /<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
5060  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of
5061  course, you need to do few obvious chores.  course, you need to do some obvious chores.
5062  </para>  </para>
5063  <itemizedlist>  <itemizedlist>
5064  <listitem>  <listitem>
5065  <para>  <para>
5066  Create a copy of upstream source as the  Create a copy of the upstream source as the
5067  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.
5068  </para>  </para>
5069  </listitem>  </listitem>
# Line 4907  in <filename>.rej</filename> files). Line 5106  in <filename>.rej</filename> files).
5106  <itemizedlist>  <itemizedlist>
5107  <listitem>  <listitem>
5108  <para>  <para>
5109  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,
5110  </para>  </para>
5111  <itemizedlist>  <itemizedlist>
5112  <listitem>  <listitem>
# Line 4932  upstream source, Line 5131  upstream source,
5131  <listitem>  <listitem>
5132  <para>  <para>
5133  Edit the <filename><replaceable>baz</replaceable></filename> file manually to  Edit the <filename><replaceable>baz</replaceable></filename> file manually to
5134  realize intended effect of  bring about the intended effect of
5135  <filename><replaceable>baz</replaceable>.rej</filename>.  <filename><replaceable>baz</replaceable>.rej</filename>.
5136  </para>  </para>
5137  </listitem>  </listitem>
# Line 4945  realize intended effect of Line 5144  realize intended effect of
5144  </listitem>  </listitem>
5145  <listitem>  <listitem>
5146  <para>  <para>
5147  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>.
5148  </para>  </para>
5149  </listitem>  </listitem>
5150  </itemizedlist>  </itemizedlist>
# Line 4993  You can release this updated source by r Line 5192  You can release this updated source by r
5192  <section id="packagestyle"><title>Updating the packaging style</title>  <section id="packagestyle"><title>Updating the packaging style</title>
5193  <para>  <para>
5194  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
5195  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
5196  source format by doing this.  <footnote><para> If your sponsor or other  <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal>
5197  maintainers object to updating the existing packaging style, it is not worth  source format.  <footnote><para> If your sponsor or other
5198  bothering nor arguing.  There are more important things to do.  </para>  maintainers object to updating the existing packaging style, don't bother
5199    arguing.  There are more important things to do.  </para>
5200  </footnote>  </footnote>
5201  </para>  </para>
5202  <itemizedlist>  <itemizedlist>
5203  <listitem>  <listitem>
5204  <para>  <para>
5205  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
5206  <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
5207  <literal>--addmissing</literal> option.  Then edit them properly.  the <literal>--addmissing</literal> option.  Then edit them appropriately.
5208  </para>  </para>
5209  </listitem>  </listitem>
5210  <listitem>  <listitem>
5211  <para>  <para>
5212  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
5213  <filename>debian/rules</filename> file, update it to use <command>dh</command>.  <filename>debian/rules</filename> file, update it to use <command>dh</command>.
5214  Update the <filename>debian/control</filename> file accordingly.  Update the <filename>debian/control</filename> file accordingly.
5215  </para>  </para>
# Line 5021  If you want to update the <filename>rule Line 5221  If you want to update the <filename>rule
5221  System (<systemitem role="package">cdbs</systemitem>) to the  System (<systemitem role="package">cdbs</systemitem>) to the
5222  <command>dh</command> syntax, see  <command>dh</command> syntax, see
5223  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its
5224  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the  <literal>DEB_*</literal> configuration variables.
5225    <!--
5226    <footnote><para> In the
5227  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some
5228  negative descriptions of the <filename>rules</filename> file created by the  negative descriptions of the <filename>rules</filename> file created by the
5229  <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
5230  only for <literal>lenny</literal> which created explicit targets with long list  only for <literal>lenny</literal> which created explicit targets with long lists
5231  of <command>dh_*</command> commands.  </para> </footnote>  of <command>dh_*</command> commands.  </para> </footnote>
5232    -->
5233  </para>  </para>
5234  </listitem>  </listitem>
5235  <listitem>  <listitem>
# Line 5035  If you have a <literal>1.0</literal> sou Line 5238  If you have a <literal>1.0</literal> sou
5238  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5239  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
5240  creating <filename>debian/source/format</filename> with <literal>3.0  creating <filename>debian/source/format</filename> with <literal>3.0
5241  (native)</literal>.  The rest of <filename>debian/*</filename> files can be  (native)</literal>.  The rest of the <filename>debian/*</filename> files can just be
5242  just copied.  copied.
5243  </para>  </para>
5244  </listitem>  </listitem>
5245  <listitem>  <listitem>
# Line 5045  If you have a <literal>1.0</literal> sou Line 5248  If you have a <literal>1.0</literal> sou
5248  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5249  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
5250  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.
5251  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
5252  <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
5253  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>
5254  command to your <command>quilt</command> system, if needed.  <footnote><para>  to your <command>quilt</command> system, if needed.  <footnote><para>
5255  You may split <filename>big.diff</filename> into many small incremental patches  You can split <filename>big.diff</filename> into many small incremental patches
5256  using the <command>splitdiff</command> command.  </para> </footnote>  using the <command>splitdiff</command> command.  </para> </footnote>
5257  </para>  </para>
5258  </listitem>  </listitem>
5259  <listitem>  <listitem>
5260  <para>  <para>
5261  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>,
5262  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the
5263  <systemitem role="package">quilt</systemitem> command using  <systemitem role="package">quilt</systemitem> command using
5264  <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 5269  If it was packaged with another patch sy
5269  If it was packaged with the <command>dh</command> command with the  If it was packaged with the <command>dh</command> command with the
5270  <literal>--with quilt</literal> option or with the  <literal>--with quilt</literal> option or with the
5271  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>
5272  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
5273  (native)</literal> source format.  (native)</literal> source format.
5274  </para>  </para>
5275  </listitem>  </listitem>
5276  </itemizedlist>  </itemizedlist>
5277  <para>  <para>
5278  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.
5279  </para>  </para>
5280  </section>  </section>
5281  <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 5286  Here are few reminders for updating pack
5286  <listitem>  <listitem>
5287  <para>  <para>
5288  Preserve old <filename>changelog</filename> entries (sounds obvious, but there  Preserve old <filename>changelog</filename> entries (sounds obvious, but there
5289  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
5290  <literal>dch -i</literal>.)  <literal>dch -i</literal>.)
5291  </para>  </para>
5292  </listitem>  </listitem>
# Line 5104  and <filename>debian/control</filename> Line 5307  and <filename>debian/control</filename>
5307  </listitem>  </listitem>
5308  <listitem>  <listitem>
5309  <para>  <para>
5310  Check to see <ulink url="&bts;">Debian Bug Tracking  Check the <ulink url="&bts;">Debian Bug Tracking
5311  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
5312  currently open in it.  currently open.
5313  </para>  </para>
5314  </listitem>  </listitem>
5315  <listitem>  <listitem>
5316  <para>  <para>
5317  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
5318  are uploading to the correct distribution, the proper bugs closures are listed  are uploading to the correct distribution, the proper bug closures are listed
5319  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and
5320  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.
5321  </para>  </para>

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

  ViewVC Help
Powered by ViewVC 1.1.5