/[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 8728 by osamu, Tue Apr 26 13:43:45 2011 UTC revision 8792 by osamu, Tue May 3 16:15:23 2011 UTC
# Line 121  important topics.  Some of them may look Line 121  important topics.  Some of them may look
121  I have also intentionally skipped some corner cases and provided only pointers  I have also intentionally skipped some corner cases and provided only pointers
122  to keep this document simple.  to keep this document simple.
123  </para>  </para>
124  <section id="socialdynamism"><title>Social dynamics of Debian</title>  <section id="socialdynamics"><title>Social dynamics of Debian</title>
125  <para>  <para>
126  Here are some observations of Debian's social dynamics, presented in the hope  Here are some observations of Debian's social dynamics, presented in the hope
127  that it will prepare you for interactions with Debian.  that it will prepare you for interactions with Debian.
# Line 220  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>
227  </itemizedlist>  </itemizedlist>
228  </section>  </section>
229  <section id="needprogs"><title>Programs you need for development</title>  <section id="needprogs"><title>Programs needed for development</title>
230  <para>  <para>
231  Before you start anything, you should make sure that you have properly  Before you start anything, you should make sure that you have properly
232  installed some additional packages needed for development.  Note that the list  installed some additional packages needed for development.  Note that the list
# Line 442  Manual</ulink> includes explanations of Line 442  Manual</ulink> includes explanations of
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 585  documentation</emphasis> for details). Line 585  documentation</emphasis> for details).
585  Let's start by creating a package of your own (or, even better,  Let's start by creating a package of your own (or, even better,
586  adopting an existing one).  adopting an existing one).
587  </para>  </para>
588  <section id="workflow"><title>Workflow of the Debian package building</title>  <section id="workflow"><title>Debian package building workflow</title>
589  <para>  <para>
590  If you are making a Debian package with an upstream program,  If you are making a Debian package with an upstream program, the
591  typical workflow of the Debian package building involves generating several  typical workflow of Debian package building involves generating several
592  specifically named files for each step as the following.  specifically named files for each step as follows.
593  </para>  </para>
594  <itemizedlist>  <itemizedlist>
595  <listitem>  <listitem>
596  <para>We obtain an upstream program file usually in a compressed tar format.</para>  <para>Get a copy of the upstream software, usually in a compressed tar format.</para>
597    <itemizedlist>    <itemizedlist>
598    <listitem><literal><replaceable>package</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 <literal>3.0 (quilt)</literal> format, which refers to the set of input files for  Add Debian-specific packaging modifications to the upstream program under the
604  the Debian package building, by adding Debian package modifications to the upstream program under the <filename>debian</filename> directory.  <filename>debian</filename> directory, and create a non-native source package
605    (that is, the set of input files used for Debian package building) in
606    <literal>3.0 (quilt)</literal> format.
607  </para>  </para>
608    <itemizedlist>    <itemizedlist>
609    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem>
610    <listitem><literal><replaceable>package</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>
611      <footnote><para>For the older non-native Debian source package in the <literal>1.0</literal> format,      <footnote><para>For the older style of non-native Debian source packages in <literal>1.0</literal> format,
612      <literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal>      <literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal>
613      is used instead. </para></footnote></listitem>      is used instead. </para></footnote></listitem>
614    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem>
# Line 614  the Debian package building, by adding D Line 616  the Debian package building, by adding D
616  </listitem>  </listitem>
617  <listitem>  <listitem>
618  <para>  <para>
619  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.  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.
620  </para>  </para>
621    <itemizedlist>    <itemizedlist>
622    <listitem><literal><replaceable>package</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>
# Line 625  We build Debian binary packages, which a Line 627  We build Debian binary packages, which a
627  Please note that the character separating  Please note that the character separating
628  <literal><replaceable>package</replaceable></literal> and  <literal><replaceable>package</replaceable></literal> and
629  <literal><replaceable>version</replaceable></literal> was changed from  <literal><replaceable>version</replaceable></literal> was changed from
630  <literal>-</literal> (hyphen) to <literal>_</literal> (underscore).  <literal>-</literal> (hyphen) in the tarball name to
631    <literal>_</literal> (underscore) in the Debian package filenames.
632  </para>  </para>
633  <para>  <para>
634  Here,  In the file names above, replace
635  <literal><replaceable>package</replaceable></literal> part of the file name is substituted by the  the <literal><replaceable>package</replaceable></literal> part with the <emphasis role="strong">package name</emphasis>,
636  <emphasis role="strong">package name</emphasis>,  the <literal><replaceable>version</replaceable></literal> part with the <emphasis role="strong">upstream version</emphasis>,
637  <literal><replaceable>version</replaceable></literal> part of it is substituted by the  the <literal><replaceable>revision</replaceable></literal> part with the <emphasis role="strong">Debian revision</emphasis>,
638  <emphasis role="strong">upstream version</emphasis>,  and the <literal><replaceable>arch</replaceable></literal> part with the <emphasis role="strong">package architecture</emphasis>,
639  <literal><replaceable>revision</replaceable></literal> part of it is substituted by the  as defined in the Debian Policy Manual.
640  <emphasis role="strong">Debian revision</emphasis>,  <footnote> <para> See
 <literal><replaceable>arch</replaceable></literal> part of it is substituted by the  
 <emphasis role="strong">package architecture</emphasis>.  
 <footnote><para>  
 The <emphasis role="strong">package name</emphasis>, <emphasis  
 role="strong">upstream version</emphasis>, and <emphasis role="strong">Debian  
 revision</emphasis> must be adjusted to comply with the Debian Policy Manual:  
641  <ulink url="&policy-source;">5.6.1 Source</ulink>,  <ulink url="&policy-source;">5.6.1 Source</ulink>,
642  <ulink url="&policy-package;">5.6.7 Package</ulink>, and  <ulink url="&policy-package;">5.6.7 Package</ulink>, and
643  <ulink url="&policy-version;">5.6.12 Version</ulink>.  <ulink url="&policy-version;">5.6.12 Version</ulink>.
# Line 649  Debian Policy Manual: <ulink url="&polic Line 646  Debian Policy Manual: <ulink url="&polic
646  and is automatically assigned by the package build process.</para></footnote>  and is automatically assigned by the package build process.</para></footnote>
647  </para>  </para>
648  <para>  <para>
649  If you are making a Debian specific package without an upstream program instead,  If instead you are making a Debian-specific package with no upstream, the
650  typical workflow of the Debian package building is simpler.  typical workflow of Debian package building is simpler.
651  </para>  </para>
652  <itemizedlist>  <itemizedlist>
653  <listitem>  <listitem>
654  <para>  <para>
655  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.  Create a native Debian source package in the <literal>3.0 (native)</literal>
656    format using a single compressed tar file in which all files are included.
657  </para>  </para>
658    <itemizedlist>    <itemizedlist>
659    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem>
# Line 664  We create a native Debian source package Line 662  We create a native Debian source package
662  </listitem>  </listitem>
663  <listitem>  <listitem>
664  <para>  <para>
665  We build Debian binary packages from the native Debian source package.  Build Debian binary packages from the native Debian source package.
666  </para>  </para>
667    <itemizedlist>    <itemizedlist>
668    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>    <listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>
# Line 672  We build Debian binary packages from the Line 670  We build Debian binary packages from the
670  </listitem>  </listitem>
671  </itemizedlist>  </itemizedlist>
672  <para>  <para>
673  In the following, each step of this is explained with detailed examples.  Each step of this outline is explained with detailed examples in later sections.
674  </para>  </para>
675  </section>  </section>
676  <section id="choose"><title>Choose your program</title>  <section id="choose"><title>Choose your program</title>
# Line 809  For the <literal>non-free</literal> sect Line 807  For the <literal>non-free</literal> sect
807  with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.  with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.
808  </para>  </para>
809  </listitem>  </listitem>
810  </itemizedlist>  <listitem>
811  <para>  <para>
812  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
813    <ulink url="&debian-legal-ldo;">debian-legal@lists.debian.org</ulink>
814  and ask for advice.  and ask for advice.
815  </para>  </para>
816  </listitem>  </listitem>
817    </itemizedlist>
818    </listitem>
819  <listitem>  <listitem>
820  <para>  <para>
821  The program certainly should <emphasis role="strong">not</emphasis> run setuid  The program should <emphasis role="strong">not</emphasis> introduce security
822  root, or even better, it shouldn't need to be setuid or setgid to anything.  and maintenance concerns to the Debian system.
823  </para>  </para>
824  </listitem>  <itemizedlist>
825  <listitem>  <listitem>
826  <para>  <para>
827  The program should not be a daemon, or go in an  The program should be well documented and its code needs to be understandable
828  <filename>*/sbin</filename> directory, or open a port as root.  (i.e.  not obfuscated).
829  </para>  </para>
830  </listitem>  </listitem>
831  <listitem>  <listitem>
832  <para>  <para>
833  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
834    and are amicable to Debian.  It is important to be able to consult with the author(s)
835    in case of any problems with the program, so don't try to package
836    unmaintained software.
837  </para>  </para>
838  </listitem>  </listitem>
839  <listitem>  <listitem>
840  <para>  <para>
841  The program should be well documented and its code needs to be understandable  The program certainly should <emphasis role="strong">not</emphasis> run setuid
842  (i.e.  not obfuscated).  root, or even better, it shouldn't need to be setuid or setgid to anything.
843  </para>  </para>
844  </listitem>  </listitem>
845  <listitem>  <listitem>
846  <para>  <para>
847  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
848  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.  
849  </para>  </para>
850  </listitem>  </listitem>
851  </itemizedlist>  </itemizedlist>
852    </listitem>
853    </itemizedlist>
854  <para>  <para>
855  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
856  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
857  more experience in packaging, you'll be able to package such software.  more experience in packaging, you'll be able to package such software.
858  </para>  </para>
859    <para>
860    As a new maintainer, you are encouraged to get some experience in packaging
861    with easier packages and discouraged from creating complicated packages.
862    </para>
863    <itemizedlist>
864    <listitem><para>Simple packages</para>
865    <itemizedlist>
866      <listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem>
867      <listitem><para>single binary package, arch = all (executables written in an interpreted language such as POSIX shell)</para></listitem>
868    </itemizedlist>
869    </listitem>
870    <listitem><para>Intermediate complexity packages</para>
871    <itemizedlist>
872      <listitem><para>single binary package, arch = any (ELF binary executables compiled from languages such as C and C++)</para></listitem>
873      <listitem><para>multiple binary packages, arch = any + all (packages for ELF binary executables + documentation)</para></listitem>
874      <listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem>
875      <listitem><para>upstream source containing undistributable contents</para></listitem>
876    </itemizedlist>
877    </listitem>
878    <listitem><para>High complexity packages</para>
879    <itemizedlist>
880      <listitem><para>interpreter module package used by other packages</para></listitem>
881      <listitem><para>generic ELF library package used by other packages</para></listitem>
882      <listitem><para>multiple binary packages including an ELF library package</para></listitem>
883      <listitem><para>source package with multiple upstream sources</para></listitem>
884      <listitem><para>kernel module packages</para></listitem>
885      <listitem><para>kernel patch packages</para></listitem>
886      <listitem><para>any package with non-trivial maintainer scripts</para></listitem>
887    </itemizedlist>
888    </listitem>
889    </itemizedlist>
890    <para>
891    Packaging high complexity packages is not too hard, but it requires a bit more
892    knowledge. You should seek specific guidance for every complex feature. For
893    example, some languages have their own sub-policy documents:
894    </para>
895    <itemizedlist>
896    <listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem>
897    <listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem>
898    <listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem>
899    </itemizedlist>
900    <para>
901    There is another old Latin saying: <emphasis>fabricando fit faber</emphasis>
902    (practice makes perfect).  It is <emphasis>highly</emphasis> recommended to
903    practice and experiment with all the steps of Debian packaging with simple packages
904    while reading this tutorial.  A trivial upstream tarball
905    <filename>hello-sh-1.0.tar.gz</filename> created as followings may offer
906    a good starting point.<footnote><para>Do not worry about the missing
907    <filename>Makefile</filename>.  You can install the <command>hello</command>
908    command by simply using <command>debhelper</command> as in
909    <xref linkend="install"/>, or by modifying the upstream source to add a new
910    <filename>Makefile</filename> with the <literal>install</literal> target as in
911    <xref linkend="modify"/>.</para></footnote>
912    </para>
913    <screen>
914    $ mkdir -p hello-sh/hello-sh-1.0; cd hello-sh/hello-sh-1.0
915    $ cat &gt; hello &lt;&lt;EOF
916    #!/bin/sh
917    # (C) 2011 Foo Bar, GPL2+
918    echo "Hello!"
919    EOF
920    $ chmod 755 hello
921    $ cd ..
922    $ tar -cvzf hello-sh-1.0.tar.gz hello-sh-1.0
923    </screen>
924  </section>  </section>
925  <section id="getit"><title>Get the program, and try it out</title>  <section id="getit"><title>Get the program, and try it out</title>
926  <para>  <para>
# Line 883  enough.  </para> </footnote>), you shoul Line 952  enough.  </para> </footnote>), you shoul
952  appropriate tools and repack it.  appropriate tools and repack it.
953  </para>  </para>
954  <para>  <para>
955    If your program's source comes with some contents which do not comply with
956    DFSG, you should also unpack it to remove such contents and repack it with a
957    modified upstream version containing <literal>dfsg</literal>.
958    </para>
959    <para>
960  As an example, I'll use a program called <command>gentoo</command>, a GTK+  As an example, I'll use a program called <command>gentoo</command>, a GTK+
961  file manager.  file manager.
962  <footnote><para> This program is already packaged. The  <footnote><para> This program is already packaged. The
# Line 927  or simply with freshly unpacked sources. Line 1001  or simply with freshly unpacked sources.
1001  </section>  </section>
1002  <section id="simplemake"><title>Simple build systems</title>  <section id="simplemake"><title>Simple build systems</title>
1003  <para>  <para>
1004  Simple programs come with a <filename>Makefile</filename> and can  Simple programs usually come with a <filename>Makefile</filename> and can
1005  be compiled just by invoking <literal>make</literal>.<footnote><para>  be compiled just by invoking <literal>make</literal>.<footnote><para>
1006  Many modern programs come with a script <filename>configure</filename> which  Many modern programs come with a script <filename>configure</filename> which
1007  when executed creates a <filename>Makefile</filename> customized for  when executed creates a <filename>Makefile</filename> customized for
# Line 993  files requires some knowledge of <comman Line 1067  files requires some knowledge of <comman
1067  <para>  <para>
1068  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
1069  distributed source and runs <literal>./configure &amp;&amp; make</literal> in  distributed source and runs <literal>./configure &amp;&amp; make</literal> in
1070  the source directory to compile the program into a  the source directory to compile the program into an executable command
1071  <command><replaceable>binary</replaceable></command> executable.  <command><replaceable>binary</replaceable></command>.
1072  </para>  </para>
1073  <screen>  <screen>
1074  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>
# Line 1026  build system.  You can recognize such so Line 1100  build system.  You can recognize such so
1100  <section id="namever"><title>Package name and version</title>  <section id="namever"><title>Package name and version</title>
1101  <para>  <para>
1102  If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can  If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can
1103  consider  take <literal>gentoo</literal> as the (source) <emphasis role="strong">package name</emphasis>
1104  <emphasis role="strong">package name</emphasis> to be <literal>gentoo</literal> and  and <literal>0.9.12</literal> as the <emphasis role="strong">upstream version</emphasis>.
 <emphasis role="strong">upstream version</emphasis> to be <literal>0.9.12</literal>.  
1105  These are used in the <filename>debian/changelog</filename> file described later in  These are used in the <filename>debian/changelog</filename> file described later in
1106  <xref linkend="changelog"/>, too.  <xref linkend="changelog"/>, too.
1107  </para>  </para>
# Line 1036  These are used in the <filename>debian/c Line 1109  These are used in the <filename>debian/c
1109  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
1110  <emphasis role="strong">package name</emphasis> and  <emphasis role="strong">package name</emphasis> and
1111  <emphasis role="strong">upstream version</emphasis> by renaming the upstream  <emphasis role="strong">upstream version</emphasis> by renaming the upstream
1112  source to follow the Debian Policy and the existing convention.  source to follow Debian Policy and existing convention.
1113  </para>  </para>
1114  <para>  <para>
1115  You must choose the <emphasis role="strong">package name</emphasis>  You must choose the <emphasis role="strong">package name</emphasis>
# Line 1045  to consist only of lower case letters (< Line 1118  to consist only of lower case letters (<
1118  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be
1119  at least two characters long, must start with an alphanumeric character, and  at least two characters long, must start with an alphanumeric character, and
1120  must not be the same as existing ones.  must not be the same as existing ones.
1121  It is good idea to keep its length within 30 characters and should not exceed  It is a good idea to keep its length within 30 characters.
1122  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>
1123  </para>  </para>
1124  <!--  <!--
1125  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
# Line 1061  Previous 20 chars is becoming too short Line 1134  Previous 20 chars is becoming too short
1134  Default aptitude setting display up to 30 chars (98.3%).  Default aptitude setting display up to 30 chars (98.3%).
1135  -->  -->
1136  <para>  <para>
1137  If upstream source uses generic words such as <literal>test-suite</literal> as  If upstream uses some generic term such as <literal>test-suite</literal> for
1138  its name, it is good idea to rename it not to contaminate name space for the  its name, it is a good idea to rename it to identify its contents explicitly and avoid namespace pollution.
 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;">Debian 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>
# Line 1076  tildes (<literal>~</literal>), and perio Line 1148  tildes (<literal>~</literal>), and perio
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 1100  aptitude display 10 = 8char for up + 1ch Line 1173  aptitude display 10 = 8char for up + 1ch
1173  90chars as max for file name of binary debs (package+up+deb+arch+.deb)  90chars as max for file name of binary debs (package+up+deb+arch+.deb)
1174  -->  -->
1175  <para>  <para>
1176  If the upstream software does not use normal version system like  If upstream does not use a normal versioning scheme such as
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 hash value as a part  <literal>09Oct23</literal>, a random codename string, or a VCS hash value as part
1179  of version, make sure to remove them from the  of the 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
1182  invent a version string, use the <literal>YYYYMMDD</literal> format such as  invent a version string, use the <literal>YYYYMMDD</literal> format such as
1183  <literal>20110429</literal> as upstream version.  This ensures that  <literal>20110429</literal> as upstream version.  This ensures that
1184  <command>dpkg</command> properly sees later versions as upgrades.  <command>dpkg</command> interprets later versions correctly 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 using <citerefentry>
1198    <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as follows.
1199  </para>  </para>
1200  <screen>  <screen>
1201   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>
1202  </screen>  </screen>
1203  <para>  <para>
1204  The version comparison rule can be summarized as the following.  The version comparison rule can be summarized as:
1205  </para>  </para>
1206  <itemizedlist>  <itemizedlist>
1207  <listitem><para>The strings are compared from the head to the tail.</para></listitem>  <listitem><para>Strings are compared from the head to the tail.</para></listitem>
1208  <listitem><para>Alphabets are larger than numbers.</para></listitem>  <listitem><para>Letters are larger than digits.</para></listitem>
1209  <listitem><para>Numbers are compared as the integer.</para></listitem>  <listitem><para>Numbers are compared as integers.</para></listitem>
1210  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>  <listitem><para>Letters are compared in ASCII code order.</para></listitem>
1211  <listitem><para>There are some special rules for periods (<literal>.</literal>), plus (<literal>+</literal>) and tildes (<literal>~</literal>) as the followings.</para>  <listitem><para>There are special rules for period
1212    (<literal>.</literal>), plus (<literal>+</literal>), and tilde
1213    (<literal>~</literal>) characters, as follows.</para>
1214    <para>    <para>
1215    <literal>0.0</literal> &lt;    <literal>0.0</literal> &lt;
1216    <literal>0.5</literal> &lt;    <literal>0.5</literal> &lt;
# Line 1141  The version comparison rule can be summa Line 1227  The version comparison rule can be summa
1227  </listitem>  </listitem>
1228  </itemizedlist>  </itemizedlist>
1229  <para>  <para>
1230  One of the tricky case happens when the upstream releases  One tricky case occurs when upstream releases
1231  <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the  <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the
1232  pre-release of <filename>gentoo-0.9.12.tar.gz</filename>.  You need to make  pre-release of <filename>gentoo-0.9.12.tar.gz</filename>.  You need to make
1233  sure that the upgrade works properly by renaming the upstream source to  sure that the upgrade works properly by renaming the upstream source to
# Line 1252  testing them (<xref linkend="checkit"/>) Line 1338  testing them (<xref linkend="checkit"/>)
1338  All the steps will be explained.  All the steps will be explained.
1339  </para>  </para>
1340  <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>  
1341  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
1342  recover them by running <command>dh_make</command> with the  recover them by running <command>dh_make</command> with the
1343  <literal>--addmissing</literal> option again in a Debian package source tree.  <literal>--addmissing</literal> option again in a Debian package source tree.
# Line 1305  package; further explanations are given Line 1350  package; further explanations are given
1350  <para>  <para>
1351  Please note that the source file does not need to contain any build system  Please note that the source file does not need to contain any build system
1352  discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It  discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It
1353  could be just a collection of graphics data etc.  Installation of files may be  could be just a collection of graphical data etc.  Installation of files may be
1354  enabled by <systemitem role="package">debhelper</systemitem> configuration  carried out using only <systemitem role="package">debhelper</systemitem> configuration
1355  files such as <filename>debian/install</filename> (see  files such as <filename>debian/install</filename> (see
1356  <xref linkend="install"/>) only.  <xref linkend="install"/>).
1357  </para>  </para>
1358  </section>  </section>
1359  <section id="native-dh-make"><title>Initial native Debian package</title>  <section id="native-dh-make"><title>Initial native Debian package</title>
1360  <para>  <para>
1361  Debian native packages are simpler to manage if they contain source files you  If a package contains source files you are only maintaining for Debian,
1362  manage only for Debian, possibly only for local uses.  If you have source  possibly only for local use, it may be simpler to create it as a Debian
1363    native package. If you have source
1364  files in <filename>~/mypackage-1.0</filename>, you can create an initial native  files in <filename>~/mypackage-1.0</filename>, you can create an initial native
1365  Debian package for it by issuing the <command>dh_make</command> command as  Debian package for it by issuing the <command>dh_make</command> command as
1366  follows.  follows.
# Line 1472  installation.  The packaging script will Line 1518  installation.  The packaging script will
1518  <literal>$(DESTDIR)</literal> to the temporary directory.  <literal>$(DESTDIR)</literal> to the temporary directory.
1519  </para>  </para>
1520  <para>  <para>
1521  For packages of the single binary type, the temporary directory used  For a source package generating a single binary package, the temporary directory used
1522  by the <command>dh_auto_install</command> command will be set to  by the <command>dh_auto_install</command> command will be set to
1523  <filename>debian/<replaceable>package</replaceable></filename>.  <filename>debian/<replaceable>package</replaceable></filename>.
1524  <footnote><para> For packages of the multiple binary type, the  <footnote><para> For a source package generating multiple binary packages, the
1525  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>
1526  as the temporary directory while the <command>dh_install</command> command with  as the temporary directory while the <command>dh_install</command> command with
1527  the help of  the help of
# Line 1514  from the <command>dh_auto_configure</com Line 1560  from the <command>dh_auto_configure</com
1560  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:
1561  </para>  </para>
1562  <screen>  <screen>
1563  # Where to put binary executables on 'make install'?  # Where to put executable commands on 'make install'?
1564  BIN     = /usr/local/bin  BIN     = /usr/local/bin
1565  # Where to put icons on 'make install'?  # Where to put icons on 'make install'?
1566  ICONS   = /usr/local/share/gentoo  ICONS   = /usr/local/share/gentoo
# Line 1525  As explained above, that directory hiera Line 1571  As explained above, that directory hiera
1571  Debian, so change those paths to:  Debian, so change those paths to:
1572  </para>  </para>
1573  <screen>  <screen>
1574  # Where to put binary executables on 'make install'?  # Where to put executable commands on 'make install'?
1575  BIN     = $(DESTDIR)/usr/bin  BIN     = $(DESTDIR)/usr/bin
1576  # Where to put icons on 'make install'?  # Where to put icons on 'make install'?
1577  ICONS   = $(DESTDIR)/usr/share/gentoo  ICONS   = $(DESTDIR)/usr/share/gentoo
# Line 1537  documentation, etc. are specified in the Line 1583  documentation, etc. are specified in the
1583  your package.  your package.
1584  </para>  </para>
1585  <para>  <para>
1586  So, we should install binary executables in <filename>/usr/bin</filename> instead of  So, we should install executable commands in <filename>/usr/bin</filename> instead of
1587  <filename>/usr/local/bin</filename>, the manual page in  <filename>/usr/local/bin</filename>, the manual page in
1588  <filename>/usr/share/man/man1</filename> instead of  <filename>/usr/share/man/man1</filename> instead of
1589  <filename>/usr/local/man/man1</filename>, and so on.  Notice how there's no manual  <filename>/usr/local/man/man1</filename>, and so on.  Notice how there's no manual
# Line 1583  at the top of the <filename>Makefile</fi Line 1629  at the top of the <filename>Makefile</fi
1629  </para>  </para>
1630  <para>  <para>
1631  Originally, <systemitem role="package">gentoo</systemitem>'s  Originally, <systemitem role="package">gentoo</systemitem>'s
1632  install target said:  <literal>install</literal> target said:
1633  </para>  </para>
1634  <screen>  <screen>
1635  install: gentoo-target  install: gentoo-target
# Line 1702  $ dquilt header -e Line 1748  $ dquilt header -e
1748  </chapter>  </chapter>
1749  <chapter id="dreq"><title>Required files under the <filename>debian</filename> directory</title>  <chapter id="dreq"><title>Required files under the <filename>debian</filename> directory</title>
1750  <para>  <para>
1751  There is a new subdirectory under the program's source directory, it's called  There is a new subdirectory under the program's source directory, called
1752  <filename>debian</filename>.  There are a number of files in this directory  <filename>debian</filename>.  There are a number of files in this directory
1753  that we should edit in order to customize the behavior of the package.  The  that we should edit in order to customize the behavior of the package.  The
1754  most important of them are <filename>control</filename>,  most important of them are <filename>control</filename>,
1755  <filename>changelog</filename>, <filename>copyright</filename> and  <filename>changelog</filename>, <filename>copyright</filename>, and
1756  <filename>rules</filename>, which are required for all packages.  <filename>rules</filename>, which are required for all packages.
1757  <footnote><para>  <footnote><para>
1758  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
1759  referred without preceding <filename>debian/</filename> for simplicity whenever  referred to without the leading <filename>debian/</filename> for simplicity whenever
1760  they are obvious.  the meaning is obvious.
1761  </para></footnote>  </para></footnote>
1762  </para>  </para>
1763  <section id="control"><title><filename>control</filename> file</title>  <section id="control"><title><filename>control</filename></title>
1764  <para>  <para>
1765  This file contains various values which <command>dpkg</command>,  This file contains various values which <command>dpkg</command>,
1766  <command>dselect</command>, <command>apt-get</command>,  <command>dselect</command>, <command>apt-get</command>,
1767  <command>apt-cache</command>, <command>aptitude</command>, and other package  <command>apt-cache</command>, <command>aptitude</command>, and other package
1768  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
1769  Policy Manual, 5 'Control files and their fields'</ulink>.  <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.
1770  </para>  </para>
1771  <para>  <para>
1772  Here is the <filename>control</filename> file <command>dh_make</command>  Here is the <filename>control</filename> file <command>dh_make</command>
# Line 1755  Line 1 is the name of the source package Line 1801  Line 1 is the name of the source package
1801  Line 2 is the section of the distribution the source package goes into.  Line 2 is the section of the distribution the source package goes into.
1802  </para>  </para>
1803  <para>  <para>
1804  As you may have noticed, Debian archive is divided in sections:  As you may have noticed, the Debian archive is divided into multiple areas:
1805  <literal>main</literal> (the free software), <literal>non-free</literal> (the  <literal>main</literal> (the free software), <literal>non-free</literal> (the
1806  not really free software) and <literal>contrib</literal> (free software that  not really free software) and <literal>contrib</literal> (free software that
1807  depends on non-free software).  Under those, there are logical subsections that  depends on non-free software).  Each of these is divided into sections that
1808  describe in short what packages are in.  So we have <literal>admin</literal>  classify packages into rough categories.  So we have <literal>admin</literal>
1809  for administrator-only programs, <literal>base</literal> for the basic tools,  for administrator-only programs,
1810  <literal>devel</literal> for programmer tools, <literal>doc</literal> for  <literal>devel</literal> for programmer tools, <literal>doc</literal> for
1811  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>
1812  for e-mail readers and daemons, <literal>net</literal> for network apps and  for email readers and daemons, <literal>net</literal> for network apps and
1813  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,
1814  and many more.  and many more.
1815  <footnote> <para>See  <footnote> <para>See
1816  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 'Sections'</ulink> and  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 "Sections"</ulink> and
1817  <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>
1818  </footnote>  </footnote>
1819  </para>  </para>
# Line 1778  we can omit it.) Line 1824  we can omit it.)
1824  <para>  <para>
1825  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.
1826  <footnote> <para>See  <footnote> <para>See
1827  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 'Priorities'</ulink>.  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 "Priorities"</ulink>.
1828  </para>  </para>
1829  </footnote>  </footnote>
1830  </para>  </para>
# Line 1786  Line 3 describes how important it is tha Line 1832  Line 3 describes how important it is tha
1832  <listitem>  <listitem>
1833  <para>  <para>
1834  The <literal>optional</literal> priority will usually work for new packages  The <literal>optional</literal> priority will usually work for new packages
1835  that do not conflict with others with <literal>required</literal>,  that do not conflict with others claiming <literal>required</literal>,
1836  <literal>important</literal> or <literal>standard</literal> priorities.  <literal>important</literal>, or <literal>standard</literal> priority.
1837  </para>  </para>
1838  </listitem>  </listitem>
1839  <listitem>  <listitem>
# Line 1798  conflict with others with non-<literal>e Line 1844  conflict with others with non-<literal>e
1844  </listitem>  </listitem>
1845  </itemizedlist>  </itemizedlist>
1846  <para>  <para>
1847  Section and priority are used by the frontends like <command>aptitude</command>  Section and priority are used by front-ends like <command>aptitude</command>
1848  when they sort packages and select defaults.  Once you upload the package to  when they sort packages and select defaults.  Once you upload the package to
1849  Debian, the value of these two fields can be overridden by the archive  Debian, the value of these two fields can be overridden by the archive
1850  maintainers, in which case you will be notified by email.  maintainers, in which case you will be notified by email.
# Line 1809  we will change the priority to <literal> Line 1855  we will change the priority to <literal>
1855  </para>  </para>
1856  <para>  <para>
1857  Line 4 is the name and email address of the maintainer.  Make sure that this  Line 4 is the name and email address of the maintainer.  Make sure that this
1858  field includes a valid <literal>To</literal> header for an email, because after  field includes a valid <literal>To</literal> header for email, because after
1859  you upload it, the bug tracking system will use it to deliver bug emails to  you upload it, the bug tracking system will use it to deliver bug emails to
1860  you.  Avoid using commas, ampersands and parenthesis.  you.  Avoid using commas, ampersands, or parentheses.
1861  </para>  </para>
1862  <para>  <para>
1863  The 5th line includes the list of packages required to build your package as  Line 5 includes the list of packages required to build your package as
1864  the <literal>Build-Depends</literal> field.  You can also have the  the <literal>Build-Depends</literal> field.  You can also have the
1865  <literal>Build-Depends-Indep</literal> field as an additional line, here.  <literal>Build-Depends-Indep</literal> field as an additional line, here.
1866  <footnote><para>See <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian  <footnote><para>See
1867  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>
1868  Build-Depends, Build-Depends-Indep, Build-Conflicts,  Some packages like
 Build-Conflicts-Indep'</ulink>.</para></footnote>  Some packages like  
1869  <systemitem role="package">gcc</systemitem> and  <systemitem role="package">gcc</systemitem> and
1870  <systemitem role="package">make</systemitem> which are required by the  <systemitem role="package">make</systemitem> which are required by the
1871  <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 1839  satisfy the Debian Policy requirement fo Line 1884  satisfy the Debian Policy requirement fo
1884  </listitem>  </listitem>
1885  <listitem>  <listitem>
1886  <para>  <para>
1887  For source packages which have some binary packages with <literal>Architecture:  Source packages which have binary packages with <literal>Architecture:
1888  any</literal>, they are rebuild by the autobuilder.  Since this autobuilder  any</literal> are rebuilt by the autobuilder.  Since this autobuilder
1889  procedure runs <literal>debian/rules build</literal> in it while installing  procedure installs only the packages listed in the
1890  only packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="autobuilder"/>), the <literal>Build-Depends</literal> field needs to  <literal>Build-Depends</literal> field before running
1891  list practically all the required packages and the  <literal>debian/rules build</literal> (see <xref
1892  <literal>Build-Depends-indep</literal> is rarely used.  linkend="autobuilder"/>), the <literal>Build-Depends</literal> field
1893    needs to  list practically all the required packages and
1894    <literal>Build-Depends-Indep</literal> is rarely used.
1895  </para>  </para>
1896  </listitem>  </listitem>
1897  <listitem>  <listitem>
1898  <para>  <para>
1899  For source packages which have binary packages only with <literal>Architecture:  For source packages with binary packages all of which are <literal>Architecture:
1900  all</literal>, the <literal>Build-Depends-Indep</literal> field may list all  all</literal>, the <literal>Build-Depends-Indep</literal> field may list all
1901  the required packages unless they are already listed in the  the required packages unless they are already listed in the
1902  <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement  <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement
# Line 1862  If you are not sure which one should be Line 1909  If you are not sure which one should be
1909  <literal>Build-Depends</literal> field to be on the safe side.  <literal>Build-Depends</literal> field to be on the safe side.
1910  <footnote><para> This somewhat strange situation is a feature well documented  <footnote><para> This somewhat strange situation is a feature well documented
1911  in the <ulink url="&policy-build-depends-indep;">Debian Policy  in the <ulink url="&policy-build-depends-indep;">Debian Policy
1912  Manual, Footnotes 48</ulink>.  This is not due to the use of the  Manual, Footnotes 55</ulink>.  This is not due to the use of the
1913  <command>dh</command> command in the <filename>debian/rules</filename> file but  <command>dh</command> command in the <filename>debian/rules</filename> file but
1914  due to how the <command>dpkg-buildpackage</command> works.  The same situation  due to how the <command>dpkg-buildpackage</command> works.  The same situation
1915  applies to the <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">auto build system  applies to the <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">auto build system
# Line 1875  To find out what packages your package n Line 1922  To find out what packages your package n
1922  $ dpkg-depcheck -d ./configure  $ dpkg-depcheck -d ./configure
1923  </screen>  </screen>
1924  <para>  <para>
1925  To manually find exact build dependency for  To manually find exact build dependencies for
1926  <command><replaceable>/usr/bin/foo</replaceable></command>, you execute  <command><replaceable>/usr/bin/foo</replaceable></command>, execute
1927  </para>  </para>
1928  <screen>  <screen>
1929  $ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED  $ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED
# Line 1888  and for each library listed, e.g., <comm Line 1935  and for each library listed, e.g., <comm
1935  $ dpkg -S libfoo.so.6  $ dpkg -S libfoo.so.6
1936  </screen>  </screen>
1937  <para>  <para>
1938  Then you just take <literal>-dev</literal> version of every package as  Then just take the <literal>-dev</literal> version of every package as a
1939  <literal>Build-Depends</literal> entry.  If you use <command>ldd</command> for  <literal>Build-Depends</literal> entry.  If you use <command>ldd</command> for
1940  this purpose, it will report indirect lib dependencies as well, resulting in  this purpose, it will report indirect lib dependencies as well, resulting in
1941  the problem of excessive build dependencies.  the problem of excessive build dependencies.
# Line 1904  Manual</ulink> standards this package fo Line 1951  Manual</ulink> standards this package fo
1951  your package.  your package.
1952  </para>  </para>
1953  <para>  <para>
1954  On line 7 you can put the URL of the homepage for the upstream program.  On line 7 you can put the URL of the software's upstream homepage.
1955  </para>  </para>
1956  <para>  <para>
1957  Line 9 is the name of the binary package.  This is usually the same as the name  Line 9 is the name of the binary package.  This is usually the same as the name
1958  of the source package, but it doesn't necessarily have to be that way.  of the source package, but it doesn't necessarily have to be that way.
1959  </para>  </para>
1960  <para>  <para>
1961  Line 10 describes the CPU architecture the binary package can be compiled for.  Line 10 describes the architectures the binary package can be compiled for.
1962  We'll leave this as <literal>any</literal> because <citerefentry>  This value is usually one of the following depending
1963  <refentrytitle>dpkg-gencontrol</refentrytitle> <manvolnum>1</manvolnum>  on the type of the binary package.
1964  </citerefentry> will fill in the appropriate value for any machine this package  <footnote><para>See
1965  gets compiled on.  <ulink url="&policy-architecture;">Debian Policy Manual 5.6.8 "Architecture"</ulink>
1966    for exact details.
1967    </para></footnote>
1968    </para>
1969    <itemizedlist>
1970    <listitem><para><literal>Architecture: any</literal></para>
1971      <itemizedlist>
1972      <listitem><para>The generated binary package is an architecture dependent one
1973        usually in a compiled language.</para></listitem>
1974      </itemizedlist>
1975    </listitem>
1976    <listitem><para><literal>Architecture: all</literal></para>
1977      <itemizedlist>
1978      <listitem><para>The generated binary package is an architecture independent
1979        one usually consisting of text, images, or scripts in an interpreted
1980        language.</para></listitem>
1981      </itemizedlist>
1982    </listitem>
1983    </itemizedlist>
1984    <para>
1985    We leave line 10 as is since this is written in C.
1986    <citerefentry><refentrytitle>dpkg-gencontrol</refentrytitle><manvolnum>1</manvolnum></citerefentry>
1987    will fill in the appropriate architecture value for any machine this source
1988    package gets compiled on.
1989  </para>  </para>
1990  <para>  <para>
1991  If your package is architecture independent (for example, a shell or Perl  If your package is architecture independent (for example, a shell or Perl
# Line 1934  Packages can relate to each other in var Line 2004  Packages can relate to each other in var
2004  </para>  </para>
2005  <para>  <para>
2006  The package management tools usually behave the same way when dealing with  The package management tools usually behave the same way when dealing with
2007  these relations; if not, it will be explained.  (see <citerefentry>  these relations; if not, it will be explained.  (See <citerefentry>
2008  <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>,  <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>,
2009  <citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum>  <citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum>
2010  </citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle>  </citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle>
2011  <manvolnum>8</manvolnum> </citerefentry>, <citerefentry>  <manvolnum>8</manvolnum> </citerefentry>, <citerefentry>
2012  <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum>
2013  </citerefentry> etc.)  </citerefentry>, etc.)
2014  </para>  </para>
2015  <para>  <para>
2016  Here is a simplified description of package relationships.  Here is a simplified description of package relationships.
2017  <footnote><para>See  <footnote><para>See
2018  <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>.
2019  </para></footnote>  </para></footnote>
2020  </para>  </para>
2021  <itemizedlist>  <itemizedlist>
# Line 1965  severe breakage) unless a particular pac Line 2035  severe breakage) unless a particular pac
2035  </para>  </para>
2036  <para>  <para>
2037  Use this for packages that are not strictly necessary but are typically used  Use this for packages that are not strictly necessary but are typically used
2038  with your program.  When a user installs your program, all frontends will  with your program.  When a user installs your program, all front-ends will
2039  likely prompt them to install the recommended packages.  probably prompt them to install the recommended packages.
2040  <command>aptitude</command> and <command>apt-get</command> install recommended  <command>aptitude</command> and <command>apt-get</command> install recommended
2041  packages along with your package (but the user can disable this default  packages along with your package by default (but the user can disable this
2042  behaviour).  <command>dpkg</command> will ignore this field.  behavior).  <command>dpkg</command> will ignore this field.
2043  </para>  </para>
2044  </listitem>  </listitem>
2045  <listitem>  <listitem>
# Line 1978  behaviour).  <command>dpkg</command> wil Line 2048  behaviour).  <command>dpkg</command> wil
2048  </para>  </para>
2049  <para>  <para>
2050  Use this for packages which will work nicely with your program but are not at  Use this for packages which will work nicely with your program but are not at
2051  all necessary.  When a user installs your program, all frontends will likely  all necessary.  When a user installs your program, they will probably not be
2052  prompt them to install the suggested packages.  <command>aptitude</command> can  prompted to install suggested packages.  <command>aptitude</command> can
2053  be configured to install suggested packages along with your package but this is  be configured to install suggested packages along with your package but this is
2054  not its default.  <command>dpkg</command> and <command>apt-get</command> will  not its default.  <command>dpkg</command> and <command>apt-get</command> will
2055  ignore this field.  ignore this field.
# Line 2012  severe problems if a particular package Line 2082  severe problems if a particular package
2082  <literal>Breaks</literal>  <literal>Breaks</literal>
2083  </para>  </para>
2084  <para>  <para>
2085  The package will be installed while all the listed packages will be broken.  When installed the package will break all the listed packages.
2086  Normally a <literal>Breaks</literal> entry has an earlier than version clause.  Normally a <literal>Breaks</literal> entry specifies that it applies to versions earlier than a certain value.
2087  The resolution is generally to upgrade the listed packages by the higher-level  The resolution is generally to use higher-level package management tools to upgrade the listed packages.
 package management tools.  
2088  </para>  </para>
2089  </listitem>  </listitem>
2090  <listitem>  <listitem>
# Line 2051  symbols). Line 2120  symbols).
2120  <para>  <para>
2121  The fields may restrict their applicability to particular versions of each  The fields may restrict their applicability to particular versions of each
2122  named package.  These versions are listed in parentheses after each individual  named package.  These versions are listed in parentheses after each individual
2123  package name, and they should contain a relation from the list below followed  package name, and should contain a relation from the list below followed
2124  by the version number.  The relations allowed are: <literal>&lt;&lt;</literal>,  by the version number.  The relations allowed are: <literal>&lt;&lt;</literal>,
2125  <literal>&lt;=</literal>, <literal>=</literal>, <literal>&gt;=</literal> and  <literal>&lt;=</literal>, <literal>=</literal>, <literal>&gt;=</literal>, and
2126  <literal>&gt;&gt;</literal> for strictly lower, lower or equal, exactly equal,  <literal>&gt;&gt;</literal> for strictly lower, lower or equal, exactly equal,
2127  greater or equal and strictly greater, respectively.  For example,  greater or equal, and strictly greater, respectively.  For example,
2128  </para>  </para>
2129  <screen>  <screen>
2130  Depends: foo (&gt;= 1.2), libbar1 (= 1.3.4)  Depends: foo (&gt;= 1.2), libbar1 (= 1.3.4)
# Line 2072  The last feature you need to know about Line 2141  The last feature you need to know about
2141  <para>  <para>
2142  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>
2143  <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies  <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies
2144  for binary packages.  It generates a list of ELF executables and shared  for binary packages.  It generates a list of <ulink url="&elf;">ELF</ulink> executables and shared
2145  libraries it has found for each binary package.  Such list is used for  libraries it has found for each binary package.  This list is used for
2146  substituting <literal>${shlibs:Depends}</literal>.  substituting <literal>${shlibs:Depends}</literal>.
2147  </para>  </para>
2148  <para>  <para>
2149  <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum>
2150  </citerefentry> calculates Perl dependencies.  It generates a list of a  </citerefentry> calculates Perl dependencies.  It generates a list of a
2151  dependency on <literal>perl</literal> or <literal>perlapi</literal> for each binary package.  Such list is used for  dependencies on <literal>perl</literal> or <literal>perlapi</literal> for each binary package.  This list is used for
2152  substituting <literal>${perl:Depends}</literal>.  substituting <literal>${perl:Depends}</literal>.
2153  </para>  </para>
2154  <para>  <para>
2155  Some <systemitem role="package">debhelper</systemitem> commands may make the  Some <systemitem role="package">debhelper</systemitem> commands may cause the
2156  generated package need to depend on some other packages.  All such commands  generated package to depend on some additional packages.  All such commands
2157  generate a list of required packages for each binary package.  generate a list of required packages for each binary package.
2158  Such list is used for substituting <literal>${misc:Depends}</literal>.  This list is used for substituting <literal>${misc:Depends}</literal>.
2159  </para>  </para>
2160  <para>  <para>
2161  <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>  <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>
# Line 2099  substituting <literal>${shlibs:Depends}< Line 2168  substituting <literal>${shlibs:Depends}<
2168  Having said all that, we can leave the <literal>Depends</literal> field exactly  Having said all that, we can leave the <literal>Depends</literal> field exactly
2169  as it is now, and insert another line after it saying <literal>Suggests:  as it is now, and insert another line after it saying <literal>Suggests:
2170  file</literal>, because <systemitem role="package">gentoo</systemitem> can use  file</literal>, because <systemitem role="package">gentoo</systemitem> can use
2171  some features provided by that <systemitem role="package">file</systemitem>  some features provided by the <systemitem role="package">file</systemitem>
2172  package.  package.
2173  </para>  </para>
2174  <para> Line 9 is the Homepage URL.  Let's assume this to be at  <para> Line 9 is the Homepage URL.  Let's assume this to be at
2175  <ulink url="&gentoo;"/>.  <ulink url="&gentoo;"/>.
2176  </para>  </para>
2177  <para>  <para>
2178  Line 12 is the short description.  Most people screens are 80 columns wide so  Line 12 is the short description.  Terminals are conventionally 80 columns wide so
2179  this shouldn't be longer than about 60 characters.  I'll change it to  this shouldn't be longer than about 60 characters.  I'll change it to
2180  <literal>fully GUI-configurable, two-pane X file manager</literal>.  <literal>fully GUI-configurable, two-pane X file manager</literal>.
2181  </para>  </para>
# Line 2120  English.  Translations of these descript Line 2189  English.  Translations of these descript
2189  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>
2190  </para>  </para>
2191  <para>  <para>
2192  Let's insert <literal>Vcs-*</literal> fields to document the Version Control  We can insert <literal>Vcs-*</literal> fields to document the Version Control
2193  System (VCS) location between line 6 and 7.  System (VCS) location between lines 6 and 7.
2194  <footnote><para>See  <footnote><para>See
2195  <ulink url="&devref-bpp-vcs;">Debian 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>.
2196  </para></footnote>  </para></footnote>
2197  Let's assume that the <systemitem role="package">gentoo</systemitem>  Let's assume that the <systemitem role="package">gentoo</systemitem>
2198  package has its VCS located in Debian Alioth Git Service at  package has its VCS located in the Debian Alioth Git Service at
2199  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.
2200  </para>  </para>
2201  <para>  <para>
# Line 2154  Finally, here is the updated <filename>c Line 2223  Finally, here is the updated <filename>c
2223  19  they're fairly easy to work with since they are written in an XML format.  19  they're fairly easy to work with since they are written in an XML format.
2224  20  .  20  .
2225  21  gentoo features a fairly complex and powerful file identification system,  21  gentoo features a fairly complex and powerful file identification system,
2226  22  coupled to a object-oriented style system, which together give you a lot  22  coupled to an object-oriented style system, which together give you a lot
2227  23  of control over how files of different types are displayed and acted upon.  23  of control over how files of different types are displayed and acted upon.
2228  24  Additionally, over a hundred pixmap images are available for use in file  24  Additionally, over a hundred pixmap images are available for use in file
2229  25  type descriptions.  25  type descriptions.
2230  26  .  26  .
2231  29  gentoo was written from scratch in ANSI C, and it utilises the GTK+ toolkit  29  gentoo was written from scratch in ANSI C, and it utilizes the GTK+ toolkit
2232  30  for its interface.  30  for its interface.
2233  </screen>  </screen>
2234  <para>  <para>
2235  (I've added the line numbers.)  (I've added the line numbers.)
2236  </para>  </para>
2237  </section>  </section>
2238  <section id="copyright"><title><filename>copyright</filename> file</title>  <section id="copyright"><title><filename>copyright</filename></title>
2239  <para>  <para>
2240  This file contains the information about package upstream resources, copyright  This file contains information about the copyright and license of the upstream sources.
2241  and license information.  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink>
2242  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 'Copyright information'</ulink>  dictates its content and
2243  dictates its content and  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>
 <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>  
2244  provides guidelines for its format.  provides guidelines for its format.
2245  </para>  </para>
2246  <para>  <para>
# Line 2181  provides guidelines for its format. Line 2249  provides guidelines for its format.
2249  gpl2</literal> option here to get a template file for the <systemitem role="package">gentoo</systemitem> package released under GPL-2.  gpl2</literal> option here to get a template file for the <systemitem role="package">gentoo</systemitem> package released under GPL-2.
2250  </para>  </para>
2251  <para>  <para>
2252  You must fill in missing information such as the place you got the package  You must fill in missing information to complete this file, such as the place you got the package
2253  from, the actual copyright notice and their license to complete this file.  For  from, the actual copyright notice, and the license.  For certain
2254  the common free software licenses such as GNU GPL-1, GNU GPL-2, GNU GPL-3,  common free software licenses (GNU GPL-1, GNU GPL-2, GNU GPL-3,
2255  LGPL-2, LGPL-2.1, LGPL-3, GNU FDL-1.2, GNU FDL-1.3, Apache-2.0 or the Artistic  LGPL-2, LGPL-2.1, LGPL-3, GNU FDL-1.2, GNU FDL-1.3, Apache-2.0, or the Artistic
2256  license, you can just refer to the appropriate file in  license), you can just refer to the appropriate file in the
2257  <filename>/usr/share/common-licenses/</filename> directory that exists on every  <filename>/usr/share/common-licenses/</filename> directory that exists on every
2258  Debian system.  Otherwise, you must include the complete license.  Debian system.  Otherwise, you must include the complete license.
2259  </para>  </para>
2260  <para>  <para>
2261  In short, here's how <systemitem role="package">gentoo</systemitem>'s  In short, here's what <systemitem role="package">gentoo</systemitem>'s
2262  <filename>copyright</filename> file should look like:  <filename>copyright</filename> file should look like:
2263  </para>  </para>
2264  <screen>  <screen>
# Line 2220  In short, here's how <systemitem role="p Line 2288  In short, here's how <systemitem role="p
2288  24  but WITHOUT ANY WARRANTY; without even the implied warranty of  24  but WITHOUT ANY WARRANTY; without even the implied warranty of
2289  25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2290  26  GNU General Public License for more details.  26  GNU General Public License for more details.
2291  27 .  27  .
2292  28  You should have received a copy of the GNU General Public License along  28  You should have received a copy of the GNU General Public License along
2293  29  with this program; if not, write to the Free Software Foundation, Inc.,  29  with this program; if not, write to the Free Software Foundation, Inc.,
2294  30  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  30  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Line 2233  In short, here's how <systemitem role="p Line 2301  In short, here's how <systemitem role="p
2301  (I've added the line numbers.)  (I've added the line numbers.)
2302  </para>  </para>
2303  <para>  <para>
2304  Please follow the HOWTO provided by ftpmasters and sent to  Please follow the HOWTO provided by the ftpmasters and sent to
2305  debian-devel-announce: <ulink url="&howto-copyright;"/>.  debian-devel-announce: <ulink url="&howto-copyright;"/>.
2306  </para>  </para>
2307  </section>  </section>
2308  <section id="changelog"><title><filename>changelog</filename> file</title>  <section id="changelog"><title><filename>changelog</filename></title>
2309  <para>  <para>
2310  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
2311  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 'debian/changelog'</ulink>.  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.
2312  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
2313  version number, revision, distribution and urgency of your package.  version number, revision, distribution, and urgency of your package.
2314  </para>  </para>
2315  <para>  <para>
2316  For you, it is also important, since it is good to have documented all changes  For you, it is also important, since it is good to have documented all changes
# Line 2252  saved as <filename>/usr/share/doc/gentoo Line 2320  saved as <filename>/usr/share/doc/gentoo
2320  binary package.  binary package.
2321  </para>  </para>
2322  <para>  <para>
2323  <command>dh_make</command> created a default one, and this is how it looks  <command>dh_make</command> created a default one, and this is what it looks
2324  like:  like:
2325  </para>  </para>
2326  <screen>  <screen>
# Line 2268  like: Line 2336  like:
2336  </para>  </para>
2337  <para>  <para>
2338  Line 1 is the package name, version, distribution, and urgency.  The name must  Line 1 is the package name, version, distribution, and urgency.  The name must
2339  match the source package name, distribution should be either  match the source package name; distribution should be
2340  <literal>unstable</literal> (or even <literal>experimental</literal>)  <literal>unstable</literal> (or even <literal>experimental</literal>)
2341  <footnote><para> Some people use invalid distribution values such as  <footnote><para> Some people use invalid distribution values such as
2342  <literal>UNRELEASED</literal> to prevent a package to be accidentally uploaded  <literal>UNRELEASED</literal> to prevent a package being accidentally uploaded
2343  when updating a package in a shared VCS.  </para> </footnote>, and urgency  when updating a package in a shared VCS.  </para> </footnote>, and urgency
2344  shouldn't be changed to anything higher than <literal>low</literal>.  :-)  shouldn't be changed to anything higher than <literal>low</literal>.  :-)
2345  </para>  </para>
2346  <para>  <para>
2347  Lines 3-5 are a log entry, where you document changes made in this package  Lines 3-5 are a log entry, where you document changes made in this package
2348  revision (not the upstream changes - there is special file for that purpose,  revision (not the upstream changes - there is a special file for that purpose,
2349  created by the upstream authors, which you will later install as  created by the upstream authors, which you will later install as
2350  <filename>/usr/share/doc/gentoo/changelog.gz</filename>).  Let's assume your  <filename>/usr/share/doc/gentoo/changelog.gz</filename>).  Let's assume your
2351  ITP (Intent To Package) bug report number was <literal>12345</literal>.  New  ITP (Intent To Package) bug report number was <literal>12345</literal>.  New
2352  lines must be inserted just before the uppermost line that begins with  lines must be inserted just below the uppermost line that begins with
2353  <literal>*</literal> (asterisk).  You can do it with <citerefentry>  <literal>*</literal> (asterisk).  You can do it with <citerefentry>
2354  <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or  <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or
2355  manually with a text editor.  manually with a text editor.
# Line 2307  You can read more about updating the <fi Line 2375  You can read more about updating the <fi
2375  in <xref linkend="update"/>.  in <xref linkend="update"/>.
2376  </para>  </para>
2377  </section>  </section>
2378  <section id="rules"><title><filename>rules</filename> file</title>  <section id="rules"><title><filename>rules</filename></title>
2379  <para>  <para>
2380  Now we need to take a look at the exact rules which <citerefentry>  Now we need to take a look at the exact rules which <citerefentry>
2381  <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum>
2382  </citerefentry> will use to actually create the package.  This file is actually  </citerefentry> will use to actually create the package.  This file is in fact
2383  another <filename>Makefile</filename>, but different from the one(s) in the  another <filename>Makefile</filename>, but different from the one(s) in the
2384  upstream source.  Unlike other files in <filename>debian</filename>, this one  upstream source.  Unlike other files in <filename>debian</filename>, this one
2385  is marked as executable.  is marked as executable.
2386  </para>  </para>
2387  <section id="targets"><title>Targets of <filename>rules</filename> file</title>  <section id="targets"><title>Targets of the <filename>rules</filename> file</title>
2388  <para>  <para>
2389  Every <filename>rules</filename> file, as any other  Every <filename>rules</filename> file, like any other
2390  <filename>Makefile</filename>, consists of several targets and their rules  <filename>Makefile</filename>, consists of several targets and their rules.
2391  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian  <footnote><para>You can start learning how to write <filename>Makefile</filename> from
2392  Policy Manual, 4.9 'Main building script: debian/rules'</ulink> explains its  <ulink url="&debref-make;">Debian Reference, 12.2 "Make"</ulink>.
2393  details.  The full documentation is available as
2394    <ulink url="&gnu-make;"></ulink> or as the
2395    <systemitem role="package">make-doc</systemitem> package in the non-free archive area.
2396    </para></footnote>
2397    A new rule begins with its target declaration in the first column.  The
2398    following lines beginning with the TAB code (ASCII 9) specify its rule.
2399    Empty lines and lines beginning with <literal>#</literal> (hash) are treated as
2400    comments and ignored.
2401    <footnote><para><ulink url="&policy-debianrules;">Debian
2402    Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains the
2403    details.</para></footnote>
2404    </para>
2405    <para>
2406    A rule that you want to execute is invoked by its target name as a command line argument.  For
2407    example, <literal>debian/rules <replaceable>build</replaceable></literal> and
2408    <literal>fakeroot make -f debian/rules <replaceable>binary</replaceable></literal>
2409    execute rules for <literal><replaceable>build</replaceable></literal> and
2410    <literal><replaceable>binary</replaceable></literal> targets respectively.
2411  </para>  </para>
2412  <para>  <para>
2413  The simplified explanation of targets are the following.  Here is a simplified explanation of the targets:
2414  </para>  </para>
2415  <itemizedlist>  <itemizedlist>
2416  <listitem>  <listitem>
2417  <para>  <para>
2418  <literal>clean</literal> target: to clean all compiled, generated, and useless  <literal>clean</literal> target: to clean all compiled, generated, and useless
2419  files in the build-tree.  (required)  files in the build-tree.  (Required)
2420  </para>  </para>
2421  </listitem>  </listitem>
2422  <listitem>  <listitem>
2423  <para>  <para>
2424  <literal>build</literal> target: to build the source into compiled programs and  <literal>build</literal> target: to build the source into compiled programs and
2425  formatted documents in the build-tree.  (required)  formatted documents in the build-tree.  (Required)
2426  </para>  </para>
2427  </listitem>  </listitem>
2428  <listitem>  <listitem>
# Line 2345  formatted documents in the build-tree. Line 2430  formatted documents in the build-tree.
2430  <literal>install</literal> target: to install files into a file tree for each  <literal>install</literal> target: to install files into a file tree for each
2431  binary package under the <filename>debian</filename> directory.  If defined,  binary package under the <filename>debian</filename> directory.  If defined,
2432  <literal>binary*</literal> targets effectively depend on this target.  <literal>binary*</literal> targets effectively depend on this target.
2433  (optional)  (Optional)
2434  </para>  </para>
2435  </listitem>  </listitem>
2436  <listitem>  <listitem>
2437  <para>  <para>
2438  <literal>binary</literal> target: to create all binary packages (effectively  <literal>binary</literal> target: to create all binary packages (effectively
2439  combination of <literal>binary-arch</literal> and  a combination of <literal>binary-arch</literal> and
2440  <literal>binary-indep</literal> targets).  (required)<footnote><para> This  <literal>binary-indep</literal> targets).  (Required)<footnote><para> This
2441  target is used by <literal>dpkg-buildpackage</literal> as in <xref linkend="completebuild"/>.  </para> </footnote>  target is used by <literal>dpkg-buildpackage</literal> as in <xref linkend="completebuild"/>.  </para> </footnote>
2442  </para>  </para>
2443  </listitem>  </listitem>
# Line 2360  target is used by <literal>dpkg-buildpac Line 2445  target is used by <literal>dpkg-buildpac
2445  <para>  <para>
2446  <literal>binary-arch</literal> target: to create arch-dependent  <literal>binary-arch</literal> target: to create arch-dependent
2447  (<literal>Architecture: any</literal>) binary packages in the parent directory.  (<literal>Architecture: any</literal>) binary packages in the parent directory.
2448  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage  (Required)<footnote><para> This target is used by <literal>dpkg-buildpackage
2449  -B</literal> as in <xref linkend="autobuilder"/>.  </para> </footnote>  -B</literal> as in <xref linkend="autobuilder"/>.  </para> </footnote>
2450  </para>  </para>
2451  </listitem>  </listitem>
# Line 2368  target is used by <literal>dpkg-buildpac Line 2453  target is used by <literal>dpkg-buildpac
2453  <para>  <para>
2454  <literal>binary-indep</literal> target: to create arch-independent  <literal>binary-indep</literal> target: to create arch-independent
2455  (<literal>Architecture: all</literal>) binary packages in the parent directory.  (<literal>Architecture: all</literal>) binary packages in the parent directory.
2456  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage  (Required)<footnote><para> This target is used by <literal>dpkg-buildpackage
2457  -A</literal>.  </para> </footnote>  -A</literal>.  </para> </footnote>
2458  </para>  </para>
2459  </listitem>  </listitem>
2460  <listitem>  <listitem>
2461  <para>  <para>
2462  <literal>get-orig-source</literal> target: to obtain the most recent version of  <literal>get-orig-source</literal> target: to obtain the most recent version of
2463  the original source package from upstream archive site.  (optional)  the original source package from an upstream archive.  (Optional)
2464  </para>  </para>
2465  </listitem>  </listitem>
2466  </itemizedlist>  </itemizedlist>
2467  <para>  <para>
2468  Rules that you want to execute are invoked as command line arguments (for  You are probably overwhelmed by now, but things are much simpler upon examination of the
 example, <literal>./debian/rules build</literal> or <literal>fakeroot make -f  
 debian/rules binary</literal>).  After the target name, you can name the  
 dependency, program or file that the rule depends on.  After that, there can be  
 any number of commands, indented with  
 <literal><replaceable>TAB</replaceable></literal>.  A new rule begins with the  
 target declaration in the first column.  Empty lines and lines beginning with  
 <literal>#</literal> (hash) are treated as comments and ignored.  
 </para>  
 <para>  
 You are probably confused now, but it will all be clear upon examination of the  
2469  <filename>rules</filename> file that <command>dh_make</command> gives us as a  <filename>rules</filename> file that <command>dh_make</command> gives us as a
2470  default.  You should also read <literal>info make</literal> for more  default.
 information.  
2471  </para>  </para>
2472  </section>  </section>
2473  <section id="defaultrules"><title>Default <filename>rules</filename> file</title>  <section id="defaultrules"><title>Default <filename>rules</filename> file</title>
# Line 2418  Newer <command>dh_make</command> generat Line 2492  Newer <command>dh_make</command> generat
2492  </screen>  </screen>
2493  <para>  <para>
2494  (I've added the line numbers.  In the actual <filename>rules</filename> file,  (I've added the line numbers.  In the actual <filename>rules</filename> file,
2495  the leading white spaces are TAB codes.)  the leading spaces are a TAB code.)
2496  </para>  </para>
2497  <para>  <para>
2498  You are probably familiar with lines like line 1 from shell and Perl scripts.  You are probably familiar with lines like line 1 from shell and Perl scripts.
# Line 2426  It tells the operating system that this Line 2500  It tells the operating system that this
2500  <filename>/usr/bin/make</filename>.  <filename>/usr/bin/make</filename>.
2501  </para>  </para>
2502  <para>  <para>
2503  Line 11 can be uncommented to set <literal>DH_VERBOSE</literal> variable to 1.  Line 10 can be uncommented to set the <literal>DH_VERBOSE</literal> variable to 1,
2504  Then, the <command>dh</command> command will output which  so that the <command>dh</command> command outputs which
2505  <command>dh_*</command> commands are executed by the <command>dh</command>  <command>dh_*</command> commands it is executing.
2506  command.  You can also add <literal>export DH_OPTIONS=-v</literal> line here.  You can also add a line <literal>export DH_OPTIONS=-v</literal> here,
2507  Then each <command>dh_*</command> command will output which commands are  so that each <command>dh_*</command> command outputs which commands it
2508  executed by each <command>dh_*</command> command.  This helps you to understand  is executing.  This helps you to understand
2509  what exactly is going on behind this simple <filename>rules</filename> file and  exactly what is going on behind this simple <filename>rules</filename> file and
2510  to debug its problems.  This new <command>dh</command> is a core part of the  to debug its problems.  This new <command>dh</command> is designed to form a core part of the
2511  <systemitem role="package">debhelper</systemitem> tools and does not hide  <systemitem role="package">debhelper</systemitem> tools, and not to hide
2512  anything from you.  anything from you.
2513  </para>  </para>
2514  <para>  <para>
2515  Lines 12 and 13 are where all the work is done.  The percent sign means any  Lines 12 and 13 are where all the work is done with an implicit rule using the pattern rule.  The percent sign means "any
2516  targets which then call a single program, <command>dh</command> with the target  targets", which then call a single program, <command>dh</command>, with the target
2517  name.  <footnote><para> This uses the new <systemitem role="package">debhelper</systemitem> V7 features.  Its design concepts are  name.  <footnote><para> This uses the new <systemitem role="package">debhelper</systemitem> v7 features.  Its design concepts are
2518  explained in <ulink url="&debhelper-slides;">Not Your  explained in <ulink url="&debhelper-slides;">Not Your
2519  Grandpa's Debhelper</ulink> presented at Debconf9 by the <systemitem role="package">debhelper</systemitem> upstream.  Under  Grandpa's Debhelper</ulink> presented at DebConf9 by the <systemitem role="package">debhelper</systemitem> upstream.  Under
2520  <literal>lenny</literal>, <command>dh_make</command> created a much more  <literal>lenny</literal>, <command>dh_make</command> created a much more
2521  complicated <filename>rules</filename> file with many <command>dh_*</command>  complicated <filename>rules</filename> file with explicit rules
2522  scripts listed for each required explicit targets and frozen them to the state  and many <command>dh_*</command> scripts listed for each one, most of
2523  when it was initially packaged.  This new <command>dh</command> command is  which are now unnecessary (and show the package's age). The new <command>dh</command> command is
2524  simpler and frees us from this constrain.  You still have full power to  simpler and frees us from doing the routine work "manually". You still have full power to
2525  customize this with <literal>override_dh_*</literal> targets.  See <xref linkend="customrules"/>.  It is based only on the <systemitem role="package">debhelper</systemitem> package and does not obfuscate the  customize the process with <literal>override_dh_*</literal> targets. See <xref linkend="customrules"/>.  It is based only on the <systemitem role="package">debhelper</systemitem> package and does not obfuscate the
2526  package building process like the <systemitem role="package">cdbs</systemitem>  package building process as the <systemitem role="package">cdbs</systemitem>
2527  package.  </para> </footnote> The <command>dh</command> command is a wrapper  package tends to.  </para> </footnote> The <command>dh</command> command is a wrapper
2528  script which runs appropriate sequences of <command>dh_*</command> programs  script which runs appropriate sequences of <command>dh_*</command> programs
2529  depending on its argument.  <footnote><para> You can verify actual sequences of  depending on its argument.  <footnote><para> You can verify the actual sequences of
2530  <command>dh_*</command> programs invoked for a given  <command>dh_*</command> programs invoked for a given
2531  <literal><replaceable>target</replaceable></literal> as <literal>dh --no-act  <literal><replaceable>target</replaceable></literal> without really running them by invoking <literal>dh --no-act
2532  <replaceable>target</replaceable></literal> or <literal>debian/rules --  <replaceable>target</replaceable></literal> or <literal>debian/rules --
2533  '--no-act <replaceable>target</replaceable>'</literal> without really running  '--no-act <replaceable>target</replaceable>'</literal>.  </para> </footnote>
 them.  </para> </footnote>  
2534  </para>  </para>
2535  <itemizedlist>  <itemizedlist>
2536  <listitem>  <listitem>
2537  <para>  <para>
2538  <literal>debian/rules clean</literal> runs <literal>dh clean</literal>; which  <literal>debian/rules clean</literal> runs <literal>dh clean</literal>, which
2539  in turn runs the following:  in turn runs the following:
2540  </para>  </para>
2541  <screen>  <screen>
# Line 2556  for each remaining command. Line 2629  for each remaining command.
2629  </listitem>  </listitem>
2630  </itemizedlist>  </itemizedlist>
2631  <para>  <para>
2632  The function of <command>dh_*</command> commands are almost self-evident from  The functions of <command>dh_*</command> commands are largely self-evident from
2633  their names.  <footnote><para> For complete information on what do all these  their names.  <footnote><para> For complete information on what all these
2634  <command>dh_*</command> scripts exactly do, and what their other options are,  <command>dh_*</command> scripts do exactly, and what their other options are,
2635  please read their respective manual pages and the <systemitem role="package">debhelper</systemitem> documentation.  </para> </footnote> There  please read their respective manual pages and the <systemitem role="package">debhelper</systemitem> documentation.  </para> </footnote> There
2636  are few notable ones worth making (over)simplified explanation here assuming  are a few notable ones that are worth giving (over)simplified explanations here assuming
2637  typical build environment based on <filename>Makefile</filename>.  a typical build environment based on a <filename>Makefile</filename>.
2638  <footnote><para> These commands support other build environments such as  <footnote><para> These commands support other build environments such as
2639  <filename>setup.py</filename> which can be listed by executing  <filename>setup.py</filename> which can be listed by executing
2640  <literal>dh_auto_build --list</literal> in a package source directory.  </para>  <literal>dh_auto_build --list</literal> in a package source directory.  </para>
# Line 2570  typical build environment based on <file Line 2643  typical build environment based on <file
2643  <itemizedlist>  <itemizedlist>
2644  <listitem>  <listitem>
2645  <para>  <para>
2646  <command>dh_auto_clean</command> usually executes the following if  <command>dh_auto_clean</command> usually executes the following if a
2647  <filename>Makefile</filename> exists with the <literal>distclean</literal>  <filename>Makefile</filename> exists with the <literal>distclean</literal>
2648  target.  <footnote><para> It actually looks for the first available target of  target.  <footnote><para> It actually looks for the first available target
2649  <literal>distclean</literal>, <literal>realclean</literal> or  in the <filename>Makefile</filename> out of
2650  <literal>clean</literal> in <filename>Makefile</filename> and execute it.  <literal>distclean</literal>, <literal>realclean</literal>, or
2651    <literal>clean</literal>, and executes that.
2652  </para> </footnote>  </para> </footnote>
2653  </para>  </para>
2654  <screen>  <screen>
# Line 2602  make Line 2676  make
2676  </listitem>  </listitem>
2677  <listitem>  <listitem>
2678  <para>  <para>
2679  <command>dh_auto_test</command> usually executes the following if  <command>dh_auto_test</command> usually executes the following if a
2680  <filename>Makefile</filename> exists with the <literal>test</literal> target.  <filename>Makefile</filename> exists with the <literal>test</literal> target.
2681  <footnote><para> It actually looks for the first available target of  <footnote><para> It actually looks for the first available target in
2682  <literal>test</literal> or <literal>check</literal> in  the <filename>Makefile</filename> out of <literal>test</literal> or
2683  <filename>Makefile</filename> and execute it.  </para> </footnote>  <literal>check</literal>, and executes thait.  </para> </footnote>
2684  </para>  </para>
2685  <screen>  <screen>
2686  make test  make test
# Line 2614  make test Line 2688  make test
2688  </listitem>  </listitem>
2689  <listitem>  <listitem>
2690  <para>  <para>
2691  <command>dh_auto_install</command> usually executes the following if  <command>dh_auto_install</command> usually executes the following if a
2692  <filename>Makefile</filename> exists with the <literal>install</literal> target  <filename>Makefile</filename> exists with the <literal>install</literal> target
2693  (line folded for readability).  (line folded for readability).
2694  </para>  </para>
# Line 2625  make install \ Line 2699  make install \
2699  </listitem>  </listitem>
2700  </itemizedlist>  </itemizedlist>
2701  <para>  <para>
2702  Targets which require the <command>fakeroot</command> command contain  All targets which require the <command>fakeroot</command> command will contain
2703  <command>dh_testroot</command>.  If you are not pretending to be root using  <command>dh_testroot</command>, which exits with an error if you are not
2704  this command, it exits with an error.  using this command to pretend to be root.
2705  </para>  </para>
2706  <para>  <para>
2707  The important part to know about the <filename>rules</filename> file created by  The important part to know about the <filename>rules</filename> file created by
2708  <command>dh_make</command>, is that it is just a suggestion.  It will work for  <command>dh_make</command> is that it is just a suggestion.  It will work for
2709  most packages but for more complicated ones, don't be afraid to customize it to  most packages but for more complicated ones, don't be afraid to customize it to
2710  fit your needs.  Only things that you must not change are the names of the  fit your needs.  The only things that you must not change are the names of the
2711  rules, because all the tools use these names, as mandated by the Debian Policy.  rules, because all the tools use these names, as mandated by the Debian Policy.
2712  </para>  </para>
2713  <para>  <para>
2714  Although <literal>install</literal> is not required target, it is supported.  Although <literal>install</literal> is not a required target, it is supported.
2715  <literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh  <literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh
2716  binary</literal> but stops after <command>dh_fixperms</command>.  binary</literal> but stops after <command>dh_fixperms</command>.
2717  </para>  </para>
# Line 2657  file, you should activate its customizat Line 2731  file, you should activate its customizat
2731  <itemizedlist>  <itemizedlist>
2732  <listitem>  <listitem>
2733  <para>  <para>
2734  Add support of the <command>dh_pysupport</command> command.  (The best choice  Add support for the <command>dh_pysupport</command> command.  (The best choice
2735  for Python.) <footnote><para> Use of the <command>dh_pysupport</command>  for Python.) <footnote><para> Use of the <command>dh_pysupport</command>
2736  command is preferred over use of the <command>dh_pycentral</command> command.  command is preferred over use of the <command>dh_pycentral</command> command.
2737  Do not use the <command>dh_python</command> command.  </para> </footnote>  Do not use the <command>dh_python</command> command.  </para> </footnote>
# Line 2665  Do not use the <command>dh_python</comma Line 2739  Do not use the <command>dh_python</comma
2739  <itemizedlist>  <itemizedlist>
2740  <listitem>  <listitem>
2741  <para>  <para>
2742  Install the <systemitem role="package">python-support</systemitem> package in  Include the <systemitem role="package">python-support</systemitem> package in
2743  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2744  </para>  </para>
2745  </listitem>  </listitem>
2746  <listitem>  <listitem>
2747  <para>  <para>
2748  Use <literal>dh $@</literal> as usual.  (This is enabled by default)  Use <literal>dh $@</literal> as usual.  (Use of <command>dh_pysupport</command> is the default)
2749  </para>  </para>
2750  </listitem>  </listitem>
2751  <listitem>  <listitem>
# Line 2683  This handles Python modules using the <s Line 2757  This handles Python modules using the <s
2757  </listitem>  </listitem>
2758  <listitem>  <listitem>
2759  <para>  <para>
2760  Add support of the <command>dh_pycentral</command> command.  Add support for the <command>dh_pycentral</command> command.
2761  </para>  </para>
2762  <itemizedlist>  <itemizedlist>
2763  <listitem>  <listitem>
2764  <para>  <para>
2765  Install the <systemitem role="package">python-central</systemitem> package in  Include the <systemitem role="package">python-central</systemitem> package in
2766  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2767  </para>  </para>
2768  </listitem>  </listitem>
# Line 2711  This handles Python modules using the <s Line 2785  This handles Python modules using the <s
2785  </listitem>  </listitem>
2786  <listitem>  <listitem>
2787  <para>  <para>
2788  Add support of the <command>dh_installtex</command> command.  Add support for the <command>dh_installtex</command> command.
2789  </para>  </para>
2790  <itemizedlist>  <itemizedlist>
2791  <listitem>  <listitem>
2792  <para>  <para>
2793  Install the <systemitem role="package">tex-common</systemitem> package in  Include the <systemitem role="package">tex-common</systemitem> package in
2794  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2795  </para>  </para>
2796  </listitem>  </listitem>
# Line 2727  Use <literal>dh --with tex $@</literal> Line 2801  Use <literal>dh --with tex $@</literal>
2801  </listitem>  </listitem>
2802  <listitem>  <listitem>
2803  <para>  <para>
2804  This registers Type 1 fonts, hyphenation patterns, or formats with TeX.  This registers Type 1 fonts, hyphenation patterns, and formats with TeX.
2805  </para>  </para>
2806  </listitem>  </listitem>
2807  </itemizedlist>  </itemizedlist>
2808  </listitem>  </listitem>
2809  <listitem>  <listitem>
2810  <para>  <para>
2811  Add support of the <command>dh_quilt_patch</command> and  Add support for the <command>dh_quilt_patch</command> and
2812  <command>dh_quilt_unpatch</command> commands.  <command>dh_quilt_unpatch</command> commands.
2813  </para>  </para>
2814  <itemizedlist>  <itemizedlist>
2815  <listitem>  <listitem>
2816  <para>  <para>
2817  Install the <systemitem role="package">quilt</systemitem> package in  Include the <systemitem role="package">quilt</systemitem> package in
2818  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2819  </para>  </para>
2820  </listitem>  </listitem>
# Line 2752  Use <literal>dh --with quilt $@</literal Line 2826  Use <literal>dh --with quilt $@</literal
2826  <listitem>  <listitem>
2827  <para>  <para>
2828  This applies and un-applies patches to the upstream source from files in the  This applies and un-applies patches to the upstream source from files in the
2829  <filename>debian/patches</filename> directory for the <literal>1.0</literal>  <filename>debian/patches</filename> directory for a source package in the <literal>1.0</literal> format.
 source package.  
2830  </para>  </para>
2831  </listitem>  </listitem>
2832  <listitem>  <listitem>
2833  <para>  <para>
2834  This is not needed if you use the new <literal>3.0 (quilt)</literal> source  This is not needed if you use the new <literal>3.0 (quilt)</literal> source
2835  package.  package format.
2836  </para>  </para>
2837  </listitem>  </listitem>
2838  </itemizedlist>  </itemizedlist>
2839  </listitem>  </listitem>
2840  <listitem>  <listitem>
2841  <para>  <para>
2842  Add support of the <command>dh_dkms</command> command.  Add support for the <command>dh_dkms</command> command.
2843  </para>  </para>
2844  <itemizedlist>  <itemizedlist>
2845  <listitem>  <listitem>
2846  <para>  <para>
2847  Install the <systemitem role="package">dkms</systemitem> package in  Include the <systemitem role="package">dkms</systemitem> package in
2848  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2849  </para>  </para>
2850  </listitem>  </listitem>
# Line 2782  Use <literal>dh --with dkms $@</literal> Line 2855  Use <literal>dh --with dkms $@</literal>
2855  </listitem>  </listitem>
2856  <listitem>  <listitem>
2857  <para>  <para>
2858  This correctly handles DKMS usage by the kernel module package.  This correctly handles DKMS usage by kernel module packages.
2859  </para>  </para>
2860  </listitem>  </listitem>
2861  </itemizedlist>  </itemizedlist>
2862  </listitem>  </listitem>
2863  <listitem>  <listitem>
2864  <para>  <para>
2865  Add support of the <command>dh_autotools-dev_updateconfig</command> and  Add support for the <command>dh_autotools-dev_updateconfig</command> and
2866  <command>dh_autotools-dev_restoreconfig</command> commands.  <command>dh_autotools-dev_restoreconfig</command> commands.
2867  </para>  </para>
2868  <itemizedlist>  <itemizedlist>
2869  <listitem>  <listitem>
2870  <para>  <para>
2871  Install the <systemitem role="package">autotools-dev</systemitem> package in  Include the <systemitem role="package">autotools-dev</systemitem> package in
2872  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2873  </para>  </para>
2874  </listitem>  </listitem>
# Line 2814  This updates and restores <filename>conf Line 2887  This updates and restores <filename>conf
2887  </listitem>  </listitem>
2888  <listitem>  <listitem>
2889  <para>  <para>
2890  Add support of the <command>dh_autoreconf</command> and  Add support for the <command>dh_autoreconf</command> and
2891  <command>dh_autoreconf_clean</command> commands.  <command>dh_autoreconf_clean</command> commands.
2892  </para>  </para>
2893  <itemizedlist>  <itemizedlist>
2894  <listitem>  <listitem>
2895  <para>  <para>
2896  Install the <systemitem role="package">dh-autoreconf</systemitem> package in  Include the <systemitem role="package">dh-autoreconf</systemitem> package in
2897  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2898  </para>  </para>
2899  </listitem>  </listitem>
# Line 2838  This updates the GNU Build System files Line 2911  This updates the GNU Build System files
2911  </listitem>  </listitem>
2912  <listitem>  <listitem>
2913  <para>  <para>
2914  Add support to the <command>bash</command> completion feature.  Add support for the <command>bash</command> completion feature.
2915  </para>  </para>
2916  <itemizedlist>  <itemizedlist>
2917  <listitem>  <listitem>
2918  <para>  <para>
2919  Install the <systemitem role="package">bash-completion</systemitem> package in  Includes the <systemitem role="package">bash-completion</systemitem> package in
2920  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2921  </para>  </para>
2922  </listitem>  </listitem>
# Line 2854  Use <literal>dh --with bash-completion $ Line 2927  Use <literal>dh --with bash-completion $
2927  </listitem>  </listitem>
2928  <listitem>  <listitem>
2929  <para>  <para>
2930  This installs <command>bash</command> completions using configuration file at  This installs <command>bash</command> completions using a configuration file at
2931  <filename>debian/<replaceable>package</replaceable>.bash-completion</filename>.  <filename>debian/<replaceable>package</replaceable>.bash-completion</filename>.
2932  </para>  </para>
2933  </listitem>  </listitem>
# Line 2868  command can be customized by the corresp Line 2941  command can be customized by the corresp
2941  manpage of each command for the customization of such features.  manpage of each command for the customization of such features.
2942  </para>  </para>
2943  <para>  <para>
2944  Some <command>dh_*</command> commands invoked by the new <command>dh</command>  You may need to run <command>dh_*</command> commands invoked via the new <command>dh</command>
2945  command may require you to run it with some arguments or to run additional  with added arguments, or to run additional commands with them, or to skip them.
2946  commands with them or to skip them.  For such cases, you create an  For such cases, you create an
2947  <literal>override_dh_<replaceable>foo</replaceable></literal> target with its  <literal>override_dh_<replaceable>foo</replaceable></literal> target with its
2948  rule in the <filename>rules</filename> file only for the  rule in the <filename>rules</filename> file defining an
2949    <literal>override_dh_<replaceable>foo</replaceable></literal> target for the
2950  <command>dh_<replaceable>foo</replaceable></command> command you want to  <command>dh_<replaceable>foo</replaceable></command> command you want to
2951  change.  It basically say <emphasis>run me instead</emphasis>.  change.  It basically says <emphasis>run me instead</emphasis>.
2952  <footnote><para> Under <literal>lenny</literal>, if you wanted to change the  <footnote><para> Under <literal>lenny</literal>, if you wanted to change the
2953  behavior of a <command>dh_*</command> script you found the relevant line in the  behavior of a <command>dh_*</command> script you found the relevant line in the
2954  <filename>rules</filename> file and adjusted it.  </para> </footnote>  <filename>rules</filename> file and adjusted it.  </para> </footnote>
2955  </para>  </para>
2956  <para>  <para>
2957  Please note that the <command>dh_auto_*</command> commands tend to do more than  Please note that the <command>dh_auto_*</command> commands tend to do more than
2958  what has been discussed as (over)simplified explanation to take care all the  what has been discussed in this (over)simplified explanation to take care of all the
2959  corner cases.  Use of simplified equivalent command instead of these in  corner cases.  It is a bad idea to use <literal>override_dh_*</literal> targets
2960  <literal>override_dh_*</literal> targets except the  to substitute simplified equivalent commands (except for the
2961  <literal>override_dh_auto_clean</literal> target is a bad idea since it may  <literal>override_dh_auto_clean</literal> target) since it may
2962  kill such <systemitem role="package">debhelper</systemitem>'s smart features.  bypass such smart <systemitem role="package">debhelper</systemitem> features.
2963  </para>  </para>
2964  <para>  <para>
2965  If you want to store the system configuration data in the  So, for instance, if you want to store system configuration data in the
2966  <filename>/etc/gentoo</filename> directory instead of the usual  <filename>/etc/gentoo</filename> directory instead of the usual
2967  <filename>/etc</filename> directory for the recent  <filename>/etc</filename> directory for the recent
2968  <systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default  <systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default
# Line 2903  override_dh_auto_configure: Line 2977  override_dh_auto_configure:
2977  <para>  <para>
2978  The arguments given after <literal>--</literal> are appended to the default  The arguments given after <literal>--</literal> are appended to the default
2979  arguments of the auto-executed program to override them.  Using the  arguments of the auto-executed program to override them.  Using the
2980  <command>dh_auto_configure</command> command is better than the  <command>dh_auto_configure</command> command is better than directly invoking the
2981  <command>./configure</command> command here since it will only override the  <command>./configure</command> command here since it will only override the
2982  <literal>--sysconfig</literal> argument and keeps well intended other arguments  <literal>--sysconfig</literal> argument and retains any other, benign arguments
2983  to the <command>./configure</command> command.  to the <command>./configure</command> command.
2984  </para>  </para>
2985  <para>  <para>
2986  If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> requires you to specify  If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify
2987  <literal>build</literal> as its target to build it <footnote><para>  <literal>build</literal> as its target to build it <footnote><para>
2988  <command>dh_auto_build</command> without any arguments will execute the first  <command>dh_auto_build</command> without any arguments will execute the first
2989  target in the <filename>Makefile</filename> file.  </para> </footnote>, you  target in the <filename>Makefile</filename>.  </para> </footnote>, you
2990  create an <literal>override_dh_auto_build</literal> target to enable it.  create an <literal>override_dh_auto_build</literal> target to enable this.
2991  </para>  </para>
2992  <screen>  <screen>
2993  override_dh_auto_build:  override_dh_auto_build:
2994          dh_auto_build -- build          dh_auto_build -- build
2995  </screen>  </screen>
2996  <para>  <para>
2997  This ensures to run $(MAKE) with all the default arguments given by the  This ensures $(MAKE) is run with all the default arguments given by the
2998  <command>dh_auto_build</command> command and <literal>build</literal> argument.  <command>dh_auto_build</command> command plus the <literal>build</literal> argument.
2999  </para>  </para>
3000  <para>  <para>
3001  If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> requires you to specify the  If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify the
3002  <literal>packageclean</literal> target to clean it for Debian package instead  <literal>packageclean</literal> target to clean it for the Debian package instead
3003  of the <literal>distclean</literal> or <literal>clean</literal> targets in the  of using <literal>distclean</literal> or <literal>clean</literal> targets,
3004  <filename>Makefile</filename> file, you create an  you can create an
3005  <literal>override_dh_auto_clean</literal> target to enable it.  <literal>override_dh_auto_clean</literal> target to enable thit.
3006  </para>  </para>
3007  <screen>  <screen>
3008  override_dh_auto_clean:  override_dh_auto_clean:
3009          $(MAKE) packageclean          $(MAKE) packageclean
3010  </screen>  </screen>
3011  <para>  <para>
3012  If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> contains <literal>test</literal> target  If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> contains a <literal>test</literal> target
3013  which you do not want to run for the Debian package building process, you can  which you do not want to run for the Debian package building process, you can
3014  use empty <literal>override_dh_auto_test</literal> target to skip it.  use an empty <literal>override_dh_auto_test</literal> target to skip it.
3015  </para>  </para>
3016  <screen>  <screen>
3017  override_dh_auto_test:  override_dh_auto_test:
# Line 2949  changelog file called <filename>FIXES</f Line 3023  changelog file called <filename>FIXES</f
3023  The <command>dh_installchangelogs</command> command requires  The <command>dh_installchangelogs</command> command requires
3024  <filename>FIXES</filename> as its argument to install it.  <footnote><para> The  <filename>FIXES</filename> as its argument to install it.  <footnote><para> The
3025  <filename>debian/changelog</filename> and <filename>debian/NEWS</filename>  <filename>debian/changelog</filename> and <filename>debian/NEWS</filename>
3026  files are always automatically installed.  The upstream changelog is searched  files are always automatically installed.  The upstream changelog is found
3027  by converting filenames to the lower case and matching them with the  by converting filenames to lower case and matching them against
3028  <filename>changelog</filename>, <filename>changes</filename>,  <filename>changelog</filename>, <filename>changes</filename>,
3029  <filename>changelog.txt</filename>, and <filename>changes.txt</filename>.  <filename>changelog.txt</filename>, and <filename>changes.txt</filename>.
3030  </para> </footnote>  </para> </footnote>
# Line 2961  override_dh_installchangelogs: Line 3035  override_dh_installchangelogs:
3035  </screen>  </screen>
3036  <para>  <para>
3037  When you use the new <command>dh</command> command, use of explicit targets  When you use the new <command>dh</command> command, use of explicit targets
3038  such as the ones listed in <xref linkend="targets"/> except  such as the ones listed in <xref linkend="targets"/>, other than the
3039  <literal>get-orig-source</literal> target may make it difficult to understand  <literal>get-orig-source</literal> target, may make it difficult to understand
3040  their exact effects.  Please limit explicit targets to  their exact effects.  Please limit explicit targets to
3041  <literal>override_dh_*</literal> targets and completely independent ones, if  <literal>override_dh_*</literal> targets and completely independent ones, if
3042  possible.  possible.
# Line 2974  possible. Line 3048  possible.
3048  <para>  <para>
3049  To control most of what <systemitem role="package">debhelper</systemitem> does  To control most of what <systemitem role="package">debhelper</systemitem> does
3050  while building the package, you put optional configuration files under the  while building the package, you put optional configuration files under the
3051  <filename>debian</filename> directory.  This chapter will make an overview of  <filename>debian</filename> directory.  This chapter will provide an overview of
3052  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
3053  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's  Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's
3054  Reference</ulink> for guidelines for the packaging.  Reference</ulink> for guidelines for packaging.
3055  </para>  </para>
3056  <para>  <para>
3057  The <command>dh_make</command> command will create some template configuration  The <command>dh_make</command> command will create some template configuration
# Line 2988  prefixed by the binary package name such Line 3062  prefixed by the binary package name such
3062  them.  them.
3063  <footnote><para>  <footnote><para>
3064  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
3065  referred without preceding <filename>debian/</filename> for simplicity whenever  referred to without the leading <filename>debian/</filename> for simplicity whenever
3066  they are obvious.  the meaning is obvious.
3067  </para></footnote>  </para></footnote>
3068  </para>  </para>
3069  <para>  <para>
3070  The <command>dh_make</command> command may not create some template  Some template configuration files for <systemitem role="package">debhelper</systemitem>
3071  configuration files for <systemitem role="package">debhelper</systemitem>.  In  may not be created by the <command>dh_make</command> command.  In
3072  such cases, you need to create them with the editor.  such cases, you need to create them with an editor.
3073  </para>  </para>
3074  <para>  <para>
3075  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:
3076  </para>  </para>
3077  <itemizedlist>  <itemizedlist>
3078  <listitem>  <listitem>
3079  <para>  <para>
3080  rename template files by removing the <literal>.ex</literal> or  rename template files by removing the <literal>.ex</literal> or
3081  <literal>.EX</literal> suffix if the template files have one.  <literal>.EX</literal> suffix if they have one;
3082  </para>  </para>
3083  </listitem>  </listitem>
3084  <listitem>  <listitem>
3085  <para>  <para>
3086  rename the name of these configuration files using the actual binary package  rename the configuration files to use the actual binary package
3087  name in place of <literal><replaceable>package</replaceable></literal>.  name in place of <literal><replaceable>package</replaceable></literal>;
3088  </para>  </para>
3089  </listitem>  </listitem>
3090  <listitem>  <listitem>
3091  <para>  <para>
3092  modify template file contents to suit your needs.  modify template file contents to suit your needs;
3093  </para>  </para>
3094  </listitem>  </listitem>
3095  <listitem>  <listitem>
3096  <para>  <para>
3097  remove template files which you do not need.  remove template files which you do not need;
3098  </para>  </para>
3099  </listitem>  </listitem>
3100  <listitem>  <listitem>
3101  <para>  <para>
3102  modify the <filename>control</filename> file (see <xref linkend="control"/>),  modify the <filename>control</filename> file (see <xref linkend="control"/>),
3103  if necessary.  if necessary;
3104  </para>  </para>
3105  </listitem>  </listitem>
3106  <listitem>  <listitem>
# Line 3037  necessary. Line 3111  necessary.
3111  </listitem>  </listitem>
3112  </itemizedlist>  </itemizedlist>
3113  <para>  <para>
3114  Those <systemitem role="package">debhelper</systemitem> configuration files  Any <systemitem role="package">debhelper</systemitem> configuration files
3115  without <filename><replaceable>package</replaceable></filename> prefix such as  without a <filename><replaceable>package</replaceable></filename> prefix, such as
3116  <filename>install</filename> apply to the first binary package.  When there are  <filename>install</filename>, apply to the first binary package.  When there are
3117  many binary packages, their configurations can be specified by prefixing their  many binary packages, their configurations can be specified by prefixing their
3118  name to their configuration filenames such as  name to their configuration filenames such as
3119  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3120  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3121  </para>  </para>
3122  <section id="readme"><title><filename>README.Debian</filename> file</title>  <section id="readme"><title><filename>README.Debian</filename></title>
3123  <para>  <para>
3124  Any extra details or discrepancies between the original package and your Debian  Any extra details or discrepancies between the original package and your Debian
3125  version should be documented here.  version should be documented here.
3126  </para>  </para>
3127  <para>  <para>
3128  <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:
3129  </para>  </para>
3130  <screen>  <screen>
3131  gentoo for Debian  gentoo for Debian
# Line 3065  If you have nothing to be documented, re Line 3139  If you have nothing to be documented, re
3139  </citerefentry>.  </citerefentry>.
3140  </para>  </para>
3141  </section>  </section>
3142  <section id="compat"><title><filename>compat</filename> file</title>  <section id="compat"><title><filename>compat</filename></title>
3143  <para>  <para>
3144  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
3145  should set it to the <systemitem role="package">debhelper</systemitem> V7 by  should set it to the <systemitem role="package">debhelper</systemitem> v7 as
3146  the following.  follows:
3147  </para>  </para>
3148  <screen>  <screen>
3149  $ echo 7 &gt; debian/compat  $ echo 7 &gt; debian/compat
3150  </screen>  </screen>
3151  </section>  </section>
3152  <section id="conffiles"><title><filename>conffiles</filename> file</title>  <section id="conffiles"><title><filename>conffiles</filename></title>
3153  <para>  <para>
3154  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
3155  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
3156  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.
3157  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>  <footnote><para>See <citerefentry> <refentrytitle>dpkg</refentrytitle>
3158  <manvolnum>1</manvolnum> </citerefentry> and  <manvolnum>1</manvolnum> </citerefentry> and
3159  <ulink url="&policy-conffiles;">Debian Policy Manual 'D.2.5 Conffiles'</ulink>.  <ulink url="&policy-conffiles;">Debian Policy Manual "D.2.5 Conffiles"</ulink>.
3160  </para></footnote>  </para></footnote>
3161  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
3162  your old configuration files or not.  your old configuration files or not.
3163  </para>  </para>
3164  <para>  <para>
3165  Since <systemitem role="package">debhelper</systemitem> V3, <citerefentry>  <citerefentry><refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>
3166  <refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> <emphasis>automatically</emphasis> flags any files under
 </citerefentry> will <emphasis>automatically</emphasis> flag any files under  
3167  the <filename>/etc</filename> directory as conffiles, so if your program only  the <filename>/etc</filename> directory as conffiles, so if your program only
3168  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
3169  package types, the only place there is (and should be conffiles) is under  package types, the only place conffiles should ever be is under
3170  <filename>/etc</filename> and so this file doesn't need to exist.  <filename>/etc</filename>, and so this file doesn't need to exist.
3171  </para>  </para>
3172  <para>  <para>
3173  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,
3174  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
3175  then prompt users to verify the changes all the time.  then prompt users to verify the changes all the time.
3176  </para>  </para>
3177  <para>  <para>
3178  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
3179  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
3180  make them not as conffiles to keep <command>dpkg</command> quiet.  arrange for them to not be conffiles, keeping <command>dpkg</command> quiet.
3181  </para>  </para>
3182  <itemizedlist>  <itemizedlist>
3183  <listitem>  <listitem>
3184  <para>  <para>
3185  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
3186  file under the <filename>/var</filename> directory generated by the  file under the <filename>/var</filename> directory generated by the
3187  <emphasis>maintainer scripts</emphasis>.  maintainer scripts.
3188  </para>  </para>
3189  </listitem>  </listitem>
3190  <listitem>  <listitem>
3191  <para>  <para>
3192  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.  
3193  </para>  </para>
3194  </listitem>  </listitem>
3195  </itemizedlist>  </itemizedlist>
3196  <para>  <para>
3197  For more information on the <emphasis>maintainer scripts</emphasis>, see <xref linkend="maintscripts"/>.  For information on maintainer scripts, see <xref linkend="maintscripts"/>.
3198  </para>  </para>
3199  </section>  </section>
3200  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename> files</title>  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename></title>
3201  <para>  <para>
3202  If your package requires regularly scheduled tasks to operate properly, you can  If your package requires regularly scheduled tasks to operate properly, you can
3203  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
3204  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
3205  you wish.  The filenames are:  you wish.  The filenames are:
3206  </para>  </para>
3207  <itemizedlist>  <itemizedlist>
3208  <listitem>  <listitem>
3209  <para>  <para>
3210  <filename>cron.hourly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.hourly</filename> - Installed as
3211  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>; run
3212  once an hour every hour.  once an hour.
3213  </para>  </para>
3214  </listitem>  </listitem>
3215  <listitem>  <listitem>
3216  <para>  <para>
3217  <filename>cron.daily</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.daily</filename> - Installed as
3218  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>; run
3219  once a day, usually early morning.  once a day.
3220  </para>  </para>
3221  </listitem>  </listitem>
3222  <listitem>  <listitem>
3223  <para>  <para>
3224  <filename>cron.weekly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.weekly</filename> - Installed as
3225  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>; run
3226  once a week, usually early Sunday morning.  once a week.
3227  </para>  </para>
3228  </listitem>  </listitem>
3229  <listitem>  <listitem>
3230  <para>  <para>
3231  <filename>cron.monthly</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.monthly</filename> - Installed as
3232  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run  <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run
3233  once a month, usually early morning on the first of the month.  once a month.
3234  </para>  </para>
3235  </listitem>  </listitem>
3236  <listitem>  <listitem>
3237  <para>  <para>
3238  <filename>cron.d</filename> - Installed as  <filename><replaceable>package</replaceable>.cron.d</filename> - Installed as
3239  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any  <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any
3240  other time  other time.
3241  </para>  </para>
3242  </listitem>  </listitem>
3243  </itemizedlist>  </itemizedlist>
3244  <para>  <para>
3245  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
3246  is <filename><replaceable>package</replaceable>.cron.d</filename> which follows  <filename><replaceable>package</replaceable>.cron.d</filename> which follows
3247  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>  the format of <citerefentry> <refentrytitle>crontab</refentrytitle>
3248  <manvolnum>5</manvolnum> </citerefentry>.  <manvolnum>5</manvolnum> </citerefentry>.
3249  </para>  </para>
3250  <para>  <para>
3251  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;
3252  <refentrytitle>dh_installlogrotate</refentrytitle> <manvolnum>1</manvolnum>  for that, see
3253  </citerefentry> and <citerefentry> <refentrytitle>logrotate</refentrytitle>  <citerefentry><refentrytitle>dh_installlogrotate</refentrytitle>
3254  <manvolnum>8</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum></citerefentry> and
3255    <citerefentry><refentrytitle>logrotate</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
3256  </para>  </para>
3257  </section>  </section>
3258  <section id="dirs"><title><filename>dirs</filename> file</title>  <section id="dirs"><title><filename>dirs</filename></title>
3259  <para>  <para>
3260  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
3261  procedure (<literal>make install DESTDIR=...</literal> invoked by  procedure (<literal>make install DESTDIR=...</literal> invoked by
3262  <literal>dh_auto_install</literal>) somehow doesn't create.  This generally  <literal>dh_auto_install</literal>).  This generally
3263  means there is a problem with the <filename>Makefile</filename>.  means there is a problem with the <filename>Makefile</filename>.
3264  </para>  </para>
3265  <para>  <para>
3266  Files listed in the <filename>install</filename> file doesn't need the  Files listed in an <filename>install</filename> file don't need their
3267  directories created first.  See <xref linkend="install"/>.  directories created first.  See <xref linkend="install"/>.
3268  </para>  </para>
3269  <para>  <para>
3270  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
3271  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
3272  the <filename>dirs</filename> file.  the <filename>dirs</filename> file.
3273  </para>  </para>
3274  </section>  </section>
3275  <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>
3276  <para>  <para>
3277  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
3278  should use the <systemitem role="package">doc-base</systemitem> file to  should use the <systemitem role="package">doc-base</systemitem> file to
3279  register it, so the user can find it with e.g.  <citerefentry>  register it, so the user can find it with e.g.  <citerefentry>
3280  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,
3281  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum>
3282  </citerefentry> or <citerefentry> <refentrytitle>doccentral</refentrytitle>  </citerefentry>, or <citerefentry> <refentrytitle>doccentral</refentrytitle>
3283  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
3284  </para>  </para>
3285  <para>  <para>
# Line 3214  This usually includes HTML, PS and PDF f Line 3287  This usually includes HTML, PS and PDF f
3287  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.  <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.
3288  </para>  </para>
3289  <para>  <para>
3290  This is how <systemitem role="package">gentoo</systemitem>'s doc-base file  This is what <systemitem role="package">gentoo</systemitem>'s doc-base file
3291  <filename>gentoo.doc-base</filename> looks like:  <filename>gentoo.doc-base</filename> looks like:
3292  </para>  </para>
3293  <screen>  <screen>
# Line 3237  manual, in <ulink url="&doc-base;">Debia Line 3310  manual, in <ulink url="&doc-base;">Debia
3310  For more details on installing additional documentation, look in <xref linkend="destdir"/>.  For more details on installing additional documentation, look in <xref linkend="destdir"/>.
3311  </para>  </para>
3312  </section>  </section>
3313  <section id="docs"><title><filename>docs</filename> file</title>  <section id="docs"><title><filename>docs</filename></title>
3314  <para>  <para>
3315  This file specifies the file names of documentation files we can have  This file specifies the file names of documentation files we can have
3316  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
# Line 3250  directory that are called <filename>BUGS Line 3323  directory that are called <filename>BUGS
3323  <filename>README*</filename>, <filename>TODO</filename> etc.  <filename>README*</filename>, <filename>TODO</filename> etc.
3324  </para>  </para>
3325  <para>  <para>
3326  For <systemitem role="package">gentoo</systemitem>, I also included some other  For <systemitem role="package">gentoo</systemitem>, some other files
3327  files:  are also included:
3328  </para>  </para>
3329  <screen>  <screen>
3330  BUGS  BUGS
# Line 3263  README.gtkrc Line 3336  README.gtkrc
3336  TODO  TODO
3337  </screen>  </screen>
3338  </section>  </section>
3339  <section id="emacsen"><title><filename>emacsen-*</filename> file</title>  <section id="emacsen"><title><filename>emacsen-*</filename></title>
3340  <para>  <para>
3341  If your package supplies Emacs files that can be bytecompiled at package  If your package supplies Emacs files that can be bytecompiled at package
3342  installation time, you can use these files to set it up.  installation time, you can use these files to set it up.
# Line 3277  They are installed into the temporary di Line 3350  They are installed into the temporary di
3350  If you don't need these, remove them.  If you don't need these, remove them.
3351  </para>  </para>
3352  </section>  </section>
3353  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename> file</title>  <section id="examples"><title><filename><replaceable>package</replaceable>.examples</filename></title>
3354  <para>  <para>
3355  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>  The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle>
3356  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories  <manvolnum>1</manvolnum> </citerefentry> command installs files and directories
3357  listed in this file as example files.  listed in this file as example files.
3358  </para>  </para>
3359  </section>  </section>
3360  <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>
3361  <para>  <para>
3362  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
3363  obviously disregarded my initial recommendation, haven't you?  :-)  obviously disregarded my initial recommendation, haven't you?  :-)
3364  </para>  </para>
3365  <para>  <para>
3366  The <filename><replaceable>package</replaceable>.init</filename> file is  The <filename><replaceable>package</replaceable>.init</filename> file is
3367  installed as the  installed as the
3368  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script
3369  for the <emphasis>init script</emphasis> which starts and stops a daemon.  which starts and stops the daemon.
3370  Its fairly generic skeleton template is provided by the  Its fairly generic skeleton template is provided by the
3371  <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
3372  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 3304  gets installed into the temporary direct Line 3377  gets installed into the temporary direct
3377  </para>  </para>
3378  <para>  <para>
3379  The <filename><replaceable>package</replaceable>.default</filename> file will  The <filename><replaceable>package</replaceable>.default</filename> file will
3380  be installed into  be installed as
3381  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This
3382  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
3383  <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
3384  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
3385  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
3386    features, you can set them in the <filename><replaceable>package</replaceable>.default</filename> file,
3387    instead of in the init script itself.
3388  </para>  </para>
3389  <para>  <para>
3390  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
3391  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
3392  <filename><replaceable>package</replaceable>.init</filename>.  However  <filename><replaceable>package</replaceable>.init</filename>.  However
3393  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
3394  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
3395  need to override <command>dh_installinit</command> in the  need to override <command>dh_installinit</command> in the
3396  <filename>rules</filename> file with the following lines:  <filename>rules</filename> file with the following lines:
3397  </para>  </para>
# Line 3328  override_dh_installinit: Line 3403  override_dh_installinit:
3403  If you don't need this, remove the files.  If you don't need this, remove the files.
3404  </para>  </para>
3405  </section>  </section>
3406  <section id="install"><title><filename>install</filename> file</title>  <section id="install"><title><filename>install</filename></title>
3407  <para>  <para>
3408  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
3409  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
3410  destinations into this <filename>install</filename> file.  They are installed  destinations into this <filename>install</filename> file.  They are installed
3411  by <citerefentry> <refentrytitle>dh_install</refentrytitle>  by <citerefentry> <refentrytitle>dh_install</refentrytitle>
3412  <manvolnum>1</manvolnum> </citerefentry>.<footnote><para> This replaces the  <manvolnum>1</manvolnum> </citerefentry>.<footnote><para> This replaces the
# Line 3344  the <filename>docs</filename> file and n Line 3419  the <filename>docs</filename> file and n
3419  <para>  <para>
3420  This <filename>install</filename> file has one line per file installed, with  This <filename>install</filename> file has one line per file installed, with
3421  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
3422  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
3423  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:  
3424  </para>  </para>
3425  <screen>  <screen>
3426  src/foo/mybin usr/bin  src/<replaceable>bar</replaceable> usr/bin
3427  </screen>  </screen>
3428  <para>  <para>
3429  This will mean when this package is installed, there will be a binary executable  This means when this package is installed, there will be an executable command
3430  <filename>/usr/bin/mybin</filename>.  <filename>/usr/bin/<replaceable>bar</replaceable></filename>.
3431  </para>  </para>
3432  <para>  <para>
3433  Alternatively, this <filename>install</filename> can have the name of the file  Alternatively, this <filename>install</filename> can have the name of the file
3434  only without the installation directory when the relative directory path does  only without the installation directory when the relative directory path does
3435  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
3436  result into multiple binary packages using  output of its build into multiple binary packages using
3437  <filename><replaceable>package-1</replaceable>.install</filename>,  <filename><replaceable>package-1</replaceable>.install</filename>,
3438  <filename><replaceable>package-2</replaceable>.install</filename>, etc.  <filename><replaceable>package-2</replaceable>.install</filename>, etc.
3439  </para>  </para>
3440  <para>  <para>
3441  The <command>dh_install</command> command will fall back to look in  The <command>dh_install</command> command will fall back to looking in
3442  <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
3443  current directory (or wherever you've told it to look using  current directory (or wherever you've told it to look using
3444  <literal>--sourcedir</literal>).  <literal>--sourcedir</literal>).
3445  </para>  </para>
3446  </section>  </section>
3447  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename> file</title>  <section id="info"><title><filename><replaceable>package</replaceable>.info</filename></title>
3448  <para>  <para>
3449  If your package has info pages, you should install them using <citerefentry>  If your package has info pages, you should install them using <citerefentry>
3450  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum>
3451  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3452  <filename><replaceable>package</replaceable>.info</filename> files.  <filename><replaceable>package</replaceable>.info</filename> file.
3453  </para>  </para>
3454  </section>  </section>
3455  <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>
3456  <para>  <para>
3457  If <systemitem role="package">lintian</systemitem> reports an erroneous  If <systemitem role="package">lintian</systemitem> reports an erroneous
3458  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
3459  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>  use <filename><replaceable>package</replaceable>.lintian-overrides</filename>
3460  or <filename>source/lintian-overrides</filename> to quiet it.  Please read  or <filename>source/lintian-overrides</filename> to quieten it.  Please read
3461  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain  <ulink url="&lintian-doc;">Lintian User's Manual</ulink> and refrain
3462  from abusing this.  from abusing this.
3463  </para>  </para>
3464  <para>  <para>
3465  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is  <filename><replaceable>package</replaceable>.lintian-overrides</filename> is
3466  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
3467  into  into
3468  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>  <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>
3469  by the <command>dh_lintian</command> command.  by the <command>dh_lintian</command> command.
# Line 3399  by the <command>dh_lintian</command> com Line 3473  by the <command>dh_lintian</command> com
3473  is not installed.  is not installed.
3474  </para>  </para>
3475  </section>  </section>
3476  <section id="manpage"><title><filename>manpage.*</filename> files</title>  <section id="manpage"><title><filename>manpage.*</filename></title>
3477  <para>  <para>
3478  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
3479  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
3480  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
3481  manual page.  Please make sure to remove unused templates.  manual page.  Please make sure to remove unused templates.
3482  </para>  </para>
3483  <section id="manpage1"><title><filename>manpage.1.ex</filename> file</title>  <section id="manpage1"><title><filename>manpage.1.ex</filename></title>
3484  <para>  <para>
3485  Manual pages are normally written in <citerefentry>  Manual pages are normally written in <citerefentry>
3486  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
# Line 3416  The <filename>manpage.1.ex</filename> te Line 3490  The <filename>manpage.1.ex</filename> te
3490  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.
3491  </para>  </para>
3492  <para>  <para>
3493  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
3494  documenting, so we will rename it from <literal>manpage</literal> to  documenting, so we will rename it from <literal>manpage</literal> to
3495  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>  <literal>gentoo</literal>.  The file name also includes <literal>.1</literal>
3496  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
3497  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
3498  list of manual page sections:  list of manual page sections:
3499  </para>  </para>
3500  <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>  
3501  <tgroup cols="3">  <tgroup cols="3">
3502    <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"/>
3503    <thead>    <thead>
# Line 3442  list of manual page sections: Line 3515  list of manual page sections:
3515      <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>
3516    </tbody>    </tbody>
3517  </tgroup>  </tgroup>
3518  </table>  </informaltable>
3519  <para>  <para>
3520  So <systemitem role="package">gentoo</systemitem>'s man page should be called  So <systemitem role="package">gentoo</systemitem>'s man page should be called
3521  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>  <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename>
3522  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
3523  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and  <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and
3524  edit it by using information from the example and from upstream docs.  editing it using information from the example and from the upstream docs.
3525  </para>  </para>
3526  <para>  <para>
3527  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
3528  of <literal>--help</literal> and <literal>--version</literal> output of each  of the <literal>--help</literal> and <literal>--version</literal> output of each
3529  program, too.  <footnote><para> If the command is missing  program, too.  <footnote><para> Note that <command>help2man</command>'s
3530  <command>info</command> page but have documentation files in the  placeholder man page will claim that more detailed documentation is
3531  <filename>/usr/share/<replaceable>package</replaceable></filename> directory,  available in the info system. If the command is missing an
3532  you should manually edit generated the man page created by the  <command>info</command> page, you
3533    should manually edit the man page created by the
3534  <command>help2man</command> command.  </para> </footnote>  <command>help2man</command> command.  </para> </footnote>
3535  </para>  </para>
3536  </section>  </section>
3537  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename> file</title>  <section id="manpagesgml"><title><filename>manpage.sgml.ex</filename></title>
3538  <para>  <para>
3539  If on the other hand you prefer writing SGML instead of  If on the other hand you prefer writing SGML instead of
3540  <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 3485  line in the <filename>control</filename> Line 3559  line in the <filename>control</filename>
3559  </listitem>  </listitem>
3560  <listitem>  <listitem>
3561  <para>  <para>
3562  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3563  <filename>rules</filename> file:  <filename>rules</filename> file:
3564  </para>  </para>
3565  <screen>  <screen>
# Line 3496  override_dh_auto_build: Line 3570  override_dh_auto_build:
3570  </listitem>  </listitem>
3571  </itemizedlist>  </itemizedlist>
3572  </section>  </section>
3573  <section id="manpagexml"><title><filename>manpage.xml.ex</filename> file</title>  <section id="manpagexml"><title><filename>manpage.xml.ex</filename></title>
3574  <para>  <para>
3575  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>
3576  template.  If you do this, you have to:  template.  If you do this, you have to:
# Line 3516  XSLT processor like <systemitem role="pa Line 3590  XSLT processor like <systemitem role="pa
3590  </listitem>  </listitem>
3591  <listitem>  <listitem>
3592  <para>  <para>
3593  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal> and  add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal>, and
3594  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>  <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal>
3595  line in the <literal>control</literal> file  line in the <literal>control</literal> file
3596  </para>  </para>
3597  </listitem>  </listitem>
3598  <listitem>  <listitem>
3599  <para>  <para>
3600  add a <literal>override_dh_auto_build</literal> target to your  add an <literal>override_dh_auto_build</literal> target to your
3601  <filename>rules</filename> file:  <filename>rules</filename> file:
3602  </para>  </para>
3603  <screen>  <screen>
# Line 3541  override_dh_auto_build: Line 3615  override_dh_auto_build:
3615  </itemizedlist>  </itemizedlist>
3616  </section>  </section>
3617  </section>  </section>
3618  <section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename> file</title>  <section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename></title>
3619  <para>  <para>
3620  If your package has manual pages, you should install them using <citerefentry>  If your package has manual pages, you should install them using <citerefentry>
3621  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>
3622  </citerefentry> by listing them in the  </citerefentry> by listing them in a
3623  <filename><replaceable>package</replaceable>.manpages</filename> files.  <filename><replaceable>package</replaceable>.manpages</filename> file.
3624  </para>  </para>
3625  <para>  <para>
3626  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
3627  <filename>gentoo.manpages</filename> file as the following.  <filename>gentoo.manpages</filename> file as follows.
3628  </para>  </para>
3629  <screen>  <screen>
3630  docs/gentoo.1  docs/gentoo.1
3631  </screen>  </screen>
3632  </section>  </section>
3633  <section id="menu"><title><filename>menu</filename> file</title>  <section id="menu"><title><filename>menu</filename></title>
3634  <para>  <para>
3635  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
3636  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 3577  specifies what kind of interface the pro Line 3651  specifies what kind of interface the pro
3651  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.
3652  </para>  </para>
3653  <para>  <para>
3654  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
3655  should appear in.  should appear in.
3656  <footnote><para> The current list of sections is at  <footnote><para> The current list of sections is in
3657  <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>.
3658  There were a major reorganization of menu structure for <literal>squeeze</literal>.  There was a major reorganization of menu structure for <literal>squeeze</literal>.
3659  </para> </footnote>  </para> </footnote>
3660  </para>  </para>
3661  <para>  <para>
# Line 3608  You can also add other fields like <lite Line 3682  You can also add other fields like <lite
3682  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>  </citerefentry>, <citerefentry> <refentrytitle>menufile</refentrytitle>
3683  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>  <manvolnum>5</manvolnum> </citerefentry>, <citerefentry>
3684  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>update-menus</refentrytitle> <manvolnum>1</manvolnum>
3685  </citerefentry> and  </citerefentry>, and
3686  <ulink url="&menu-policy;">The Debian Menu sub-policy</ulink> for more  <ulink url="&policy-menu;">The Debian Menu sub-policy</ulink> for more
3687  information.  information.
3688  </para>  </para>
3689  </section>  </section>
3690  <section id="news"><title><filename>NEWS</filename> file</title>  <section id="news"><title><filename>NEWS</filename></title>
3691  <para>  <para>
3692  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle>
3693  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3694  </para>  </para>
3695  </section>  </section>
3696  <section id="maintscripts"><title><filename>{post|pre}{inst|rm}</filename> files</title>  <section id="maintscripts"><title><filename>{pre,post}{inst,rm}</filename></title>
3697  <para>  <para>
3698  These <filename>postinst</filename>, <filename>preinst</filename>,  These <filename>postinst</filename>, <filename>preinst</filename>,
3699  <filename>postrm</filename>, and <filename>prerm</filename> files  <filename>postrm</filename>, and <filename>prerm</filename> files
3700  <footnote><para> Although I used Bash short hand expression to indicate these  <footnote><para> Despite this use of the <command>bash</command>
3701  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
3702  pure POSIX (non-Bash) shell for these <emphasis>maintainer scripts</emphasis>  filenames, you should use pure POSIX syntax for these maintainer scripts for
3703  as much as possible for the better compatibility.  </para> </footnote> are  compatibility with <command>dash</command> as the system shell.  </para> </footnote> are
3704  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put  called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put
3705  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
3706  package is installed, upgraded or removed.  package is installed, upgraded, or removed.
3707  </para>  </para>
3708  <para>  <para>
3709  As a novice maintainer, you should avoid any manual editing of  As a novice maintainer, you should avoid any manual editing of
3710  <emphasis>maintainer scripts</emphasis> because they are problematic.  For more  maintainer scripts because they are problematic.  For more
3711  information look in the <ulink url="&policy-mantainerscripts;">Debian  information refer to the <ulink url="&policy-mantainerscripts;">Debian
3712  Policy Manual, 6 'Package maintainer scripts and installation  Policy Manual, 6 "Package maintainer scripts and installation
3713  procedure'</ulink>, and take a look at these example files provided by  procedure"</ulink>, and take a look at the example files provided by
3714  <command>dh_make</command>.  <command>dh_make</command>.
3715  </para>  </para>
3716  <para>  <para>
3717  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
3718  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
3719  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
3720    <emphasis role="strong">upgrade</emphasis> but also for
3721    <emphasis role="strong">remove</emphasis> and
3722    <emphasis role="strong">purge</emphasis>.
3723  </para>  </para>
3724  <para>  <para>
3725  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
3726  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
3727  fixed and there perhaps are new features).  fixed and perhaps that there are new features).
3728  </para>  </para>
3729  <para>  <para>
3730  When the upgrade is necessarily intrusive (eg., config files scattered through  When the upgrade is necessarily intrusive (eg., config files scattered through
3731  various home directories with totally different structure), you may consider to  various home directories with totally different structure), you may
3732  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
3733  documentations required by the policy (<filename>README.Debian</filename> and  (e.g., disabling a service) and providing the proper documentation
3734  <filename>NEWS.Debian</filename>) as the last resort.  Don't bother user with  required by policy (<filename>README.Debian</filename> and
3735  the <command>debconf</command> note invoked from these <emphasis>maintainer  <filename>NEWS.Debian</filename>).  Don't bother the user with
3736  scripts</emphasis> for upgrades.  <command>debconf</command> notes invoked from these maintainer scripts
3737    for upgrades.
3738  </para>  </para>
3739  <para>  <para>
3740  The <systemitem role="package">ucf</systemitem> package provides  The <systemitem role="package">ucf</systemitem> package provides a
3741  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user  <emphasis>conffile-like</emphasis> handling infrastructure to preserve user
3742  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
3743  as ones managed by the <emphasis>maintainer scripts</emphasis>.  This should  as those managed by the maintainer scripts.  This should
3744  minimize issues associated with them.  minimize issues associated with them.
3745  </para>  </para>
3746  <para>  <para>
3747  These <emphasis>maintainer scripts</emphasis> are the Debian enhancements that  These maintainer scripts are among the Debian enhancements that
3748  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must  explain <emphasis role="strong">why people choose Debian</emphasis>.  You must
3749  be very careful not to annoy them with these.  be very careful not to turn them into a source of annoyance.
3750  </para>  </para>
3751  </section>  </section>
3752  <section id="todo"><title><filename>TODO</filename> file</title>  <section id="todo"><title><filename>TODO</filename></title>
3753  <para>  <para>
3754  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>  The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle>
3755  <manvolnum>1</manvolnum> </citerefentry> command installs this.  <manvolnum>1</manvolnum> </citerefentry> command installs this.
3756  </para>  </para>
3757  </section>  </section>
3758  <section id="watch"><title><filename>watch</filename> file</title>  <section id="watch"><title><filename>watch</filename></title>
3759  <para>  <para>
3760  The <filename>watch</filename> file format is documented in the <citerefentry>  The <filename>watch</filename> file format is documented in the <citerefentry>
3761  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
3762  manpage.  The <filename>watch</filename> file configures the  manpage.  The <filename>watch</filename> file configures the
3763  <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
3764  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
3765    <ulink url="&dehs;">Debian External Health Status (DEHS)</ulink> service.
3766  </para>  </para>
3767  <para>  <para>
3768  Here's what I put in it:  Here are its contents:
3769  </para>  </para>
3770  <screen>  <screen>
3771  # watch control file for uscan  # watch control file for uscan
# Line 3694  version=3 Line 3773  version=3
3773  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate  &sf-net;/gentoo/gentoo-(.+)\.tar\.gz debian uupdate
3774  </screen>  </screen>
3775  <para>  <para>
3776  Normally with this <filename>watch</filename> file, the URL at  Normally with a <filename>watch</filename> file, the URL at
3777  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of
3778  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
3779  after the final <literal>/</literal>) of these linked URLs are matched against  after the final <literal>/</literal>) of each linked URL is compared against
3780  Perl regular expression (see <citerefentry> <refentrytitle>perlre</refentrytitle>  the Perl regular expression pattern (see <citerefentry> <refentrytitle>perlre</refentrytitle>
3781  <manvolnum>1</manvolnum> </citerefentry>) pattern  <manvolnum>1</manvolnum> </citerefentry>)
3782  <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
3783  the greatest version number is downloaded and the <command>uupdate</command>  the greatest version number is downloaded and the <command>uupdate</command>
3784  program is run to create the updated source tree from them.  program is run to create an updated source tree.
3785  </para>  </para>
3786  <para>  <para>
3787  Although this is true for other sites, the SourceForge download service at  Although this is true for other sites, the SourceForge download service at
3788  <ulink url="&sf-net;"/> is an exception.  When the  <ulink url="&sf-net;"/> is an exception.  When the
3789  <filename>watch</filename> file has an URL matching with the Perl regexp  <filename>watch</filename> file has an URL matching the Perl regexp
3790  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program
3791  substitutes it with <literal>&qa-do;watch/sf.php/</literal> and  replaces it with <literal>&qa-do;watch/sf.php/</literal> and
3792  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
3793  a stable redirect service to the desired file for the  a stable redirect service to the desired file for any
3794  <filename>watch</filename> file having  <filename>watch</filename> pattern of the form
3795  <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>.
3796  This solves issues related to the periodically changing URL there.  This solves issues related to periodically changing SourceForge URLs.
3797  </para>  </para>
3798  </section>  </section>
3799  <section id="sourcef"><title><filename>source/format</filename> file</title>  <section id="sourcef"><title><filename>source/format</filename></title>
3800  <para>  <para>
3801  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
3802  line indicating the desired format for the source package (check <citerefentry>  line indicating the desired format for the source package (check <citerefentry>
# Line 3741  should say either: Line 3820  should say either:
3820  The newer <literal>3.0 (quilt)</literal> source format records modifications in  The newer <literal>3.0 (quilt)</literal> source format records modifications in
3821  a <command>quilt</command> patch series within  a <command>quilt</command> patch series within
3822  <filename>debian/patches</filename>.  Those changes are then automatically  <filename>debian/patches</filename>.  Those changes are then automatically
3823  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
3824  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
3825  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>  (quilt)</literal> and <literal>3.0 (native)</literal> source formats.  </para>
3826  </footnote> The Debian modifications are simply stored in a  </footnote> The Debian modifications are simply stored in a
3827  <filename>debian.tar.gz</filename> archive containing all files under the  <filename>debian.tar.gz</filename> archive containing all files under the
# Line 3759  When <command>dpkg-source</command> extr Line 3838  When <command>dpkg-source</command> extr
3838  the end of the extraction with the <literal>--skip-patches</literal> option.  the end of the extraction with the <literal>--skip-patches</literal> option.
3839  </para>  </para>
3840  </section>  </section>
3841  <section id="sourcel"><title><filename>source/local-options</filename> file</title>  <section id="sourcel"><title><filename>source/local-options</filename></title>
3842  <para>  <para>
3843  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
3844  create one branch (e.g.  <literal>upstream</literal>) tracking the upstream  create one branch (e.g.  <literal>upstream</literal>) tracking the upstream
# Line 3784  unapply-patches Line 3863  unapply-patches
3863  abort-on-upstream-changes  abort-on-upstream-changes
3864  </screen>  </screen>
3865  </section>  </section>
3866  <section id="sourceopt"><title><filename>source/options</filename> file</title>  <section id="sourceopt"><title><filename>source/options</filename></title>
3867  <para>  <para>
3868  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
3869  since they generate meaningless large patch files.  There are custom modules  since they generate meaningless large patch files.  There are custom modules
# Line 3799  You can provide a Perl regular expressio Line 3878  You can provide a Perl regular expressio
3878  creating the source package.  creating the source package.
3879  </para>  </para>
3880  <para>  <para>
3881  You can store such <command>dpkg-source</command> option argument in the  As a general solution to address this problem of the autogenerated files,
3882  <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
3883  solution to address this problem of the autogenerated files.  The following  <filename>source/options</filename> file of the source package.  The following
3884  will skip creating patch files for <filename>config.sub</filename>,  will skip creating patch files for <filename>config.sub</filename>,
3885  <filename>config.guess</filename> and <filename>Makefile</filename>.  <filename>config.guess</filename>, and <filename>Makefile</filename>.
3886  </para>  </para>
3887  <screen>  <screen>
3888  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"  extend-diff-ignore = "(^|/)(config\.sub|config\.guess|Makefile)$"
3889  </screen>  </screen>
3890  </section>  </section>
3891  <section id="patches"><title><filename>patches/*</filename> files</title>  <section id="patches"><title><filename>patches/*</filename></title>
3892  <para>  <para>
3893  The old <literal>1.0</literal> source format created a single large  The old <literal>1.0</literal> source format created a single large
3894  <filename>diff.gz</filename> file which contains package maintenance files in  <filename>diff.gz</filename> file containing package maintenance files in
3895  <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
3896  bit cumbersome to inspect and understand for each source tree modification  bit cumbersome to inspect and understand for each source tree modification
3897  later.  This is not so nice.  later.  This is not so nice.
3898  </para>  </para>
3899  <para>  <para>
3900  The newer <literal>3.0 (quilt)</literal> source format stores patches in  The newer <literal>3.0 (quilt)</literal> source format stores patches in
3901  <filename>debian/patches/*</filename> files using the <command>quilt</command>  <filename>debian/patches/*</filename> files using the <command>quilt</command>
3902  command.  These patches and other package data which are all constrained under  command.  These patches and other package data which are all contained under
3903  the <filename>debian</filename> directory are packaged as the  the <filename>debian</filename> directory are packaged as the
3904  <filename>debian.tar.gz</filename> file.  Since the  <filename>debian.tar.gz</filename> file.  Since the
3905  <command>dpkg-source</command> command can handle <command>quilt</command>  <command>dpkg-source</command> command can handle <command>quilt</command>
3906  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
3907  <systemitem role="package">quilt</systemitem> package, it does not need to  <systemitem role="package">quilt</systemitem> package, it does not need a
3908  <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>.
3909  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
3910  packages.  The <command>quilt</command> system is the preferred maintenance  packages.  The <command>quilt</command> system is the preferred maintenance
3911  system in use.  Other ones are <command>dpatch</command>,  system in use.  Others include <command>dpatch</command>,
3912  <command>dbs</command>, <command>cdbs</command>, etc.  Many of these keep such  <command>dbs</command>, and <command>cdbs</command>.  Many of these keep such
3913  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>  patches as <filename>debian/patches/*</filename> files.  </para> </footnote>
3914  </para>  </para>
3915  <para>  <para>
# Line 3839  The <command>quilt</command> command is Line 3918  The <command>quilt</command> command is
3918  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>
3919  patch files in the <filename>debian/patches</filename> directory and the source  patch files in the <filename>debian/patches</filename> directory and the source
3920  tree is untouched outside of the <filename>debian</filename> directory.  The  tree is untouched outside of the <filename>debian</filename> directory.  The
3921  order of these patches are recorded in the  order of these patches is recorded in the
3922  <filename>debian/patches/series</filename> file.  You can apply (=push),  <filename>debian/patches/series</filename> file.  You can apply (=push),
3923  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are  un-apply (=pop), and refresh patches easily.  <footnote><para> If you are
3924  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
3925  documentation of your changes are very important to expedite the package review  documentation of your changes is very important to expedite the package review
3926  by your sponsor.  </para> </footnote>  by your sponsor.  </para> </footnote>
3927  </para>  </para>
3928  <para>  <para>
3929  For <xref linkend="modify"/>, we created 3 patches in  For <xref linkend="modify"/>, we created three patches in
3930  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
3931  </para>  </para>
3932  <para>  <para>
3933  Since Debian patches are located in <filename>debian/patches</filename>, please  Since Debian patches are located in <filename>debian/patches</filename>, please
3934  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
3935  in <xref linkend="quiltrc"/>.  in <xref linkend="quiltrc"/>.
3936  </para>  </para>
3937  <para>  <para>
3938  When someone (including yourself) provides you with a patch  When anyone (including yourself) provides a patch
3939  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,  <filename><replaceable>foo</replaceable>.patch</filename> to the source later,
3940  then the modification of a <literal>3.0 (quilt)</literal> source package is  modifying a <literal>3.0 (quilt)</literal> source package is
3941  quite simple:  quite simple:
3942  </para>  </para>
3943  <screen>  <screen>
# Line 3872  $ dquilt header -e Line 3951  $ dquilt header -e
3951  </screen>  </screen>
3952  <para>  <para>
3953  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
3954  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
3955  pop -a; while dquilt push; do dquilt refresh; done</literal>.  pop -a; while dquilt push; do dquilt refresh; done</literal>.
3956  </para>  </para>
3957  </section>  </section>
# Line 3883  We should now be ready to build the pack Line 3962  We should now be ready to build the pack
3962  </para>  </para>
3963  <section id="completebuild"><title>Complete (re)build</title>  <section id="completebuild"><title>Complete (re)build</title>
3964  <para>  <para>
3965  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
3966  to install  need to make sure you have installed
3967  </para>  </para>
3968  <itemizedlist>  <itemizedlist>
3969  <listitem>  <listitem>
# Line 3957  Debian archives.  See Line 4036  Debian archives.  See
4036  <ulink url="&keycreate;">Creating a new GPG key</ulink> and  <ulink url="&keycreate;">Creating a new GPG key</ulink> and
4037  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
4038  </para></footnote>  </para></footnote>
4039    If you are building Debian packages only for your own local use, you can skip
4040    promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4041    <filename>.changes</filename> file like this:
4042  </para>  </para>
4043    <screen>
4044    $ dpkg-buildpackage -us -uc
4045    </screen>
4046  <para>  <para>
4047  After all this is done, you will see the following files in the directory above  For a non-native Debian package, e.g.,
4048  (<filename>~/gentoo</filename>):  <systemitem role="package">gentoo</systemitem>, you will see the following
4049    files in the parent directory (<filename>~/gentoo</filename>) after building
4050    packages:
4051  </para>  </para>
4052  <itemizedlist>  <itemizedlist>
4053  <listitem>  <listitem>
# Line 3968  After all this is done, you will see the Line 4055  After all this is done, you will see the
4055  <filename>gentoo_0.9.12.orig.tar.gz</filename>  <filename>gentoo_0.9.12.orig.tar.gz</filename>
4056  </para>  </para>
4057  <para>  <para>
4058  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
4059  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
4060  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.  <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.
4061  </para>  </para>
# Line 3991  people can be sure that it's really your Line 4078  people can be sure that it's really your
4078  </para>  </para>
4079  <para>  <para>
4080  This compressed tarball contains your <filename>debian</filename> directory  This compressed tarball contains your <filename>debian</filename> directory
4081  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
4082  stored as <command>quilt</command> patches in  stored as a <command>quilt</command> patch in
4083  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
4084  </para>  </para>
4085  <para>  <para>
# Line 4020  install and remove this just like any ot Line 4107  install and remove this just like any ot
4107  <filename>gentoo_0.9.12-1_i386.changes</filename>  <filename>gentoo_0.9.12-1_i386.changes</filename>
4108  </para>  </para>
4109  <para>  <para>
4110  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;
4111  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
4112  and source packages in it.  It is partly generated from the  and source packages.  It is partly generated from the
4113  <filename>changelog</filename> file and the <filename>.dsc</filename> file.  <filename>changelog</filename> file and the <filename>.dsc</filename> file.
4114  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.
4115  </para>  </para>
4116  <para>  <para>
4117  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
4118  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
4119  see what has changed.  Debian archive maintenance programs will also post the  see what has changed.  Debian archive maintenance programs will also post the
4120  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 4037  mailing list. Line 4124  mailing list.
4124  </itemizedlist>  </itemizedlist>
4125  <para>  <para>
4126  The long strings of numbers in the <filename>.dsc</filename> and  The long strings of numbers in the <filename>.dsc</filename> and
4127  <filename>.changes</filename> files are MD5/SHA1/SHA256 checksums for the files  <filename>.changes</filename> files are SHA1/SHA256 checksums for the files
4128  mentioned.  A person downloading your files can test them with <citerefentry>  mentioned.  Anyone downloading your files can test them with <citerefentry>
4129  <refentrytitle>md5sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>
4130  <citerefentry> <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum>  </citerefentry> or <citerefentry> <refentrytitle>sha256sum</refentrytitle>
 </citerefentry>, or <citerefentry> <refentrytitle>sha256sum</refentrytitle>  
4131  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,
4132  they'll know the file is corrupt or has been tampered with.  they'll know the file is corrupt or has been tampered with.
4133  </para>  </para>
4134    <para>
4135    For a native Debian package, e.g.,
4136    <systemitem role="package">mypackage</systemitem>, you will see the following
4137    files in the parent directory after building packages:
4138    </para>
4139    <itemizedlist>
4140    <listitem>
4141    <para>
4142    <filename>mypackage_1.0.tar.gz</filename>
4143    </para>
4144    <para>
4145    This is the source code tarball created from the
4146    <filename>mypackage-1.0</filename> directory by the
4147    <command>dpkg-source</command> command.  (Its suffix is not <filename>orig.tar.gz</filename>.)
4148    </para>
4149    </listitem>
4150    <listitem>
4151    <para>
4152    <filename>mypackage_1.0.dsc</filename>
4153    </para>
4154    <para>
4155    This is a summary of the contents of the source code as in the non-native
4156    Debian package. (There is no Debian revision.)
4157    </para>
4158    </listitem>
4159    <listitem>
4160    <para>
4161    <filename>mypackage_1.0_i386.deb</filename>
4162    </para>
4163    <para>
4164    This is your completed binary package as in the non-native Debian package.
4165    (There is no Debian revision.)
4166    </para>
4167    </listitem>
4168    <listitem>
4169    <para>
4170    <filename>mypackage_1.0_i386.changes</filename>
4171    </para>
4172    <para>
4173    This file describes all the changes made in the current package version as in
4174    the non-native Debian package. (There is no Debian revision.)
4175    </para>
4176    </listitem>
4177    </itemizedlist>
4178  </section>  </section>
4179  <section id="autobuilder"><title>Autobuilder</title>  <section id="autobuilder"><title>Autobuilder</title>
4180  <para>  <para>
4181  Debian supports many <ulink url="&ports;">ports</ulink>  Debian supports many <ulink url="&ports;">ports</ulink>
4182  with the <ulink url="&buildd;">autobuilder  with the <ulink url="&buildd;">autobuilder
4183  network</ulink> running <command>buildd</command> daemons on many different  network</ulink> running <command>buildd</command> daemons on computers
4184  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
4185  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
4186  how your packages are rebuild for many different architectures by them.  how they rebuild your packages for multiple architectures.
4187  <footnote><para> The actual autobuilder system involves much more complicated  <footnote><para> The actual autobuilder system involves much more complicated
4188  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
4189  this document.  </para> </footnote>  this document.  </para> </footnote>
4190  </para>  </para>
4191  <para>  <para>
4192  For <literal>Architecture: any</literal> packages, the autobuilder system  For <literal>Architecture: any</literal> packages, the autobuilder system
4193  rebuild them.  It ensures to install  performs a rebuild.  It ensures the installation of
4194  </para>  </para>
4195  <itemizedlist>  <itemizedlist>
4196  <listitem>  <listitem>
# Line 4117  create and sign the upload <filename>.ch Line 4247  create and sign the upload <filename>.ch
4247  This is why you see your package for other architectures.  This is why you see your package for other architectures.
4248  </para>  </para>
4249  <para>  <para>
4250  Although packages listed in the <literal>Build-Depends-indep</literal> field  Although packages listed in the <literal>Build-Depends-Indep</literal> field
4251  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
4252  autobuilder system since it build only architecture dependent binary packages.  <xref linkend="completebuild"/>), they are not required to be installed for the
4253    autobuilder system since it builds only architecture dependent binary packages.
4254  <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>
4255  environment under the <systemitem role="package">sbuild</systemitem> package  environment under the <systemitem role="package">sbuild</systemitem> package
4256  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
4257  many packages installed.  </para> </footnote> This difference between normal  system and may have many leftover packages installed.  </para>
4258  packaging and autobuilder situation dictates whether you record such required  </footnote> This distinction between normal packaging and autobuilding
4259    procedures is what dictates whether you should record such required
4260  packages in the <literal>Build-Depends</literal> or  packages in the <literal>Build-Depends</literal> or
4261  <literal>Build-Depends-indep</literal> fields of the  <literal>Build-Depends-Indep</literal> fields of the
4262  <filename>debian/control</filename> file (see <xref linkend="control"/>).  <filename>debian/control</filename> file (see <xref linkend="control"/>).
4263  </para>  </para>
4264  </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>  
4265  <section id="debuild"><title><command>debuild</command> command</title>  <section id="debuild"><title><command>debuild</command> command</title>
4266  <para>  <para>
4267  You can automate package build process of the  You can automate the <command>dpkg-buildpackage</command> command's
4268  <command>dpkg-buildpackage</command> command further with the  package build process further with the
4269  <command>debuild</command> command.  See <citerefentry>  <command>debuild</command> command.  See <citerefentry>
4270  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum>
4271  </citerefentry>.  </citerefentry>.
# Line 4152  You can automate package build process o Line 4273  You can automate package build process o
4273  <para>  <para>
4274  Customization of the <command>debuild</command> command can be done through  Customization of the <command>debuild</command> command can be done through
4275  <filename>/etc/devscripts.conf</filename> or  <filename>/etc/devscripts.conf</filename> or
4276  <filename>~/.devscripts</filename>.  I would suggest at least following items:  <filename>~/.devscripts</filename>.  I would suggest at least the following items:
4277  </para>  </para>
4278  <screen>  <screen>
4279  DEBSIGN_KEYID=Your_GPG_keyID  DEBSIGN_KEYID=Your_GPG_keyID
 DEBUILD_LINTIAN=yes  
4280  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides  DEBUILD_LINTIAN_OPTS=-i -I --show-overrides
4281  </screen>  </screen>
4282  <para>  <para>
4283  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
4284  sponsoring packages) and checked by the <command>lintian</command> command in  sponsoring packages) and checked in detail by the <command>lintian</command> command.
 details.  
4285  </para>  </para>
4286  <para>  <para>
4287  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:
4288  </para>  </para>
4289  <screen>  <screen>
4290  $ debuild  $ debuild
4291  </screen>  </screen>
4292  <para>  <para>
4293  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your own local use, you can skip
4294  <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
4295  source can be specified as:  <filename>.changes</filename> file like this:
4296  </para>  </para>
4297  <screen>  <screen>
4298  $ debuild -sa  $ debuild -us -uc
4299  </screen>  </screen>
4300  <para>  <para>
4301  You can clean source tree as simple as:  You can clean the source tree as simply as:
4302  </para>  </para>
4303  <screen>  <screen>
4304  $ debuild clean  $ debuild clean
# Line 4189  $ debuild clean Line 4308  $ debuild clean
4308  <para>  <para>
4309  For a clean room (<command>chroot</command>) build environment to verify the  For a clean room (<command>chroot</command>) build environment to verify the
4310  build dependencies, the <systemitem role="package">pbuilder</systemitem>  build dependencies, the <systemitem role="package">pbuilder</systemitem>
4311  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
4312    role="package">pbuilder</systemitem> package is still evolving, you should
4313  check the actual configuration situation by consulting the latest official  check the actual configuration situation by consulting the latest official
4314  documentation.</para> </footnote> This ensures a clean build from the source  documentation.</para> </footnote> This ensures a clean build from the source
4315  under the <literal>sid</literal> auto-builder for different architectures and  under the <literal>sid</literal> auto-builder for different architectures and
4316  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
4317  always in the RC (release critical) category.  always in the RC (release critical) category.
4318  <footnote><para>See <ulink url="&buildd-do;"/> for more on the  <footnote><para>See <ulink url="&buildd-do;"/> for more on
4319  auto-builder of the Debian package.</para></footnote>  Debian package auto-building.</para></footnote>
4320  </para>  </para>
4321  <para>  <para>
4322  Let's customize the <systemitem role="package">pbuilder</systemitem> package by  Let's customize the <systemitem role="package">pbuilder</systemitem> package as
4323  the following.  follows:
4324  </para>  </para>
4325  <itemizedlist>  <itemizedlist>
4326  <listitem>  <listitem>
4327  <para>  <para>
4328  setting <filename>/var/cache/pbuilder/result</filename> directory writable by  setting the <filename>/var/cache/pbuilder/result</filename> directory writable by
4329  the user.  for your user account.
4330  </para>  </para>
4331  </listitem>  </listitem>
4332  <listitem>  <listitem>
4333  <para>  <para>
4334  creating a directory, e.g.  creating a directory, e.g.
4335  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>,
4336  writable by the user to place hook scripts.  writable by the user, to place hook scripts in.
4337  </para>  </para>
4338  </listitem>  </listitem>
4339  <listitem>  <listitem>
4340  <para>  <para>
4341  setting <filename>~/.pbuilderrc</filename> or  configuring <filename>~/.pbuilderrc</filename> or
4342  <filename>/etc/pbuilderrc</filename> to include as follows.  <filename>/etc/pbuilderrc</filename> to include the followsing.
4343  </para>  </para>
4344  <screen>  <screen>
4345  AUTO_DEBSIGN=yes  AUTO_DEBSIGN=${AUTO_DEBSIGN:-yes}
4346  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>
4347  </screen>  </screen>
4348  </listitem>  </listitem>
# Line 4232  This will allow you to sign generated pa Line 4352  This will allow you to sign generated pa
4352  <filename>~/.gnupg/</filename> directory.  <filename>~/.gnupg/</filename> directory.
4353  </para>  </para>
4354  <para>  <para>
4355  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
4356  follows.  follows.
4357  </para>  </para>
4358  <screen>  <screen>
4359  $ sudo pbuilder create  $ sudo pbuilder create
4360  </screen>  </screen>
4361  <para>  <para>
4362  If you already have the completed source packages, issue the following commands  If you already have a completed source package, issue the following commands
4363  in the directory where the  in the directory where the
4364  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,  <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>,
4365  <filename><replaceable>foo</replaceable>.debian.tar.gz</filename>, and  <filename><replaceable>foo</replaceable>.debian.tar.gz</filename>, and
# Line 4249  the local <systemitem role="package">pbu Line 4369  the local <systemitem role="package">pbu
4369  </para>  </para>
4370  <screen>  <screen>
4371  $ sudo pbuilder --update  $ sudo pbuilder --update
4372  $ sudo pbuilder --build <replaceable>foo</replaceable>.dsc  $ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc
4373  </screen>  </screen>
4374  <para>  <para>
4375  Please note that the <command>dpkg-buildpackage</command> option  The newly built packages without the GPG signatures will be located in
4376  <literal>-sa</literal> to include the original <filename>orig.tar.gz</filename>  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.
4377  source can be specified as:  </para>
4378    <para>
4379    The GPG signatures on the <filename>.dsc</filename> file and the
4380    <filename>.changes</filename> file can be generated as:
4381  </para>  </para>
4382  <screen>  <screen>
4383  $ sudo pbuilder --build --debbuildopts -sa <replaceable>foo</replaceable>.dsc  $ cd /var/cache/pbuilder/result/
4384    $ debsign <replaceable>foo_version</replaceable>.dsc
4385    $ debsign <replaceable>foo_version_arch</replaceable>.changes
4386  </screen>  </screen>
4387  <para>  <para>
4388  The newly built packages will be located in  If you have an updated source tree but have not generated the matching
4389  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.  source package, issue the following commands in the source directory where the
 </para>  
 <para>  
 If you already have the updated source tree without generating the matching  
 source packages, issue the following commands in the source directory where the  
4390  <filename>debian</filename> directory exists, instead.  <filename>debian</filename> directory exists, instead.
4391  </para>  </para>
4392  <screen>  <screen>
# Line 4273  $ sudo pbuilder --update Line 4394  $ sudo pbuilder --update
4394  $ pdebuild  $ pdebuild
4395  </screen>  </screen>
4396  <para>  <para>
4397  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4398  <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
4399  source can be specified as:  <filename>.changes</filename> file as:
4400  </para>  </para>
4401  <screen>  <screen>
4402  $ pdebuild --debbuildopts -sa  $ AUTO_DEBSIGN=no pdebuild
4403  </screen>  </screen>
4404  <para>  <para>
4405  You can log into its <command>chroot</command> environment with the  You can log into its <command>chroot</command> environment with the
# Line 4292  the <literal>chroot</literal> environmen Line 4413  the <literal>chroot</literal> environmen
4413  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename>
4414  configured as follows.  <footnote><para> This assumes  configured as follows.  <footnote><para> This assumes
4415  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many  <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many
4416  examples of the hook script in the  examples of hook scripts in the
4417  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>  <filename>/usr/share/doc/pbuilder/examples</filename> directory.  </para>
4418  </footnote>  </footnote>
4419  </para>  </para>
# Line 4311  echo +++ end of lintian output +++ Line 4432  echo +++ end of lintian output +++
4432  </screen>  </screen>
4433  <para>  <para>
4434  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
4435  build packages properly for <literal>sid</literal>.  In reality,  build packages properly for <literal>sid</literal>.  In practice,
4436  <literal>sid</literal> may be experiencing issues which makes it not desirable  <literal>sid</literal> may be experiencing issues which makes it undesirable
4437  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
4438  kind of situation.  kind of situation.
4439  </para>  </para>
# Line 4321  You may need to update your <literal>sta Line 4442  You may need to update your <literal>sta
4442  release for <literal>stable-proposed-updates</literal>,  release for <literal>stable-proposed-updates</literal>,
4443  <literal>stable/updates</literal>, etc.  <footnote><para> There are some  <literal>stable/updates</literal>, etc.  <footnote><para> There are some
4444  restrictions for such updates of your <literal>stable</literal> package.  restrictions for such updates of your <literal>stable</literal> package.
4445  </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>
4446  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
4447  environments of almost any Debian derivative distributions of the same CPU  environments of almost any Debian derivative distribution of the same
4448  architecture.  architecture.
4449  </para>  </para>
4450  <para>  <para>
# Line 4337  See <ulink url="&pbuilder;"/>, Line 4458  See <ulink url="&pbuilder;"/>,
4458  </section>  </section>
4459  <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>
4460  <para>  <para>
4461  If your upstream uses the source code management system (VCS)  If your upstream uses a source code management system (VCS)
4462  <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>
4463  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
4464  and cherry-picking upstream patches much easier.  There are several specialized  and cherry-picking upstream patches much easier.  There are several specialized
4465  wrapper script packages for the Debian package building for each VCS.  wrapper script packages for Debian package building for each VCS.
4466  </para>  </para>
4467  <itemizedlist>  <itemizedlist>
4468  <listitem>  <listitem>
4469  <para>  <para>
4470  <systemitem role="package">git-buildpackage</systemitem>: Suite to help with  <systemitem role="package">git-buildpackage</systemitem>: a suite to help with
4471  Debian packages in Git repositories.  Debian packages in Git repositories.
4472  </para>  </para>
4473  </listitem>  </listitem>
# Line 4358  maintain Debian packages with Subversion Line 4479  maintain Debian packages with Subversion
4479  </listitem>  </listitem>
4480  <listitem>  <listitem>
4481  <para>  <para>
4482  <systemitem role="package">cvs-buildpackage</systemitem>: A set of Debian  <systemitem role="package">cvs-buildpackage</systemitem>: a set of Debian
4483  package scripts for CVS source trees.  package scripts for CVS source trees.
4484  </para>  </para>
4485  </listitem>  </listitem>
4486  </itemizedlist>  </itemizedlist>
4487  <para>  <para>
4488  There are packages which <emphasis>automate</emphasis> building of packages  For advanced audiences, there are packages which <emphasis>automate</emphasis>
4489  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
4490  in this tutorial.  in this tutorial.
4491  <footnote><para> Here are few web resources available for advanced audiences.  </para>  <footnote><para> Here are some web resources available for advanced audiences.  </para>
4492  <itemizedlist>  <itemizedlist>
4493  <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>
4494  <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>
4495  <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>
4496  <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>
4497  <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 4381  in this tutorial. Line 4502  in this tutorial.
4502  <section id="quickrebuild"><title>Quick rebuild</title>  <section id="quickrebuild"><title>Quick rebuild</title>
4503  <para>  <para>
4504  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
4505  you tune details in <filename>debian/rules</filename>.  For testing purposes,  you're tuning details in <filename>debian/rules</filename>.  For testing purposes,
4506  you can make a <filename>.deb</filename> file without rebuilding the upstream  you can make a <filename>.deb</filename> file without rebuilding the upstream
4507  sources like this <footnote><para> Environment variables which are normally  sources like this<footnote><para> Environment variables which are normally
4508  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
4509  packages to be uploaded using this <emphasis role="strong">quick</emphasis>  packages to be uploaded using this <emphasis role="strong">quick</emphasis>
4510  method.  </para> </footnote>:  method.  </para> </footnote>:
# Line 4392  method.  </para> </footnote>: Line 4513  method.  </para> </footnote>:
4513  $ fakeroot debian/rules binary  $ fakeroot debian/rules binary
4514  </screen>  </screen>
4515  <para>  <para>
4516  Or, simply as following to see if it build or not.  Or simply do the following to see if it builds or not:
4517  </para>  </para>
4518  <screen>  <screen>
4519  $ fakeroot debian/rules build  $ fakeroot debian/rules build
# Line 4406  proper procedure.  You may not be able t Line 4527  proper procedure.  You may not be able t
4527  </chapter>  </chapter>
4528  <chapter id="checkit"><title>Checking the package for errors</title>  <chapter id="checkit"><title>Checking the package for errors</title>
4529  <para>  <para>
4530  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
4531  yourself before uploading packages to public archives.  before uploading it to the public archives.
4532  </para>  </para>
4533  <para>  <para>
4534  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
4535  closely for any warnings or errors for all the test described here.  closely for any warnings or errors for all the tests described here.
4536  </para>  </para>
4537  <section id="pinstall"><title>Verifying package for install</title>  <section id="inadvent"><title>Suspicious changes</title>
4538  <para>  <para>
4539  You must test your package if it installs without problem.  The <citerefentry>  If you find a new autogenerated patch file such as
4540    <filename>debian-changes-*</filename> in the
4541    <filename>debian/patches</filename> directory after building your non-native
4542    Debian package in <literal>3.0 (quilt)</literal> format, chances are you
4543    changed some files by accident or the build script modified the upstream
4544    source.  If it is your mistake, fix it.  If it is caused by the build script,
4545    fix the root cause with <command>dh-autoreconf</command> as in
4546    <xref linkend="customrules"/> or work around it with
4547    <filename>source/options</filename> as in <xref linkend="sourceopt"/>.
4548    </para>
4549    </section>
4550    <section id="pinstall"><title>Verifying a package's installation</title>
4551    <para>
4552    You must test your package for whether it installs without problem.  The <citerefentry>
4553  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4554  command helps you to test to install all the generated binary packages.  command helps you to test installing all the generated binary packages.
4555  </para>  </para>
4556  <screen>  <screen>
4557  $ sudo debi gentoo_0.9.12-1_i386.changes  $ sudo debi gentoo_0.9.12-1_i386.changes
4558  </screen>  </screen>
4559  <para>  <para>
4560  You have to make sure that there are no overlapped files with other existing  To prevent installation problem on different systems, you must make
4561  packages using the  sure that there are no filenames conflicting with other existing packages,
4562    using the
4563  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded
4564  from the Debian archive to prevent installation problem on different systems.  from the Debian archive,
4565  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
4566  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
4567  alternatives mechanism (see <citerefentry>  renaming the file, moving a common file to a separate package that
4568  <refentrytitle>update-alternatives</refentrytitle> <manvolnum>1</manvolnum>  multiple packages can depend on, using the alternatives mechanism (see
4569  </citerefentry>) by coordinating with other affected packages or by setting the  <citerefentry><refentrytitle>update-alternatives</refentrytitle>
4570  <literal>Conflicts</literal> entry in the <filename>debian/control</filename>  <manvolnum>1</manvolnum></citerefentry>) in coordination with the
4571  file.  maintainers of other affected packages, or declaring a
4572    <literal>Conflicts</literal> relationship in the
4573    <filename>debian/control</filename> file.
4574  </para>  </para>
4575  </section>  </section>
4576  <section id="pmaintscripts"><title>Verifying package for <emphasis>maintainer scripts</emphasis></title>  <section id="pmaintscripts"><title>Verifying a package's maintainer scripts</title>
4577  <para>  <para>
4578  All <emphasis>maintainer scripts</emphasis>, i.e.,  All maintainer scripts (that is,
4579  <filename>preinst</filename>, <filename>prerm</filename>,  <filename>preinst</filename>, <filename>prerm</filename>,
4580  <filename>postinst</filename>, and <filename>postrm</filename> files, are  <filename>postinst</filename>, and <filename>postrm</filename> files) are
4581  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
4582    <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are
4583  a novice maintainer (see <xref linkend="maintscripts"/>).  a novice maintainer (see <xref linkend="maintscripts"/>).
4584  </para>  </para>
4585  <para>  <para>
4586  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,
4587  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  
4588  when packages are removed or purged.  Use the <command>dpkg</command> command  when packages are removed or purged.  Use the <command>dpkg</command> command
4589  as follows to test them.  as follows to test them.
4590  </para>  </para>
# Line 4511  people will often be upgrading to your p Line 4648  people will often be upgrading to your p
4648  last Debian release.  Remember to test upgrades from that version too.  last Debian release.  Remember to test upgrades from that version too.
4649  </para>  </para>
4650  <para>  <para>
4651  Although downgrade is not officially supported, it should be nice to support  Although downgrading is not officially supported, supporting it is a
4652  it.  friendly gesture.
4653  </para>  </para>
4654  </section>  </section>
4655  <section id="lintians"><title><systemitem role="package">lintian</systemitem> package</title>  <section id="lintians"><title>Using <systemitem role="package">lintian</systemitem></title>
4656  <para>  <para>
4657  Run <citerefentry> <refentrytitle>lintian</refentrytitle>  Run <citerefentry> <refentrytitle>lintian</refentrytitle>
4658  <manvolnum>1</manvolnum> </citerefentry> on your <filename>.changes</filename>  <manvolnum>1</manvolnum> </citerefentry> on your <filename>.changes</filename>
# Line 4532  $ lintian -i -I --show-overrides gentoo_ Line 4669  $ lintian -i -I --show-overrides gentoo_
4669  <para>  <para>
4670  Of course, replace the filename with the name of the  Of course, replace the filename with the name of the
4671  <filename>.changes</filename> file generated for your package.  The output of  <filename>.changes</filename> file generated for your package.  The output of
4672  the <command>lintian</command> command are marked as follows.  the <command>lintian</command> command uses the following flags.
4673  </para>  </para>
4674  <itemizedlist>  <itemizedlist>
4675  <listitem>  <listitem>
4676  <para>  <para>
4677  <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.
4678  </para>  </para>
4679  </listitem>  </listitem>
4680  <listitem>  <listitem>
4681  <para>  <para>
4682  <literal>W:</literal> for warning; a possible policy violation or a packaging  <literal>W:</literal> for warning; a possible policy violation or packaging
4683  error.  error.
4684  </para>  </para>
4685  </listitem>  </listitem>
4686  <listitem>  <listitem>
4687  <para>  <para>
4688  <literal>I:</literal> for info; a information on certain packaging aspects.  <literal>I:</literal> for info; information on certain aspects of packaging.
4689  </para>  </para>
4690  </listitem>  </listitem>
4691  <listitem>  <listitem>
# Line 4565  error. Line 4702  error.
4702  </listitem>  </listitem>
4703  </itemizedlist>  </itemizedlist>
4704  <para>  <para>
4705  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
4706  spurious.  If spurious, set the <filename>lintian-overrides</filename> files as  spurious.  If spurious, set up <filename>lintian-overrides</filename> files as
4707  described in <xref linkend="lintian"/>.  described in <xref linkend="lintian"/>.
4708  </para>  </para>
4709  <para>  <para>
4710  Note that you can build the package with <command>dpkg-buildpackage</command>  Note that you can build the package with <command>dpkg-buildpackage</command>
4711  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>
4712  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4713  or with <citerefentry> <refentrytitle>pdebuild</refentrytitle>  or <citerefentry> <refentrytitle>pdebuild</refentrytitle>
4714  <manvolnum>1</manvolnum> </citerefentry>.  <manvolnum>1</manvolnum> </citerefentry>.
4715  </para>  </para>
4716  </section>  </section>
4717  <section id="debc"><title><command>debc</command> command</title>  <section id="debc"><title>The <command>debc</command> command</title>
4718  <para>  <para>
4719  You can list files in the binary Debian package by <citerefentry>  You can list files in the binary Debian package with the <citerefentry>
4720  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>
4721  command.  command.
4722  </para>  </para>
# Line 4587  command. Line 4724  command.
4724  $ debc <replaceable>package</replaceable>.changes  $ debc <replaceable>package</replaceable>.changes
4725  </screen>  </screen>
4726  </section>  </section>
4727  <section id="debdiff"><title><command>debdiff</command> command</title>  <section id="debdiff"><title>The <command>debdiff</command> command</title>
4728  <para>  <para>
4729  You can compare file contents in two source Debian packages with the  You can compare file contents in two source Debian packages with the
4730  <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum>
# Line 4605  You can also compare file lists in two s Line 4742  You can also compare file lists in two s
4742  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes  $ debdiff <replaceable>old-package</replaceable>.changes <replaceable>new-package</replaceable>.changes
4743  </screen>  </screen>
4744  <para>  <para>
4745  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
4746  no files have been unintentionally misplaced or removed in the binary packages,  and to check for inadvertent changes made when updating binary
4747  and if no other inadvertent changes were made when updating binary packages.  packages, such as unintentionally misplacing or removing files.
4748  </para>  </para>
4749  </section>  </section>
4750  <section id="interdiff"><title><command>interdiff</command> command</title>  <section id="interdiff"><title>The <command>interdiff</command> command</title>
4751  <para>  <para>
4752  You can compare two <filename>diff.gz</filename> files with the <citerefentry>  You can compare two <filename>diff.gz</filename> files with the <citerefentry>
4753  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum>
# Line 4627  files as described in <xref linkend="pat Line 4764  files as described in <xref linkend="pat
4764  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.  <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.
4765  </para>  </para>
4766  </section>  </section>
4767  <section id="mc"><title><command>mc</command> command</title>  <section id="mc"><title>The <command>mc</command> command</title>
4768  <para>  <para>
4769  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
4770  by using a file manager like <citerefentry> <refentrytitle>mc</refentrytitle>  by using a file manager like <citerefentry> <refentrytitle>mc</refentrytitle>
# Line 4639  contents of <filename>*.deb</filename> p Line 4776  contents of <filename>*.deb</filename> p
4776  <para>  <para>
4777  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
4778  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
4779  your <filename>rules</filename> file to compensate for that.  your <filename>rules</filename> file to compensate for this.
4780  </para>  </para>
4781  </section>  </section>
4782  </chapter>  </chapter>
# Line 4652  a public archive to share it. Line 4789  a public archive to share it.
4789  <para>  <para>
4790  Once you become an official developer,  Once you become an official developer,
4791  <footnote><para>  <footnote><para>
4792  See <xref linkend="socialdynamism"/>.  See <xref linkend="socialdynamics"/>.
4793  </para></footnote>  </para></footnote>
4794  you can upload the package to the Debian archive.  you can upload the package to the Debian archive.
4795  <footnote><para>  <footnote><para>
4796  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>  There are publicly accessible archives such as <ulink url="&mentors-dn;"/>
4797  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
4798  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
4799  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
4800  non-DD, too.  non-DDs, too.
4801  </para></footnote>  </para></footnote>
4802  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
4803  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>
# Line 4668  automated tools, like <citerefentry> <re Line 4805  automated tools, like <citerefentry> <re
4805  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
4806  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>
4807  The <systemitem role="package">dput</systemitem> package seems to come with  The <systemitem role="package">dput</systemitem> package seems to come with
4808  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
4809  <filename>/etc/dput</filename> file for the global configuration and the  file <filename>/etc/dput</filename> for its global configuration and the
4810  <filename>~/.dput.cf</filename> file for the per-user one.  It supports Ubuntu  file <filename>~/.dput.cf</filename> for per-user configuration.  It supports
4811  related services out-of-box, too.  </para> </footnote>  Ubuntu-related services out-of-the-box, too.  </para> </footnote>
4812  </para>  </para>
4813  <para>  <para>
4814  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 4691  primary one, but it's possible that you Line 4828  primary one, but it's possible that you
4828  <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>
4829  </para>  </para>
4830  <para>  <para>
4831  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:
4832  </para>  </para>
4833  <screen>  <screen>
4834  $ dupload gentoo_0.9.12-1_i386.changes  $ dupload gentoo_0.9.12-1_i386.changes
4835  </screen>  </screen>
4836  <para>  <para>
4837  <command>dupload</command> checks that the MD5/SHA1/SHA256 checksums of the  <command>dupload</command> checks that the SHA1/SHA256 file checksums
4838  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
4839  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.
4840  </para>  </para>
4841  <!--  <!--
# Line 4708  will ask for your password on Debian mac Line 4845  will ask for your password on Debian mac
4845  -->  -->
4846  <para>  <para>
4847  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
4848  by manually uploading GPG signed <filename>*.commands</filename> file to there  by manually uploading a GPG-signed <filename>*.commands</filename> file to there
4849  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
4850  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
4851    role="package">dput</systemitem> package.  </para> </footnote> For example, using
4852  <filename>hello.commands</filename>:  <filename>hello.commands</filename>:
4853  </para>  </para>
4854  <screen>  <screen>
4855  -----BEGIN PGP SIGNED MESSAGE-----  -----BEGIN PGP SIGNED MESSAGE-----
4856    Hash: SHA1
4857  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;  Uploader: Foo Bar &lt;Foo.Bar@example.org&gt;
4858  Commands:  Commands:
4859   rm hello_1.0-1_i386.deb   rm hello_1.0-1_i386.deb
4860   mv hello_1.0-1.dsx hello_1.0-1.dsc   mv hello_1.0-1.dsx hello_1.0-1.dsc
4861  -----BEGIN PGP SIGNATURE-----  -----BEGIN PGP SIGNATURE-----
4862  Version: 2.6.3ia  Version: GnuPG v1.4.10 (GNU/Linux)
4863  iQCVAwUBNFiQSXVhJ0HiWnvJAQG58AP+IDJVeSWmDvzMUphScg1EK0mvChgnuD7h  
4864  BRiVQubXkB2DphLJW5UUSRnjw1iuFcYwH/lFpNpl7XP95LkLX3iFza9qItw4k2/q  [...]
 tvylZkmIA9jxCyv/YB6zZCbHmbvUnL473eLRoxlnYZd3JFaCZMJ86B0Ph4GFNPAf  
 Z4jxNrgh7Bc=  
 =pH94  
4865  -----END PGP SIGNATURE-----  -----END PGP SIGNATURE-----
4866  </screen>  </screen>
4867  </section>  </section>
4868    <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>
4869    <para>
4870    When you first upload the package to the archive, you need to include the
4871    original <filename>orig.tar.gz</filename> source, too.  If the Debian revision
4872    number of this package is neither <literal>1</literal> nor
4873    <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command>
4874    option <literal>-sa</literal>.
4875    </para>
4876    <para>
4877    For the <command>dpkg-buildpackage</command> command:
4878    </para>
4879    <screen>
4880    $ dpkg-buildpackage -sa
4881    </screen>
4882    <para>
4883    For the <command>debuild</command> command:
4884    </para>
4885    <screen>
4886    $ debuild -sa
4887    </screen>
4888    <para>
4889    For the <command>pdebuild</command> command:
4890    </para>
4891    <screen>
4892    $ pdebuild --debbuildopts -sa
4893    </screen>
4894    <para>
4895    On the other hand, the <literal>-sd</literal> option will force the exclusion
4896    of the original <filename>orig.tar.gz</filename> source.
4897    </para>
4898    </section>
4899  <section id="skipped-uploads"><title>Skipped uploads</title>  <section id="skipped-uploads"><title>Skipped uploads</title>
4900  <para>  <para>
4901  If you created multiple entries in <filename>debian/changelog</filename> by  If you created multiple entries in <filename>debian/changelog</filename> by
4902  skipping uploads, you must create a proper <filename>*_.changes</filename> file  skipping uploads, you must create a proper <filename>*_.changes</filename> file
4903  which includes all changes from the last upload.  which includes all changes from the last upload.
4904    This can be done by specifying the <command>dpkg-buildpackage</command> option
4905    <literal>-v</literal> with the version, e.g.,
4906    <literal><replaceable>1.2</replaceable></literal>.
4907    </para>
4908    <para>
4909    For the <command>dpkg-buildpackage</command> command:
4910  </para>  </para>
4911    <screen>
4912    $ dpkg-buildpackage -v<replaceable>1.2</replaceable>
4913    </screen>
4914  <para>  <para>
4915  This can be done by specifying <literal>-v</literal> option to the package  For the <command>debuild</command> command:
 building programs such as <command>dpkg-buildpackage</command>,  
 <command>debuild</command>, <command>pdebuild</command>, etc.  
4916  </para>  </para>
4917    <screen>
4918    $ debuild -v<replaceable>1.2</replaceable>
4919    </screen>
4920    <para>
4921    For the <command>pdebuild</command> command:
4922    </para>
4923    <screen>
4924    $ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>"
4925    </screen>
4926  </section>  </section>
4927  </chapter>  </chapter>
4928  <chapter id="update"><title>Updating the package</title>  <chapter id="update"><title>Updating the package</title>
4929  <para>  <para>
4930  Once you release a package, you need to update it soon.  After you release a package, you will soon need to update it.
4931  </para>  </para>
4932  <section id="newrevision"><title>New Debian revision</title>  <section id="newrevision"><title>New Debian revision</title>
4933  <para>  <para>
4934  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
4935  <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.
4936  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.
4937  </para>  </para>
4938  <itemizedlist>  <itemizedlist>
4939  <listitem>  <listitem>
# Line 4761  If this is to be recorded as a new patch Line 4944  If this is to be recorded as a new patch
4944  <listitem>  <listitem>
4945  <para>  <para>
4946  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set
4947  patch name;  the patch name;
4948  </para>  </para>
4949  </listitem>  </listitem>
4950  <listitem>  <listitem>
4951  <para>  <para>
4952  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare
4953  file to be modified;  the file to be modified;
4954  </para>  </para>
4955  </listitem>  </listitem>
4956  <listitem>  <listitem>
# Line 4777  Correct the problem in the package sourc Line 4960  Correct the problem in the package sourc
4960  </listitem>  </listitem>
4961  <listitem>  <listitem>
4962  <para>  <para>
4963  <literal>dquilt refresh</literal> to record to  <literal>dquilt refresh</literal> to record it to
4964  <filename><replaceable>bugname.patch</replaceable></filename>;  <filename><replaceable>bugname.patch</replaceable></filename>;
4965  </para>  </para>
4966  </listitem>  </listitem>
# Line 4796  If this is to update an existing patch, Line 4979  If this is to update an existing patch,
4979  <listitem>  <listitem>
4980  <para>  <para>
4981  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall
4982  existing <filename><replaceable>foo.patch</replaceable></filename>;  the existing <filename><replaceable>foo.patch</replaceable></filename>;
4983  </para>  </para>
4984  </listitem>  </listitem>
4985  <listitem>  <listitem>
# Line 4830  Add a new revision at the top of the Deb Line 5013  Add a new revision at the top of the Deb
5013  file, for example with <literal>dch -i</literal>, or explicitly with  file, for example with <literal>dch -i</literal>, or explicitly with
5014  <literal>dch -v  <literal>dch -v
5015  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>
5016  and then insert the comments using your preferred editor.  <footnote><para> To  and then insert the comments using your preferred editor.  <footnote><para>To
5017  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>.
5018  </para> </footnote>  </para> </footnote>
5019  </para>  </para>
# Line 4838  get the date in the required format, use Line 5021  get the date in the required format, use
5021  <listitem>  <listitem>
5022  <para>  <para>
5023  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,
5024  followed by <literal>Closes: #54321</literal>.  That way, the bug report will  followed by <literal>Closes: #654321</literal>.  That way, the bug report will
5025  be <emphasis>automagically</emphasis> closed by the archive maintenance  be <emphasis>automagically</emphasis> closed by the archive maintenance
5026  software the moment your package gets accepted in the Debian archive.  software the moment your package gets accepted into the Debian archive.
5027  </para>  </para>
5028  </listitem>  </listitem>
5029  <listitem>  <listitem>
# Line 4857  changed and it already exists in the Deb Line 5040  changed and it already exists in the Deb
5040  </para>  </para>
5041  </listitem>  </listitem>
5042  </itemizedlist>  </itemizedlist>
5043    <para>
5044    One tricky case can occur when you make a local package to experiment with
5045    the packaging before uploading  the normal version to the official archive,
5046    e.g.,
5047    <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>.
5048    For smoother upgrades, it is a good idea to create a
5049    <filename>changelog</filename> entry with a version string as
5050    <literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>.
5051    You may unclutter <filename>changelog</filename>
5052    by consolidating such local change entries into a single entry for the official package.
5053    See <xref linkend="namever"/> for the order of version strings.
5054    </para>
5055    <para>
5056    </para>
5057  </section>  </section>
5058  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>
5059  <para>  <para>
5060  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
5061  must check the new upstream release, first.  must check the new upstream release, first.
5062  </para>  </para>
5063  <para>  <para>
5064  You start this by reading the upstream <filename>changelog</filename>,  Start by reading the upstream <filename>changelog</filename>,
5065  <filename>NEWS</filename>, and whatever other documentations they may have  <filename>NEWS</filename>, and whatever other documentation they may have
5066  released with the new version.  released with the new version.
5067  </para>  </para>
5068  <para>  <para>
5069  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,
5070  watch out for anything suspicious.  watching out for anything suspicious.
5071  </para>  </para>
5072  <screen>  <screen>
5073  $ 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 4882  Changes to some auto-generated files by Line 5079  Changes to some auto-generated files by
5079  <filename>config.sub</filename>, <filename>configure</filename>,  <filename>config.sub</filename>, <filename>configure</filename>,
5080  <filename>depcomp</filename>, <filename>install-sh</filename>,  <filename>depcomp</filename>, <filename>install-sh</filename>,
5081  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be
5082  ignored.  You may erase them before running <command>diff</command> to the  ignored.  You may delete them before running <command>diff</command> on the
5083  source for inspection.  source for inspection.
5084  </para>  </para>
5085  </section>  </section>
# Line 4898  in the new extracted source.  <footnote> Line 5095  in the new extracted source.  <footnote>
5095  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
5096  /<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
5097  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of
5098  course, you need to do few obvious chores.  course, you need to do some obvious chores.
5099  </para>  </para>
5100  <itemizedlist>  <itemizedlist>
5101  <listitem>  <listitem>
5102  <para>  <para>
5103  Create a copy of upstream source as the  Create a copy of the upstream source as the
5104  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.
5105  </para>  </para>
5106  </listitem>  </listitem>
# Line 4946  in <filename>.rej</filename> files). Line 5143  in <filename>.rej</filename> files).
5143  <itemizedlist>  <itemizedlist>
5144  <listitem>  <listitem>
5145  <para>  <para>
5146  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,
5147  </para>  </para>
5148  <itemizedlist>  <itemizedlist>
5149  <listitem>  <listitem>
# Line 4971  upstream source, Line 5168  upstream source,
5168  <listitem>  <listitem>
5169  <para>  <para>
5170  Edit the <filename><replaceable>baz</replaceable></filename> file manually to  Edit the <filename><replaceable>baz</replaceable></filename> file manually to
5171  realize intended effect of  bring about the intended effect of
5172  <filename><replaceable>baz</replaceable>.rej</filename>.  <filename><replaceable>baz</replaceable>.rej</filename>.
5173  </para>  </para>
5174  </listitem>  </listitem>
# Line 4984  realize intended effect of Line 5181  realize intended effect of
5181  </listitem>  </listitem>
5182  <listitem>  <listitem>
5183  <para>  <para>
5184  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>.
5185  </para>  </para>
5186  </listitem>  </listitem>
5187  </itemizedlist>  </itemizedlist>
# Line 5032  You can release this updated source by r Line 5229  You can release this updated source by r
5229  <section id="packagestyle"><title>Updating the packaging style</title>  <section id="packagestyle"><title>Updating the packaging style</title>
5230  <para>  <para>
5231  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
5232  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
5233  source format by doing this.  <footnote><para> If your sponsor or other  <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal>
5234  maintainers object to updating the existing packaging style, it is not worth  source format.  <footnote><para> If your sponsor or other
5235  bothering nor arguing.  There are more important things to do.  </para>  maintainers object to updating the existing packaging style, don't bother
5236    arguing.  There are more important things to do.  </para>
5237  </footnote>  </footnote>
5238  </para>  </para>
5239  <itemizedlist>  <itemizedlist>
5240  <listitem>  <listitem>
5241  <para>  <para>
5242  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
5243  <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
5244  <literal>--addmissing</literal> option.  Then edit them properly.  the <literal>--addmissing</literal> option.  Then edit them appropriately.
5245  </para>  </para>
5246  </listitem>  </listitem>
5247  <listitem>  <listitem>
5248  <para>  <para>
5249  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
5250  <filename>debian/rules</filename> file, update it to use <command>dh</command>.  <filename>debian/rules</filename> file, update it to use <command>dh</command>.
5251  Update the <filename>debian/control</filename> file accordingly.  Update the <filename>debian/control</filename> file accordingly.
5252  </para>  </para>
# Line 5060  If you want to update the <filename>rule Line 5258  If you want to update the <filename>rule
5258  System (<systemitem role="package">cdbs</systemitem>) to the  System (<systemitem role="package">cdbs</systemitem>) to the
5259  <command>dh</command> syntax, see  <command>dh</command> syntax, see
5260  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its
5261  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the  <literal>DEB_*</literal> configuration variables.
5262    <!--
5263    <footnote><para> In the
5264  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some
5265  negative descriptions of the <filename>rules</filename> file created by the  negative descriptions of the <filename>rules</filename> file created by the
5266  <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
5267  only for <literal>lenny</literal> which created explicit targets with long list  only for <literal>lenny</literal> which created explicit targets with long lists
5268  of <command>dh_*</command> commands.  </para> </footnote>  of <command>dh_*</command> commands.  </para> </footnote>
5269    -->
5270  </para>  </para>
5271  </listitem>  </listitem>
5272  <listitem>  <listitem>
# Line 5074  If you have a <literal>1.0</literal> sou Line 5275  If you have a <literal>1.0</literal> sou
5275  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5276  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
5277  creating <filename>debian/source/format</filename> with <literal>3.0  creating <filename>debian/source/format</filename> with <literal>3.0
5278  (native)</literal>.  The rest of <filename>debian/*</filename> files can be  (native)</literal>.  The rest of the <filename>debian/*</filename> files can just be
5279  just copied.  copied.
5280  </para>  </para>
5281  </listitem>  </listitem>
5282  <listitem>  <listitem>
# Line 5084  If you have a <literal>1.0</literal> sou Line 5285  If you have a <literal>1.0</literal> sou
5285  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5286  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
5287  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.
5288  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
5289  <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
5290  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>
5291  command to your <command>quilt</command> system, if needed.  <footnote><para>  to your <command>quilt</command> system, if needed.  <footnote><para>
5292  You may split <filename>big.diff</filename> into many small incremental patches  You can split <filename>big.diff</filename> into many small incremental patches
5293  using the <command>splitdiff</command> command.  </para> </footnote>  using the <command>splitdiff</command> command.  </para> </footnote>
5294  </para>  </para>
5295  </listitem>  </listitem>
5296  <listitem>  <listitem>
5297  <para>  <para>
5298  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>,
5299  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the
5300  <systemitem role="package">quilt</systemitem> command using  <systemitem role="package">quilt</systemitem> command using
5301  <filename>deb3</filename> at <ulink url="&deb3;"/>.  <filename>deb3</filename> at <ulink url="&deb3;"/>.
# Line 5105  If it was packaged with another patch sy Line 5306  If it was packaged with another patch sy
5306  If it was packaged with the <command>dh</command> command with the  If it was packaged with the <command>dh</command> command with the
5307  <literal>--with quilt</literal> option or with the  <literal>--with quilt</literal> option or with the
5308  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>
5309  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
5310  (native)</literal> source format.  (native)</literal> source format.
5311  </para>  </para>
5312  </listitem>  </listitem>
5313  </itemizedlist>  </itemizedlist>
5314  <para>  <para>
5315  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.
5316  </para>  </para>
5317  </section>  </section>
5318  <section id="reminders"><title>Reminders for updating packages</title>  <section id="reminders"><title>Reminders for updating packages</title>
# Line 5122  Here are few reminders for updating pack Line 5323  Here are few reminders for updating pack
5323  <listitem>  <listitem>
5324  <para>  <para>
5325  Preserve old <filename>changelog</filename> entries (sounds obvious, but there  Preserve old <filename>changelog</filename> entries (sounds obvious, but there
5326  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
5327  <literal>dch -i</literal>.)  <literal>dch -i</literal>.)
5328  </para>  </para>
5329  </listitem>  </listitem>
# Line 5143  and <filename>debian/control</filename> Line 5344  and <filename>debian/control</filename>
5344  </listitem>  </listitem>
5345  <listitem>  <listitem>
5346  <para>  <para>
5347  Check to see <ulink url="&bts;">Debian Bug Tracking  Check the <ulink url="&bts;">Debian Bug Tracking
5348  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
5349  currently open in it.  currently open.
5350  </para>  </para>
5351  </listitem>  </listitem>
5352  <listitem>  <listitem>
5353  <para>  <para>
5354  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
5355  are uploading to the correct distribution, the proper bugs closures are listed  are uploading to the correct distribution, the proper bug closures are listed
5356  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and
5357  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.
5358  </para>  </para>

Legend:
Removed from v.8728  
changed lines
  Added in v.8792

  ViewVC Help
Powered by ViewVC 1.1.5