/[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 8742 by osamu, Thu Apr 28 13:23:38 2011 UTC revision 9043 by osamu, Sat Jan 14 15:28:46 2012 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 226  please refer to the following to learn h Line 226  please refer to the following to learn h
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 491  are correct.  Please file a bug report o Line 491  are correct.  Please file a bug report o
491  <systemitem role="package">maint-guide</systemitem> package using  <systemitem role="package">maint-guide</systemitem> package using
492  <command>reportbug</command>.  <command>reportbug</command>.
493  </para>  </para>
494    <para>
495    The following is an alternative tutorial documentation which you may
496    read along with this document:
497    </para>
498    <itemizedlist>
499    <listitem><para><ulink url="&debpkg-tutorial0;">Debian Packaging Tutorial</ulink></para></listitem>
500    <listitem><para><ulink url="&debpkg-tutorial1;">Practical session 1: Modifying the grep package</ulink></para></listitem>
501    <listitem><para><ulink url="&debpkg-tutorial2;">Practical session 2: Packaging GNUjump</ulink></para></listitem>
502    <listitem><para><ulink url="&debpkg-tutorial3;">Practical session 3: Packaging a Java library</ulink></para></listitem>
503    </itemizedlist>
504  </section>  </section>
505  <section id="helpme"><title>Where to ask for help</title>  <section id="helpme"><title>Where to ask for help</title>
506  <para>  <para>
# Line 585  documentation</emphasis> for details). Line 595  documentation</emphasis> for details).
595  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,
596  adopting an existing one).  adopting an existing one).
597  </para>  </para>
598  <section id="workflow"><title>Workflow of the Debian package building</title>  <section id="workflow"><title>Debian package building workflow</title>
599  <para>  <para>
600  If you are making a Debian package with an upstream program,  If you are making a Debian package with an upstream program, the
601  typical workflow of the Debian package building involves generating several  typical workflow of Debian package building involves generating several
602  specifically named files for each step as the following.  specifically named files for each step as follows.
603  </para>  </para>
604  <itemizedlist>  <itemizedlist>
605  <listitem>  <listitem>
606  <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>
607    <itemizedlist>    <itemizedlist>
608    <listitem><literal><replaceable>package</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem>    <listitem><literal><replaceable>package</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem>
609    </itemizedlist>    </itemizedlist>
610  </listitem>  </listitem>
611  <listitem>  <listitem>
612  <para>  <para>
613  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
614  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
615    (that is, the set of input files used for Debian package building) in
616    <literal>3.0 (quilt)</literal> format.
617  </para>  </para>
618    <itemizedlist>    <itemizedlist>
619    <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>
620    <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>
621      <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,
622      <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>
623      is used instead. </para></footnote></listitem>      is used instead. </para></footnote></listitem>
624    <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 626  the Debian package building, by adding D
626  </listitem>  </listitem>
627  <listitem>  <listitem>
628  <para>  <para>
629  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.
630  </para>  </para>
631    <itemizedlist>    <itemizedlist>
632    <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 637  We build Debian binary packages, which a
637  Please note that the character separating  Please note that the character separating
638  <literal><replaceable>package</replaceable></literal> and  <literal><replaceable>package</replaceable></literal> and
639  <literal><replaceable>version</replaceable></literal> was changed from  <literal><replaceable>version</replaceable></literal> was changed from
640  <literal>-</literal> (hyphen) to <literal>_</literal> (underscore).  <literal>-</literal> (hyphen) in the tarball name to
641    <literal>_</literal> (underscore) in the Debian package filenames.
642  </para>  </para>
643  <para>  <para>
644  Here,  In the file names above, replace
645  <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>,
646  <emphasis role="strong">package name</emphasis>,  the <literal><replaceable>version</replaceable></literal> part with the <emphasis role="strong">upstream version</emphasis>,
647  <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>,
648  <emphasis role="strong">upstream version</emphasis>,  and the <literal><replaceable>arch</replaceable></literal> part with the <emphasis role="strong">package architecture</emphasis>,
649  <literal><replaceable>revision</replaceable></literal> part of it is substituted by the  as defined in the Debian Policy Manual.
650  <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:  
651  <ulink url="&policy-source;">5.6.1 Source</ulink>,  <ulink url="&policy-source;">5.6.1 Source</ulink>,
652  <ulink url="&policy-package;">5.6.7 Package</ulink>, and  <ulink url="&policy-package;">5.6.7 Package</ulink>, and
653  <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 656  Debian Policy Manual: <ulink url="&polic
656  and is automatically assigned by the package build process.</para></footnote>  and is automatically assigned by the package build process.</para></footnote>
657  </para>  </para>
658  <para>  <para>
659  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
660  typical workflow of the Debian package building is simpler.  typical workflow of Debian package building is simpler.
661  </para>  </para>
662  <itemizedlist>  <itemizedlist>
663  <listitem>  <listitem>
664  <para>  <para>
665  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>
666    format using a single compressed tar file in which all files are included.
667  </para>  </para>
668    <itemizedlist>    <itemizedlist>
669    <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 672  We create a native Debian source package
672  </listitem>  </listitem>
673  <listitem>  <listitem>
674  <para>  <para>
675  We build Debian binary packages from the native Debian source package.  Build Debian binary packages from the native Debian source package.
676  </para>  </para>
677    <itemizedlist>    <itemizedlist>
678    <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 680  We build Debian binary packages from the
680  </listitem>  </listitem>
681  </itemizedlist>  </itemizedlist>
682  <para>  <para>
683  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.
684  </para>  </para>
685  </section>  </section>
686  <section id="choose"><title>Choose your program</title>  <section id="choose"><title>Choose your program</title>
# Line 817  and ask for advice. Line 825  and ask for advice.
825  </para>  </para>
826  </listitem>  </listitem>
827  </itemizedlist>  </itemizedlist>
828    </listitem>
829  <listitem>  <listitem>
830  <para>  <para>
831  The program should <emphasis role="strong">not</emphasis> introduce security  The program should <emphasis role="strong">not</emphasis> introduce security
832  and maintenance concerns to the Debian system.  and maintenance concerns to the Debian system.
833  </para>  </para>
 </listitem>  
834  <itemizedlist>  <itemizedlist>
835  <listitem>  <listitem>
836  <para>  <para>
# Line 864  with easier packages and discouraged fro Line 872  with easier packages and discouraged fro
872  </para>  </para>
873  <itemizedlist>  <itemizedlist>
874  <listitem><para>Simple packages</para>  <listitem><para>Simple packages</para>
875    <itemizedlist>  <itemizedlist>
876    <listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem>    <listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem>
877    <listitem><para>single binary package, arch = all (executable written in the POSIX shell language)</para></listitem>    <listitem><para>single binary package, arch = all (executables written in an interpreted language such as POSIX shell)</para></listitem>
878    <listitem><para>single binary package, arch = all (executable written in interpreter languages)</para></listitem>  </itemizedlist>
   </itemizedlist>  
879  </listitem>  </listitem>
880  <listitem><para>Intermediate complexity packages</para>  <listitem><para>Intermediate complexity packages</para>
881    <itemizedlist>  <itemizedlist>
882    <listitem><para>single binary package, arch = any (executable compiled from a C source with <xref linkend="simplemake"/>)</para></listitem>    <listitem><para>single binary package, arch = any (ELF binary executables compiled from languages such as C and C++)</para></listitem>
883    <listitem><para>single binary package, arch = any (executable compiled from a C source with <xref linkend="portable"/>)</para></listitem>    <listitem><para>multiple binary packages, arch = any + all (packages for ELF binary executables + documentation)</para></listitem>
   <listitem><para>multiple binary packages, arch = any + all (executable package + documentation package)</para></listitem>  
884    <listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem>    <listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem>
885    <listitem><para>upstream source containing undistributable contents</para></listitem>    <listitem><para>upstream source containing undistributable contents</para></listitem>
886    </itemizedlist>  </itemizedlist>
887  </listitem>  </listitem>
888  <listitem><para>High complexity packages</para>  <listitem><para>High complexity packages</para>
889    <itemizedlist>  <itemizedlist>
890    <listitem><para>interpreter module packages used by other packages</para></listitem>    <listitem><para>interpreter module package used by other packages</para></listitem>
891    <listitem><para>multiple binary packages containing library package</para></listitem>    <listitem><para>generic ELF library package used by other packages</para></listitem>
892    <listitem><para>generic library package used by other packages</para></listitem>    <listitem><para>multiple binary packages including an ELF library package</para></listitem>
893    <listitem><para>source package with multiple upstream sources</para></listitem>    <listitem><para>source package with multiple upstream sources</para></listitem>
894    <listitem><para>kernel module packages</para></listitem>    <listitem><para>kernel module packages</para></listitem>
895    <listitem><para>kernel patch packages</para></listitem>    <listitem><para>kernel patch packages</para></listitem>
896    <listitem><para>any package with non-trivial maintainer scripts</para></listitem>    <listitem><para>any package with non-trivial maintainer scripts</para></listitem>
897    </itemizedlist>  </itemizedlist>
898  </listitem>  </listitem>
899  </itemizedlist>  </itemizedlist>
900  <para>  <para>
901  Packaging high complexity packages is not too hard, but it requires a bit more  Packaging high complexity packages is not too hard, but it requires a bit more
902  knowledge. You should seek specific guidances for every complexities. For example, some interpreter languages have their policy.  knowledge. You should seek specific guidance for every complex feature. For
903    example, some languages have their own sub-policy documents:
904  </para>  </para>
905  <itemizedlist>  <itemizedlist>
906  <listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem>  <listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem>
907  <listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem>  <listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem>
908  <listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem>  <listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem>
909  </itemizedlist>  </itemizedlist>
910    <para>
911    There is another old Latin saying: <emphasis>fabricando fit faber</emphasis>
912    (practice makes perfect).  It is <emphasis>highly</emphasis> recommended to
913    practice and experiment with all the steps of Debian packaging with simple packages
914    while reading this tutorial.  A trivial upstream tarball
915    <filename>hello-sh-1.0.tar.gz</filename> created as followings may offer
916    a good starting point.<footnote><para>Do not worry about the missing
917    <filename>Makefile</filename>.  You can install the <command>hello</command>
918    command by simply using <command>debhelper</command> as in
919    <xref linkend="install"/>, or by modifying the upstream source to add a new
920    <filename>Makefile</filename> with the <literal>install</literal> target as in
921    <xref linkend="modify"/>.</para></footnote>
922    </para>
923    <screen>
924    $ mkdir -p hello-sh/hello-sh-1.0; cd hello-sh/hello-sh-1.0
925    $ cat &gt; hello &lt;&lt;EOF
926    #!/bin/sh
927    # (C) 2011 Foo Bar, GPL2+
928    echo "Hello!"
929    EOF
930    $ chmod 755 hello
931    $ cd ..
932    $ tar -cvzf hello-sh-1.0.tar.gz hello-sh-1.0
933    </screen>
934  </section>  </section>
935  <section id="getit"><title>Get the program, and try it out</title>  <section id="getit"><title>Get the program, and try it out</title>
936  <para>  <para>
# Line 931  enough.  </para> </footnote>), you shoul Line 962  enough.  </para> </footnote>), you shoul
962  appropriate tools and repack it.  appropriate tools and repack it.
963  </para>  </para>
964  <para>  <para>
965    If your program's source comes with some contents which do not comply with
966    DFSG, you should also unpack it to remove such contents and repack it with a
967    modified upstream version containing <literal>dfsg</literal>.
968    </para>
969    <para>
970  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+
971  file manager.  file manager.
972  <footnote><para> This program is already packaged. The  <footnote><para> This program is already packaged. The
# Line 975  or simply with freshly unpacked sources. Line 1011  or simply with freshly unpacked sources.
1011  </section>  </section>
1012  <section id="simplemake"><title>Simple build systems</title>  <section id="simplemake"><title>Simple build systems</title>
1013  <para>  <para>
1014  Simple programs come with a <filename>Makefile</filename> and can  Simple programs usually come with a <filename>Makefile</filename> and can
1015  be compiled just by invoking <literal>make</literal>.<footnote><para>  be compiled just by invoking <literal>make</literal>.<footnote><para>
1016  Many modern programs come with a script <filename>configure</filename> which  Many modern programs come with a script <filename>configure</filename> which
1017  when executed creates a <filename>Makefile</filename> customized for  when executed creates a <filename>Makefile</filename> customized for
# Line 1041  files requires some knowledge of <comman Line 1077  files requires some knowledge of <comman
1077  <para>  <para>
1078  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
1079  distributed source and runs <literal>./configure &amp;&amp; make</literal> in  distributed source and runs <literal>./configure &amp;&amp; make</literal> in
1080  the source directory to compile the program into a  the source directory to compile the program into an executable command
1081  <command><replaceable>binary</replaceable></command> executable.  <command><replaceable>binary</replaceable></command>.
1082  </para>  </para>
1083  <screen>  <screen>
1084  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>  Makefile.in -----+                +-&gt; Makefile -----+-&gt; make -&gt; <replaceable>binary</replaceable>
# Line 1055  config.h.in -----+                +-&gt; Line 1091  config.h.in -----+                +-&gt;
1091  <para>  <para>
1092  You can change many things in the <filename>Makefile</filename>; for  You can change many things in the <filename>Makefile</filename>; for
1093  instance you can change the default location for file installation  instance you can change the default location for file installation
1094  using the option <command>./configure --prefix=/usr</command>.  using the option <literal>./configure --prefix=/usr</literal>.
1095  </para>  </para>
1096  <para>  <para>
1097  Although it is not required, updating the <filename>configure</filename> and  Although it is not required, updating the <filename>configure</filename> and
# Line 1074  build system.  You can recognize such so Line 1110  build system.  You can recognize such so
1110  <section id="namever"><title>Package name and version</title>  <section id="namever"><title>Package name and version</title>
1111  <para>  <para>
1112  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
1113  consider  take <literal>gentoo</literal> as the (source) <emphasis role="strong">package name</emphasis>
1114  <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>.  
1115  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
1116  <xref linkend="changelog"/>, too.  <xref linkend="changelog"/>, too.
1117  </para>  </para>
# Line 1084  These are used in the <filename>debian/c Line 1119  These are used in the <filename>debian/c
1119  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
1120  <emphasis role="strong">package name</emphasis> and  <emphasis role="strong">package name</emphasis> and
1121  <emphasis role="strong">upstream version</emphasis> by renaming the upstream  <emphasis role="strong">upstream version</emphasis> by renaming the upstream
1122  source to follow the Debian Policy and the existing convention.  source to follow Debian Policy and existing convention.
1123  </para>  </para>
1124  <para>  <para>
1125  You must choose the <emphasis role="strong">package name</emphasis>  You must choose the <emphasis role="strong">package name</emphasis>
# Line 1093  to consist only of lower case letters (< Line 1128  to consist only of lower case letters (<
1128  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be  (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be
1129  at least two characters long, must start with an alphanumeric character, and  at least two characters long, must start with an alphanumeric character, and
1130  must not be the same as existing ones.  must not be the same as existing ones.
1131  It is good idea to keep its length within 30 characters.  It is a good idea to keep its length within 30 characters.
1132  <footnote><para>The 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>  <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>
1133  </para>  </para>
1134  <!--  <!--
1135  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
# Line 1109  Previous 20 chars is becoming too short Line 1144  Previous 20 chars is becoming too short
1144  Default aptitude setting display up to 30 chars (98.3%).  Default aptitude setting display up to 30 chars (98.3%).
1145  -->  -->
1146  <para>  <para>
1147  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
1148  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.  
1149  <footnote><para>If you follow the  <footnote><para>If you follow the
1150  <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>,
1151  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 1124  tildes (<literal>~</literal>), and perio Line 1158  tildes (<literal>~</literal>), and perio
1158  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter  start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter
1159  rule should help you avoid confusing file names.</para></footnote>  rule should help you avoid confusing file names.</para></footnote>
1160  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.
1161  <footnote><para>The 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 charactes and the Debian revision is less than 2 characters.  For more than 90% of packages, the upstream version is less than 10 charactes and the Debian revision is less than 3 characters.</para></footnote>  <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>
1162  </para>  </para>
1163  <!--  <!--
1164  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):  Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
# Line 1149  aptitude display 10 = 8char for up + 1ch Line 1183  aptitude display 10 = 8char for up + 1ch
1183  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)
1184  -->  -->
1185  <para>  <para>
1186  If the upstream software does not use normal version system like  If upstream does not use a normal versioning scheme such as
1187  <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
1188  <literal>09Oct23</literal>, a random codename string or a VCS hash value as a part  <literal>11Apr29</literal>, a random codename string, or a VCS hash value as part
1189  of version, make sure to remove them from the  of the version, make sure to remove them from the
1190  <emphasis role="strong">upstream version</emphasis>.  Such information can be  <emphasis role="strong">upstream version</emphasis>.  Such information can be
1191  recorded in the <filename>debian/changelog</filename> file.  If you need to  recorded in the <filename>debian/changelog</filename> file.  If you need to
1192  invent a version string, use the <literal>YYYYMMDD</literal> format such as  invent a version string, use the <literal>YYYYMMDD</literal> format such as
1193  <literal>20110429</literal> as upstream version.  This ensures that  <literal>20110429</literal> as upstream version.  This ensures that
1194  <command>dpkg</command> properly sees later versions as upgrades.  <command>dpkg</command> interprets later versions correctly as upgrades.
1195    If you need to ensure smooth transition to the normal version scheme such as
1196    <literal>0.1</literal> in future, use the <literal>0~YYMMDD</literal> format
1197    such as <literal>0~110429</literal> as upstream version, instead.
1198  </para>  </para>
1199  <para>  <para>
1200  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
1201    <emphasis role="strong">upstream version</emphasis>
1202    (<literal><replaceable>version</replaceable></literal>),
1203    <emphasis role="strong">Debian revision</emphasis>
1204    (<literal><replaceable>revision</replaceable></literal>), or
1205    <emphasis role="strong">version</emphasis>
1206    (<literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>).
1207    See <xref linkend="newrevision"/> for how the
1208    <emphasis role="strong">Debian revision</emphasis> is incremented.
1209    </para></footnote>
1210    can be compared using <citerefentry>
1211    <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as follows.
1212  </para>  </para>
1213  <screen>  <screen>
1214   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>   $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>
1215  </screen>  </screen>
1216  <para>  <para>
1217  The version comparison rule can be summarized as the following.  The version comparison rule can be summarized as:
1218  </para>  </para>
1219  <itemizedlist>  <itemizedlist>
1220  <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>
1221  <listitem><para>Alphabets are larger than numbers.</para></listitem>  <listitem><para>Letters are larger than digits.</para></listitem>
1222  <listitem><para>Numbers are compared as the integer.</para></listitem>  <listitem><para>Numbers are compared as integers.</para></listitem>
1223  <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>  <listitem><para>Letters are compared in ASCII code order.</para></listitem>
1224  <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
1225    (<literal>.</literal>), plus (<literal>+</literal>), and tilde
1226    (<literal>~</literal>) characters, as follows.</para>
1227    <para>    <para>
1228    <literal>0.0</literal> &lt;    <literal>0.0</literal> &lt;
1229    <literal>0.5</literal> &lt;    <literal>0.5</literal> &lt;
# Line 1190  The version comparison rule can be summa Line 1240  The version comparison rule can be summa
1240  </listitem>  </listitem>
1241  </itemizedlist>  </itemizedlist>
1242  <para>  <para>
1243  One of the tricky case happens when the upstream releases  One tricky case occurs when upstream releases
1244  <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the  <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the
1245  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
1246  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 1208  configuration files instead of <filename Line 1258  configuration files instead of <filename
1258  </para>  </para>
1259  <screen>  <screen>
1260  $ cat &gt;&gt;~/.bashrc &lt;&lt;EOF  $ cat &gt;&gt;~/.bashrc &lt;&lt;EOF
1261  DEBEMAIL=your.email.address@example.org  DEBEMAIL="your.email.address@example.org"
1262  DEBFULLNAME=Firstname Lastname  DEBFULLNAME="Firstname Lastname"
1263  export DEBEMAIL DEBFULLNAME  export DEBEMAIL DEBFULLNAME
1264  EOF  EOF
1265  $ . ~/.bashrc  $ . ~/.bashrc
# Line 1313  package; further explanations are given Line 1363  package; further explanations are given
1363  <para>  <para>
1364  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
1365  discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It  discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It
1366  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
1367  enabled by <systemitem role="package">debhelper</systemitem> configuration  carried out using only <systemitem role="package">debhelper</systemitem> configuration
1368  files such as <filename>debian/install</filename> (see  files such as <filename>debian/install</filename> (see
1369  <xref linkend="install"/>) only.  <xref linkend="install"/>).
1370  </para>  </para>
1371  </section>  </section>
1372  <section id="native-dh-make"><title>Initial native Debian package</title>  <section id="native-dh-make"><title>Initial native Debian package</title>
1373  <para>  <para>
1374  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,
1375  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
1376    native package. If you have source
1377  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
1378  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
1379  follows.  follows.
# Line 1354  useful to have a slightly customized def Line 1405  useful to have a slightly customized def
1405  line to <filename>~/.bashrc</filename>.  line to <filename>~/.bashrc</filename>.
1406  </para>  </para>
1407  <screen>  <screen>
1408  alias dquilt="quilt --quiltrc=~/.quiltrc-dpkg"  alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg"
1409  </screen>  </screen>
1410  <para>  <para>
1411  Then let's create <filename>~/.quiltrc-dpkg</filename> as follows.  Then let's create <filename>~/.quiltrc-dpkg</filename> as follows.
# Line 1480  installation.  The packaging script will Line 1531  installation.  The packaging script will
1531  <literal>$(DESTDIR)</literal> to the temporary directory.  <literal>$(DESTDIR)</literal> to the temporary directory.
1532  </para>  </para>
1533  <para>  <para>
1534  For packages of the single binary type, the temporary directory used  For a source package generating a single binary package, the temporary directory used
1535  by the <command>dh_auto_install</command> command will be set to  by the <command>dh_auto_install</command> command will be set to
1536  <filename>debian/<replaceable>package</replaceable></filename>.  <filename>debian/<replaceable>package</replaceable></filename>.
1537  <footnote><para> For packages of the multiple binary type, the  <footnote><para> For a source package generating multiple binary packages, the
1538  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>
1539  as the temporary directory while the <command>dh_install</command> command with  as the temporary directory while the <command>dh_install</command> command with
1540  the help of  the help of
# Line 1522  from the <command>dh_auto_configure</com Line 1573  from the <command>dh_auto_configure</com
1573  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:
1574  </para>  </para>
1575  <screen>  <screen>
1576  # Where to put binary executables on 'make install'?  # Where to put executable commands on 'make install'?
1577  BIN     = /usr/local/bin  BIN     = /usr/local/bin
1578  # Where to put icons on 'make install'?  # Where to put icons on 'make install'?
1579  ICONS   = /usr/local/share/gentoo  ICONS   = /usr/local/share/gentoo
# Line 1533  As explained above, that directory hiera Line 1584  As explained above, that directory hiera
1584  Debian, so change those paths to:  Debian, so change those paths to:
1585  </para>  </para>
1586  <screen>  <screen>
1587  # Where to put binary executables on 'make install'?  # Where to put executable commands on 'make install'?
1588  BIN     = $(DESTDIR)/usr/bin  BIN     = $(DESTDIR)/usr/bin
1589  # Where to put icons on 'make install'?  # Where to put icons on 'make install'?
1590  ICONS   = $(DESTDIR)/usr/share/gentoo  ICONS   = $(DESTDIR)/usr/share/gentoo
# Line 1545  documentation, etc. are specified in the Line 1596  documentation, etc. are specified in the
1596  your package.  your package.
1597  </para>  </para>
1598  <para>  <para>
1599  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
1600  <filename>/usr/local/bin</filename>, the manual page in  <filename>/usr/local/bin</filename>, the manual page in
1601  <filename>/usr/share/man/man1</filename> instead of  <filename>/usr/share/man/man1</filename> instead of
1602  <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 1591  at the top of the <filename>Makefile</fi Line 1642  at the top of the <filename>Makefile</fi
1642  </para>  </para>
1643  <para>  <para>
1644  Originally, <systemitem role="package">gentoo</systemitem>'s  Originally, <systemitem role="package">gentoo</systemitem>'s
1645  install target said:  <literal>install</literal> target said:
1646  </para>  </para>
1647  <screen>  <screen>
1648  install: gentoo-target  install: gentoo-target
# Line 1661  Debian specific packaging modification: Line 1712  Debian specific packaging modification:
1712  </listitem>  </listitem>
1713  </orderedlist>  </orderedlist>
1714  <para>  <para>
1715  Whenever you make changes that are not specifically related to Debian package  Whenever you make changes that are not specific to the Debian package
1716  such as <filename>debian/patches/fix-gentoo-target.patch</filename>, be sure to  such as <filename>debian/patches/fix-gentoo-target.patch</filename>, be sure to
1717  send them to the upstream maintainer so they can be included in the next  send them to the upstream maintainer so they can be included in the next
1718  revision of the program and be useful to everyone else.  Also remember  version of the program and be useful to everyone else.  Also remember
1719  to avoid making your fixes specific to Debian or Linux - or even Unix!  to avoid making your fixes specific to Debian or Linux - or even Unix!
1720  Make them portable.  This will make your fixes much easier to apply.  Make them portable.  This will make your fixes much easier to apply.
1721  </para>  </para>
# Line 1710  $ dquilt header -e Line 1761  $ dquilt header -e
1761  </chapter>  </chapter>
1762  <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>
1763  <para>  <para>
1764  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
1765  <filename>debian</filename>.  There are a number of files in this directory  <filename>debian</filename>.  There are a number of files in this directory
1766  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
1767  most important of them are <filename>control</filename>,  most important of them are <filename>control</filename>,
1768  <filename>changelog</filename>, <filename>copyright</filename> and  <filename>changelog</filename>, <filename>copyright</filename>, and
1769  <filename>rules</filename>, which are required for all packages.  <filename>rules</filename>, which are required for all packages.
1770  <footnote><para>  <footnote><para>
1771  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
1772  referred without preceding <filename>debian/</filename> for simplicity whenever  referred to without the leading <filename>debian/</filename> for simplicity whenever
1773  they are obvious.  the meaning is obvious.
1774  </para></footnote>  </para></footnote>
1775  </para>  </para>
1776  <section id="control"><title><filename>control</filename> file</title>  <section id="control"><title><filename>control</filename></title>
1777  <para>  <para>
1778  This file contains various values which <command>dpkg</command>,  This file contains various values which <command>dpkg</command>,
1779  <command>dselect</command>, <command>apt-get</command>,  <command>dselect</command>, <command>apt-get</command>,
1780  <command>apt-cache</command>, <command>aptitude</command>, and other package  <command>apt-cache</command>, <command>aptitude</command>, and other package
1781  management tools will use to manage the package.  It is defined by the  management tools will use to manage the package.  It is defined by the
1782  <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.  <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.
1783  </para>  </para>
1784  <para>  <para>
# Line 1763  Line 1 is the name of the source package Line 1814  Line 1 is the name of the source package
1814  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.
1815  </para>  </para>
1816  <para>  <para>
1817  As you may have noticed, Debian archive is divided in sections:  As you may have noticed, the Debian archive is divided into multiple areas:
1818  <literal>main</literal> (the free software), <literal>non-free</literal> (the  <literal>main</literal> (the free software), <literal>non-free</literal> (the
1819  not really free software) and <literal>contrib</literal> (free software that  not really free software) and <literal>contrib</literal> (free software that
1820  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
1821  describe in short what packages are in.  So we have <literal>admin</literal>  classify packages into rough categories.  So we have <literal>admin</literal>
1822  for administrator-only programs, <literal>base</literal> for the basic tools,  for administrator-only programs,
1823  <literal>devel</literal> for programmer tools, <literal>doc</literal> for  <literal>devel</literal> for programmer tools, <literal>doc</literal> for
1824  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>
1825  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
1826  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,
1827  and many more.  and many more.
1828  <footnote> <para>See  <footnote> <para>See
# Line 1794  Line 3 describes how important it is tha Line 1845  Line 3 describes how important it is tha
1845  <listitem>  <listitem>
1846  <para>  <para>
1847  The <literal>optional</literal> priority will usually work for new packages  The <literal>optional</literal> priority will usually work for new packages
1848  that do not conflict with others with <literal>required</literal>,  that do not conflict with others claiming <literal>required</literal>,
1849  <literal>important</literal> or <literal>standard</literal> priorities.  <literal>important</literal>, or <literal>standard</literal> priority.
1850  </para>  </para>
1851  </listitem>  </listitem>
1852  <listitem>  <listitem>
# Line 1806  conflict with others with non-<literal>e Line 1857  conflict with others with non-<literal>e
1857  </listitem>  </listitem>
1858  </itemizedlist>  </itemizedlist>
1859  <para>  <para>
1860  Section and priority are used by the frontends like <command>aptitude</command>  Section and priority are used by front-ends like <command>aptitude</command>
1861  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
1862  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
1863  maintainers, in which case you will be notified by email.  maintainers, in which case you will be notified by email.
# Line 1817  we will change the priority to <literal> Line 1868  we will change the priority to <literal>
1868  </para>  </para>
1869  <para>  <para>
1870  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
1871  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
1872  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
1873  you.  Avoid using commas, ampersands and parenthesis.  you.  Avoid using commas, ampersands, or parentheses.
1874  </para>  </para>
1875  <para>  <para>
1876  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
1877  the <literal>Build-Depends</literal> field.  You can also have the  the <literal>Build-Depends</literal> field.  You can also have the
1878  <literal>Build-Depends-Indep</literal> field as an additional line, here.  <literal>Build-Depends-Indep</literal> field as an additional line, here.
1879  <footnote><para>See  <footnote><para>See
# Line 1846  satisfy the Debian Policy requirement fo Line 1897  satisfy the Debian Policy requirement fo
1897  </listitem>  </listitem>
1898  <listitem>  <listitem>
1899  <para>  <para>
1900  For source packages which have some binary packages with <literal>Architecture:  Source packages which have binary packages with <literal>Architecture:
1901  any</literal>, they are rebuild by the autobuilder.  Since this autobuilder  any</literal> are rebuilt by the autobuilder.  Since this autobuilder
1902  procedure runs <literal>debian/rules build</literal> in it while installing  procedure installs only the packages listed in the
1903  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
1904  list practically all the required packages and the  <literal>debian/rules build</literal> (see <xref
1905  <literal>Build-Depends-indep</literal> is rarely used.  linkend="autobuilder"/>), the <literal>Build-Depends</literal> field
1906    needs to  list practically all the required packages and
1907    <literal>Build-Depends-Indep</literal> is rarely used.
1908  </para>  </para>
1909  </listitem>  </listitem>
1910  <listitem>  <listitem>
1911  <para>  <para>
1912  For source packages which have binary packages only with <literal>Architecture:  For source packages with binary packages all of which are <literal>Architecture:
1913  all</literal>, the <literal>Build-Depends-Indep</literal> field may list all  all</literal>, the <literal>Build-Depends-Indep</literal> field may list all
1914  the required packages unless they are already listed in the  the required packages unless they are already listed in the
1915  <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement  <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement
# Line 1869  If you are not sure which one should be Line 1922  If you are not sure which one should be
1922  <literal>Build-Depends</literal> field to be on the safe side.  <literal>Build-Depends</literal> field to be on the safe side.
1923  <footnote><para> This somewhat strange situation is a feature well documented  <footnote><para> This somewhat strange situation is a feature well documented
1924  in the <ulink url="&policy-build-depends-indep;">Debian Policy  in the <ulink url="&policy-build-depends-indep;">Debian Policy
1925  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
1926  <command>dh</command> command in the <filename>debian/rules</filename> file but  <command>dh</command> command in the <filename>debian/rules</filename> file but
1927  due to how the <command>dpkg-buildpackage</command> works.  The same situation  due to how the <command>dpkg-buildpackage</command> works.  The same situation
1928  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 1882  To find out what packages your package n Line 1935  To find out what packages your package n
1935  $ dpkg-depcheck -d ./configure  $ dpkg-depcheck -d ./configure
1936  </screen>  </screen>
1937  <para>  <para>
1938  To manually find exact build dependency for  To manually find exact build dependencies for
1939  <command><replaceable>/usr/bin/foo</replaceable></command>, you execute  <command><replaceable>/usr/bin/foo</replaceable></command>, execute
1940  </para>  </para>
1941  <screen>  <screen>
1942  $ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED  $ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED
# Line 1895  and for each library listed, e.g., <comm Line 1948  and for each library listed, e.g., <comm
1948  $ dpkg -S libfoo.so.6  $ dpkg -S libfoo.so.6
1949  </screen>  </screen>
1950  <para>  <para>
1951  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
1952  <literal>Build-Depends</literal> entry.  If you use <command>ldd</command> for  <literal>Build-Depends</literal> entry.  If you use <command>ldd</command> for
1953  this purpose, it will report indirect lib dependencies as well, resulting in  this purpose, it will report indirect lib dependencies as well, resulting in
1954  the problem of excessive build dependencies.  the problem of excessive build dependencies.
# Line 1911  Manual</ulink> standards this package fo Line 1964  Manual</ulink> standards this package fo
1964  your package.  your package.
1965  </para>  </para>
1966  <para>  <para>
1967  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.
1968  </para>  </para>
1969  <para>  <para>
1970  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
1971  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.
1972  </para>  </para>
1973  <para>  <para>
1974  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.
1975  We'll leave this as <literal>any</literal> because <citerefentry>  This value is usually one of the following depending
1976  <refentrytitle>dpkg-gencontrol</refentrytitle> <manvolnum>1</manvolnum>  on the type of the binary package.
1977  </citerefentry> will fill in the appropriate value for any machine this package  <footnote><para>See
1978  gets compiled on.  <ulink url="&policy-architecture;">Debian Policy Manual 5.6.8 "Architecture"</ulink>
1979    for exact details.
1980    </para></footnote>
1981    </para>
1982    <itemizedlist>
1983    <listitem><para><literal>Architecture: any</literal></para>
1984      <itemizedlist>
1985      <listitem><para>The generated binary package is an architecture dependent one
1986        usually in a compiled language.</para></listitem>
1987      </itemizedlist>
1988    </listitem>
1989    <listitem><para><literal>Architecture: all</literal></para>
1990      <itemizedlist>
1991      <listitem><para>The generated binary package is an architecture independent
1992        one usually consisting of text, images, or scripts in an interpreted
1993        language.</para></listitem>
1994      </itemizedlist>
1995    </listitem>
1996    </itemizedlist>
1997    <para>
1998    We leave line 10 as is since this is written in C.
1999    <citerefentry><refentrytitle>dpkg-gencontrol</refentrytitle><manvolnum>1</manvolnum></citerefentry>
2000    will fill in the appropriate architecture value for any machine this source
2001    package gets compiled on.
2002  </para>  </para>
2003  <para>  <para>
2004  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 1941  Packages can relate to each other in var Line 2017  Packages can relate to each other in var
2017  </para>  </para>
2018  <para>  <para>
2019  The package management tools usually behave the same way when dealing with  The package management tools usually behave the same way when dealing with
2020  these relations; if not, it will be explained.  (see <citerefentry>  these relations; if not, it will be explained.  (See <citerefentry>
2021  <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>,  <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>,
2022  <citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum>  <citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum>
2023  </citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle>  </citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle>
2024  <manvolnum>8</manvolnum> </citerefentry>, <citerefentry>  <manvolnum>8</manvolnum> </citerefentry>, <citerefentry>
2025  <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum>
2026  </citerefentry> etc.)  </citerefentry>, etc.)
2027  </para>  </para>
2028  <para>  <para>
2029  Here is a simplified description of package relationships.  Here is a simplified description of package relationships.
# Line 1972  severe breakage) unless a particular pac Line 2048  severe breakage) unless a particular pac
2048  </para>  </para>
2049  <para>  <para>
2050  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
2051  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
2052  likely prompt them to install the recommended packages.  probably prompt them to install the recommended packages.
2053  <command>aptitude</command> and <command>apt-get</command> install recommended  <command>aptitude</command> and <command>apt-get</command> install recommended
2054  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
2055  behaviour).  <command>dpkg</command> will ignore this field.  behavior).  <command>dpkg</command> will ignore this field.
2056  </para>  </para>
2057  </listitem>  </listitem>
2058  <listitem>  <listitem>
# Line 1985  behaviour).  <command>dpkg</command> wil Line 2061  behaviour).  <command>dpkg</command> wil
2061  </para>  </para>
2062  <para>  <para>
2063  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
2064  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
2065  prompt them to install the suggested packages.  <command>aptitude</command> can  prompted to install suggested packages.  <command>aptitude</command> can
2066  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
2067  not its default.  <command>dpkg</command> and <command>apt-get</command> will  not its default.  <command>dpkg</command> and <command>apt-get</command> will
2068  ignore this field.  ignore this field.
# Line 2019  severe problems if a particular package Line 2095  severe problems if a particular package
2095  <literal>Breaks</literal>  <literal>Breaks</literal>
2096  </para>  </para>
2097  <para>  <para>
2098  The package will be installed while all the listed packages will be broken.  When installed the package will break all the listed packages.
2099  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.
2100  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.  
2101  </para>  </para>
2102  </listitem>  </listitem>
2103  <listitem>  <listitem>
# Line 2057  symbols). Line 2132  symbols).
2132  </para>  </para>
2133  <para>  <para>
2134  The fields may restrict their applicability to particular versions of each  The fields may restrict their applicability to particular versions of each
2135  named package.  These versions are listed in parentheses after each individual  named package.  The restriction of each individual package is listed in
2136  package name, and they should contain a relation from the list below followed  parentheses after its name, and should contain a relation from the list below
2137  by the version number.  The relations allowed are: <literal>&lt;&lt;</literal>,  followed by a version number value.
2138  <literal>&lt;=</literal>, <literal>=</literal>, <literal>&gt;=</literal> and  The relations allowed are: <literal>&lt;&lt;</literal>,
2139    <literal>&lt;=</literal>, <literal>=</literal>, <literal>&gt;=</literal>, and
2140  <literal>&gt;&gt;</literal> for strictly lower, lower or equal, exactly equal,  <literal>&gt;&gt;</literal> for strictly lower, lower or equal, exactly equal,
2141  greater or equal and strictly greater, respectively.  For example,  greater or equal, and strictly greater, respectively.  For example,
2142  </para>  </para>
2143  <screen>  <screen>
2144  Depends: foo (&gt;= 1.2), libbar1 (= 1.3.4)  Depends: foo (&gt;= 1.2), libbar1 (= 1.3.4)
# Line 2079  The last feature you need to know about Line 2155  The last feature you need to know about
2155  <para>  <para>
2156  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>
2157  <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies  <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies
2158  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
2159  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
2160  substituting <literal>${shlibs:Depends}</literal>.  substituting <literal>${shlibs:Depends}</literal>.
2161  </para>  </para>
2162  <para>  <para>
2163  <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum>
2164  </citerefentry> calculates Perl dependencies.  It generates a list of a  </citerefentry> calculates Perl dependencies.  It generates a list of a
2165  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
2166  substituting <literal>${perl:Depends}</literal>.  substituting <literal>${perl:Depends}</literal>.
2167  </para>  </para>
2168  <para>  <para>
2169  Some <systemitem role="package">debhelper</systemitem> commands may make the  Some <systemitem role="package">debhelper</systemitem> commands may cause the
2170  generated package need to depend on some other packages.  All such commands  generated package to depend on some additional packages.  All such commands
2171  generate a list of required packages for each binary package.  generate a list of required packages for each binary package.
2172  Such list is used for substituting <literal>${misc:Depends}</literal>.  This list is used for substituting <literal>${misc:Depends}</literal>.
2173  </para>  </para>
2174  <para>  <para>
2175  <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>  <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>
# Line 2106  substituting <literal>${shlibs:Depends}< Line 2182  substituting <literal>${shlibs:Depends}<
2182  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
2183  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:
2184  file</literal>, because <systemitem role="package">gentoo</systemitem> can use  file</literal>, because <systemitem role="package">gentoo</systemitem> can use
2185  some features provided by that <systemitem role="package">file</systemitem>  some features provided by the <systemitem role="package">file</systemitem>
2186  package.  package.
2187  </para>  </para>
2188  <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
2189  <ulink url="&gentoo;"/>.  <ulink url="&gentoo;"/>.
2190  </para>  </para>
2191  <para>  <para>
2192  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
2193  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
2194  <literal>fully GUI-configurable, two-pane X file manager</literal>.  <literal>fully GUI-configurable, two-pane X file manager</literal>.
2195  </para>  </para>
# Line 2127  English.  Translations of these descript Line 2203  English.  Translations of these descript
2203  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>
2204  </para>  </para>
2205  <para>  <para>
2206  Let's insert <literal>Vcs-*</literal> fields to document the Version Control  We can insert <literal>Vcs-*</literal> fields to document the Version Control
2207  System (VCS) location between line 6 and 7.  System (VCS) location between lines 6 and 7.
2208  <footnote><para>See  <footnote><para>See
2209  <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>.
2210  </para></footnote>  </para></footnote>
2211  Let's assume that the <systemitem role="package">gentoo</systemitem>  Let's assume that the <systemitem role="package">gentoo</systemitem>
2212  package has its VCS located in Debian Alioth Git Service at  package has its VCS located in the Debian Alioth Git Service at
2213  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.
2214  </para>  </para>
2215  <para>  <para>
# Line 2161  Finally, here is the updated <filename>c Line 2237  Finally, here is the updated <filename>c
2237  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.
2238  20  .  20  .
2239  21  gentoo features a fairly complex and powerful file identification system,  21  gentoo features a fairly complex and powerful file identification system,
2240  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
2241  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.
2242  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
2243  25  type descriptions.  25  type descriptions.
2244  26  .  26  .
2245  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
2246  30  for its interface.  30  for its interface.
2247  </screen>  </screen>
2248  <para>  <para>
2249  (I've added the line numbers.)  (I've added the line numbers.)
2250  </para>  </para>
2251  </section>  </section>
2252  <section id="copyright"><title><filename>copyright</filename> file</title>  <section id="copyright"><title><filename>copyright</filename></title>
2253  <para>  <para>
2254  This file contains the information about package upstream resources, copyright  This file contains information about the copyright and license of the upstream sources.
2255  and license information.  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink>
2256  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink>  dictates its content and
2257  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>  
2258  provides guidelines for its format.  provides guidelines for its format.
2259  </para>  </para>
2260  <para>  <para>
# Line 2188  provides guidelines for its format. Line 2263  provides guidelines for its format.
2263  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.
2264  </para>  </para>
2265  <para>  <para>
2266  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
2267  from, the actual copyright notice and their license to complete this file.  For  from, the actual copyright notice, and the license.  For certain
2268  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,
2269  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
2270  license, you can just refer to the appropriate file in  license), you can just refer to the appropriate file in the
2271  <filename>/usr/share/common-licenses/</filename> directory that exists on every  <filename>/usr/share/common-licenses/</filename> directory that exists on every
2272  Debian system.  Otherwise, you must include the complete license.  Debian system.  Otherwise, you must include the complete license.
2273  </para>  </para>
2274  <para>  <para>
2275  In short, here's how <systemitem role="package">gentoo</systemitem>'s  In short, here's what <systemitem role="package">gentoo</systemitem>'s
2276  <filename>copyright</filename> file should look like:  <filename>copyright</filename> file should look like:
2277  </para>  </para>
2278  <screen>  <screen>
# Line 2227  In short, here's how <systemitem role="p Line 2302  In short, here's how <systemitem role="p
2302  24  but WITHOUT ANY WARRANTY; without even the implied warranty of  24  but WITHOUT ANY WARRANTY; without even the implied warranty of
2303  25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  25  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2304  26  GNU General Public License for more details.  26  GNU General Public License for more details.
2305  27 .  27  .
2306  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
2307  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.,
2308  30  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  30  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
# Line 2240  In short, here's how <systemitem role="p Line 2315  In short, here's how <systemitem role="p
2315  (I've added the line numbers.)  (I've added the line numbers.)
2316  </para>  </para>
2317  <para>  <para>
2318  Please follow the HOWTO provided by ftpmasters and sent to  Please follow the HOWTO provided by the ftpmasters and sent to
2319  debian-devel-announce: <ulink url="&howto-copyright;"/>.  debian-devel-announce: <ulink url="&howto-copyright;"/>.
2320  </para>  </para>
2321  </section>  </section>
2322  <section id="changelog"><title><filename>changelog</filename> file</title>  <section id="changelog"><title><filename>changelog</filename></title>
2323  <para>  <para>
2324  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
2325  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.
2326  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
2327  version number, revision, distribution and urgency of your package.  version number, revision, distribution, and urgency of your package.
2328  </para>  </para>
2329  <para>  <para>
2330  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 2259  saved as <filename>/usr/share/doc/gentoo Line 2334  saved as <filename>/usr/share/doc/gentoo
2334  binary package.  binary package.
2335  </para>  </para>
2336  <para>  <para>
2337  <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
2338  like:  like:
2339  </para>  </para>
2340  <screen>  <screen>
# Line 2275  like: Line 2350  like:
2350  </para>  </para>
2351  <para>  <para>
2352  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
2353  match the source package name, distribution should be either  match the source package name; distribution should be
2354  <literal>unstable</literal> (or even <literal>experimental</literal>)  <literal>unstable</literal> (or even <literal>experimental</literal>)
2355  <footnote><para> Some people use invalid distribution values such as  <footnote><para> Some people use invalid distribution values such as
2356  <literal>UNRELEASED</literal> to prevent a package to be accidentally uploaded  <literal>UNRELEASED</literal> to prevent a package being accidentally uploaded
2357  when updating a package in a shared VCS.  </para> </footnote>, and urgency  when updating a package in a shared VCS.  </para> </footnote>, and urgency
2358  shouldn't be changed to anything higher than <literal>low</literal>.  :-)  shouldn't be changed to anything higher than <literal>low</literal>.  :-)
2359  </para>  </para>
2360  <para>  <para>
2361  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
2362  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,
2363  created by the upstream authors, which you will later install as  created by the upstream authors, which you will later install as
2364  <filename>/usr/share/doc/gentoo/changelog.gz</filename>).  Let's assume your  <filename>/usr/share/doc/gentoo/changelog.gz</filename>).  Let's assume your
2365  ITP (Intent To Package) bug report number was <literal>12345</literal>.  New  ITP (Intent To Package) bug report number was <literal>12345</literal>.  New
2366  lines must be inserted just before the uppermost line that begins with  lines must be inserted just below the uppermost line that begins with
2367  <literal>*</literal> (asterisk).  You can do it with <citerefentry>  <literal>*</literal> (asterisk).  You can do it with <citerefentry>
2368  <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or  <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or
2369  manually with a text editor.  manually with a text editor.
# Line 2314  You can read more about updating the <fi Line 2389  You can read more about updating the <fi
2389  in <xref linkend="update"/>.  in <xref linkend="update"/>.
2390  </para>  </para>
2391  </section>  </section>
2392  <section id="rules"><title><filename>rules</filename> file</title>  <section id="rules"><title><filename>rules</filename></title>
2393  <para>  <para>
2394  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>
2395  <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum>
2396  </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
2397  another <filename>Makefile</filename>, but different from the one(s) in the  another <filename>Makefile</filename>, but different from the one(s) in the
2398  upstream source.  Unlike other files in <filename>debian</filename>, this one  upstream source.  Unlike other files in <filename>debian</filename>, this one
2399  is marked as executable.  is marked as executable.
2400  </para>  </para>
2401  <section id="targets"><title>Targets of <filename>rules</filename> file</title>  <section id="targets"><title>Targets of the <filename>rules</filename> file</title>
2402  <para>  <para>
2403  Every <filename>rules</filename> file, as any other  Every <filename>rules</filename> file, like any other
2404  <filename>Makefile</filename>, consists of several targets and their rules  <filename>Makefile</filename>, consists of several rules, each of
2405  specifying how to handle the source.  <ulink url="&policy-debianrules;">Debian  which defines a target and how it is carried out.
2406  Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains its  <footnote><para>You can start learning how to write <filename>Makefile</filename> from
2407  details.  <ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>.
2408    The full documentation is available as
2409    <ulink url="&gnu-make;"></ulink> or as the
2410    <systemitem role="package">make-doc</systemitem> package in the <literal>non-free</literal> archive area.
2411    </para></footnote>
2412    A new rule begins with its target declaration in the first column.  The
2413    following lines beginning with the TAB code (ASCII 9) specify the recipe for
2414    carrying out that target.
2415    Empty lines and lines beginning with <literal>#</literal> (hash) are treated as
2416    comments and ignored.
2417    <footnote><para><ulink url="&policy-debianrules;">Debian
2418    Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains the
2419    details.</para></footnote>
2420    </para>
2421    <para>
2422    A rule that you want to execute is invoked by its target name as a command line argument.  For
2423    example, <literal>debian/rules <replaceable>build</replaceable></literal> and
2424    <literal>fakeroot make -f debian/rules <replaceable>binary</replaceable></literal>
2425    execute rules for <literal><replaceable>build</replaceable></literal> and
2426    <literal><replaceable>binary</replaceable></literal> targets respectively.
2427  </para>  </para>
2428  <para>  <para>
2429  The simplified explanation of targets are the following.  Here is a simplified explanation of the targets:
2430  </para>  </para>
2431  <itemizedlist>  <itemizedlist>
2432  <listitem>  <listitem>
2433  <para>  <para>
2434  <literal>clean</literal> target: to clean all compiled, generated, and useless  <literal>clean</literal> target: to clean all compiled, generated, and useless
2435  files in the build-tree.  (required)  files in the build-tree.  (Required)
2436  </para>  </para>
2437  </listitem>  </listitem>
2438  <listitem>  <listitem>
2439  <para>  <para>
2440  <literal>build</literal> target: to build the source into compiled programs and  <literal>build</literal> target: to build the source into compiled programs and
2441  formatted documents in the build-tree.  (required)  formatted documents in the build-tree.  (Required)
2442  </para>  </para>
2443  </listitem>  </listitem>
2444  <listitem>  <listitem>
# Line 2352  formatted documents in the build-tree. Line 2446  formatted documents in the build-tree.
2446  <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
2447  binary package under the <filename>debian</filename> directory.  If defined,  binary package under the <filename>debian</filename> directory.  If defined,
2448  <literal>binary*</literal> targets effectively depend on this target.  <literal>binary*</literal> targets effectively depend on this target.
2449  (optional)  (Optional)
2450  </para>  </para>
2451  </listitem>  </listitem>
2452  <listitem>  <listitem>
2453  <para>  <para>
2454  <literal>binary</literal> target: to create all binary packages (effectively  <literal>binary</literal> target: to create all binary packages (effectively
2455  combination of <literal>binary-arch</literal> and  a combination of <literal>binary-arch</literal> and
2456  <literal>binary-indep</literal> targets).  (required)<footnote><para> This  <literal>binary-indep</literal> targets).  (Required)<footnote><para> This
2457  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>
2458  </para>  </para>
2459  </listitem>  </listitem>
# Line 2367  target is used by <literal>dpkg-buildpac Line 2461  target is used by <literal>dpkg-buildpac
2461  <para>  <para>
2462  <literal>binary-arch</literal> target: to create arch-dependent  <literal>binary-arch</literal> target: to create arch-dependent
2463  (<literal>Architecture: any</literal>) binary packages in the parent directory.  (<literal>Architecture: any</literal>) binary packages in the parent directory.
2464  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage  (Required)<footnote><para> This target is used by <literal>dpkg-buildpackage
2465  -B</literal> as in <xref linkend="autobuilder"/>.  </para> </footnote>  -B</literal> as in <xref linkend="autobuilder"/>.  </para> </footnote>
2466  </para>  </para>
2467  </listitem>  </listitem>
# Line 2375  target is used by <literal>dpkg-buildpac Line 2469  target is used by <literal>dpkg-buildpac
2469  <para>  <para>
2470  <literal>binary-indep</literal> target: to create arch-independent  <literal>binary-indep</literal> target: to create arch-independent
2471  (<literal>Architecture: all</literal>) binary packages in the parent directory.  (<literal>Architecture: all</literal>) binary packages in the parent directory.
2472  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage  (Required)<footnote><para> This target is used by <literal>dpkg-buildpackage
2473  -A</literal>.  </para> </footnote>  -A</literal>.  </para> </footnote>
2474  </para>  </para>
2475  </listitem>  </listitem>
2476  <listitem>  <listitem>
2477  <para>  <para>
2478  <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
2479  the original source package from upstream archive site.  (optional)  the original source package from an upstream archive.  (Optional)
2480  </para>  </para>
2481  </listitem>  </listitem>
2482  </itemizedlist>  </itemizedlist>
2483  <para>  <para>
2484  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  
2485  <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
2486  default.  You should also read <literal>info make</literal> for more  default.
 information.  
2487  </para>  </para>
2488  </section>  </section>
2489  <section id="defaultrules"><title>Default <filename>rules</filename> file</title>  <section id="defaultrules"><title>Default <filename>rules</filename> file</title>
# Line 2425  Newer <command>dh_make</command> generat Line 2508  Newer <command>dh_make</command> generat
2508  </screen>  </screen>
2509  <para>  <para>
2510  (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,
2511  the leading white spaces are TAB codes.)  the leading spaces are a TAB code.)
2512  </para>  </para>
2513  <para>  <para>
2514  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 2433  It tells the operating system that this Line 2516  It tells the operating system that this
2516  <filename>/usr/bin/make</filename>.  <filename>/usr/bin/make</filename>.
2517  </para>  </para>
2518  <para>  <para>
2519  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,
2520  Then, the <command>dh</command> command will output which  so that the <command>dh</command> command outputs which
2521  <command>dh_*</command> commands are executed by the <command>dh</command>  <command>dh_*</command> commands it is executing.
2522  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,
2523  Then each <command>dh_*</command> command will output which commands are  so that each <command>dh_*</command> command outputs which commands it
2524  executed by each <command>dh_*</command> command.  This helps you to understand  is executing.  This helps you to understand
2525  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
2526  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
2527  <systemitem role="package">debhelper</systemitem> tools and does not hide  <systemitem role="package">debhelper</systemitem> tools, and not to hide
2528  anything from you.  anything from you.
2529  </para>  </para>
2530  <para>  <para>
2531  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
2532  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
2533  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
2534  explained in <ulink url="&debhelper-slides;">Not Your  explained in <ulink url="&debhelper-slides;">Not Your
2535  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
2536  <literal>lenny</literal>, <command>dh_make</command> created a much more  <literal>lenny</literal>, <command>dh_make</command> created a much more
2537  complicated <filename>rules</filename> file with many <command>dh_*</command>  complicated <filename>rules</filename> file with explicit rules
2538  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
2539  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
2540  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
2541  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
2542  package building process like the <systemitem role="package">cdbs</systemitem>  package building process as the <systemitem role="package">cdbs</systemitem>
2543  package.  </para> </footnote> The <command>dh</command> command is a wrapper  package tends to.  </para> </footnote> The <command>dh</command> command is a wrapper
2544  script which runs appropriate sequences of <command>dh_*</command> programs  script which runs appropriate sequences of <command>dh_*</command> programs
2545  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
2546  <command>dh_*</command> programs invoked for a given  <command>dh_*</command> programs invoked for a given
2547  <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
2548  <replaceable>target</replaceable></literal> or <literal>debian/rules --  <replaceable>target</replaceable></literal> or <literal>debian/rules --
2549  '--no-act <replaceable>target</replaceable>'</literal> without really running  '--no-act <replaceable>target</replaceable>'</literal>.  </para> </footnote>
 them.  </para> </footnote>  
2550  </para>  </para>
2551  <itemizedlist>  <itemizedlist>
2552  <listitem>  <listitem>
2553  <para>  <para>
2554  <literal>debian/rules clean</literal> runs <literal>dh clean</literal>; which  <literal>debian/rules clean</literal> runs <literal>dh clean</literal>, which
2555  in turn runs the following:  in turn runs the following:
2556  </para>  </para>
2557  <screen>  <screen>
# Line 2493  dh_auto_test Line 2575  dh_auto_test
2575  <listitem>  <listitem>
2576  <para>  <para>
2577  <literal>fakeroot debian/rules binary</literal> runs <literal>fakeroot dh  <literal>fakeroot debian/rules binary</literal> runs <literal>fakeroot dh
2578  binary</literal>; which in turn runs the following<footnote><para> This assumes  binary</literal>; which in turn runs the following<footnote><para>The following
2579  that the <systemitem role="package">python-support</systemitem> package is  example assumes your <filename>debian/compat</filename> has a value equal or
2580  installed on the system.  </para> </footnote>:  more than 9 to avoid invoking any python support commands automatically.
2581    </para>
2582    </footnote>:
2583  </para>  </para>
2584  <screen>  <screen>
2585  dh_testroot  dh_testroot
# Line 2513  dh_installdebconf Line 2597  dh_installdebconf
2597  dh_installemacsen  dh_installemacsen
2598  dh_installifupdown  dh_installifupdown
2599  dh_installinfo  dh_installinfo
 dh_pysupport  
2600  dh_installinit  dh_installinit
2601  dh_installmenu  dh_installmenu
2602  dh_installmime  dh_installmime
# Line 2563  for each remaining command. Line 2646  for each remaining command.
2646  </listitem>  </listitem>
2647  </itemizedlist>  </itemizedlist>
2648  <para>  <para>
2649  The function of <command>dh_*</command> commands are almost self-evident from  The functions of <command>dh_*</command> commands are largely self-evident from
2650  their names.  <footnote><para> For complete information on what do all these  their names.  <footnote><para> For complete information on what all these
2651  <command>dh_*</command> scripts exactly do, and what their other options are,  <command>dh_*</command> scripts do exactly, and what their other options are,
2652  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
2653  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
2654  typical build environment based on <filename>Makefile</filename>.  a typical build environment based on a <filename>Makefile</filename>.
2655  <footnote><para> These commands support other build environments such as  <footnote><para> These commands support other build environments such as
2656  <filename>setup.py</filename> which can be listed by executing  <filename>setup.py</filename> which can be listed by executing
2657  <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 2577  typical build environment based on <file Line 2660  typical build environment based on <file
2660  <itemizedlist>  <itemizedlist>
2661  <listitem>  <listitem>
2662  <para>  <para>
2663  <command>dh_auto_clean</command> usually executes the following if  <command>dh_auto_clean</command> usually executes the following if a
2664  <filename>Makefile</filename> exists with the <literal>distclean</literal>  <filename>Makefile</filename> exists with the <literal>distclean</literal>
2665  target.  <footnote><para> It actually looks for the first available target of  target.  <footnote><para> It actually looks for the first available target
2666  <literal>distclean</literal>, <literal>realclean</literal> or  in the <filename>Makefile</filename> out of
2667  <literal>clean</literal> in <filename>Makefile</filename> and execute it.  <literal>distclean</literal>, <literal>realclean</literal>, or
2668    <literal>clean</literal>, and executes that.
2669  </para> </footnote>  </para> </footnote>
2670  </para>  </para>
2671  <screen>  <screen>
# Line 2609  make Line 2693  make
2693  </listitem>  </listitem>
2694  <listitem>  <listitem>
2695  <para>  <para>
2696  <command>dh_auto_test</command> usually executes the following if  <command>dh_auto_test</command> usually executes the following if a
2697  <filename>Makefile</filename> exists with the <literal>test</literal> target.  <filename>Makefile</filename> exists with the <literal>test</literal> target.
2698  <footnote><para> It actually looks for the first available target of  <footnote><para> It actually looks for the first available target in
2699  <literal>test</literal> or <literal>check</literal> in  the <filename>Makefile</filename> out of <literal>test</literal> or
2700  <filename>Makefile</filename> and execute it.  </para> </footnote>  <literal>check</literal>, and executes that.</para> </footnote>
2701  </para>  </para>
2702  <screen>  <screen>
2703  make test  make test
# Line 2621  make test Line 2705  make test
2705  </listitem>  </listitem>
2706  <listitem>  <listitem>
2707  <para>  <para>
2708  <command>dh_auto_install</command> usually executes the following if  <command>dh_auto_install</command> usually executes the following if a
2709  <filename>Makefile</filename> exists with the <literal>install</literal> target  <filename>Makefile</filename> exists with the <literal>install</literal> target
2710  (line folded for readability).  (line folded for readability).
2711  </para>  </para>
# Line 2632  make install \ Line 2716  make install \
2716  </listitem>  </listitem>
2717  </itemizedlist>  </itemizedlist>
2718  <para>  <para>
2719  Targets which require the <command>fakeroot</command> command contain  All targets which require the <command>fakeroot</command> command will contain
2720  <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
2721  this command, it exits with an error.  using this command to pretend to be root.
2722  </para>  </para>
2723  <para>  <para>
2724  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
2725  <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
2726  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
2727  fit your needs.  Only things that you must not change are the names of the  fit your needs.
 rules, because all the tools use these names, as mandated by the Debian Policy.  
2728  </para>  </para>
2729  <para>  <para>
2730  Although <literal>install</literal> is not required target, it is supported.  Although <literal>install</literal> is not a required target, it is supported.
2731  <literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh  <literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh
2732  binary</literal> but stops after <command>dh_fixperms</command>.  binary</literal> but stops after <command>dh_fixperms</command>.
2733  </para>  </para>
# Line 2658  with the new <command>dh</command> comma Line 2741  with the new <command>dh</command> comma
2741  The <literal>dh $@</literal> command can be customized as follows.  The <literal>dh $@</literal> command can be customized as follows.
2742  <footnote><para> If a package installs the  <footnote><para> If a package installs the
2743  <filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename>  <filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename>
2744  file, you should activate its customization function by <literal>dh --with  file, you should activate its customization function by <literal>dh $@ --with
2745  <replaceable>custom-name</replaceable> $@</literal>.  </para> </footnote>  <replaceable>custom-name</replaceable></literal>.  </para> </footnote>
2746  </para>  </para>
2747  <itemizedlist>  <itemizedlist>
2748  <listitem>  <listitem>
2749  <para>  <para>
2750  Add support of the <command>dh_pysupport</command> command.  (The best choice  Add support for the <command>dh_python2</command> command.  (The best choice
2751  for Python.) <footnote><para> Use of the <command>dh_pysupport</command>  for Python.) <footnote><para> Use of the <command>dh_python2</command> command
2752  command is preferred over use of the <command>dh_pycentral</command> command.  is preferred over use of <command>dh_pysupport</command> or
2753  Do not use the <command>dh_python</command> command.  </para> </footnote>  <command>dh_pycentral</command> commands.  Do not use the
2754    <command>dh_python</command> command.  </para> </footnote>
2755  </para>  </para>
2756  <itemizedlist>  <itemizedlist>
2757  <listitem>  <listitem>
2758  <para>  <para>
2759  Install the <systemitem role="package">python-support</systemitem> package in  Include the <systemitem role="package">python</systemitem> package in
2760  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2761  </para>  </para>
2762  </listitem>  </listitem>
2763  <listitem>  <listitem>
2764  <para>  <para>
2765  Use <literal>dh $@</literal> as usual.  (This is enabled by default)  Use <literal>dh $@ --with python2</literal>.
2766    </para>
2767    </listitem>
2768    <listitem>
2769    <para>
2770    This handles Python modules using the <systemitem role="package">python</systemitem> framework.
2771    </para>
2772    </listitem>
2773    </itemizedlist>
2774    </listitem>
2775    <listitem>
2776    <para>
2777    Add support for the <command>dh_pysupport</command> command. (deprecated)
2778    </para>
2779    <itemizedlist>
2780    <listitem>
2781    <para>
2782    Include the <systemitem role="package">python-support</systemitem> package in
2783    <literal>Build-Depends</literal>.
2784    </para>
2785    </listitem>
2786    <listitem>
2787    <para>
2788    Use <literal>dh $@ --with pysupport</literal>.
2789  </para>  </para>
2790  </listitem>  </listitem>
2791  <listitem>  <listitem>
# Line 2690  This handles Python modules using the <s Line 2797  This handles Python modules using the <s
2797  </listitem>  </listitem>
2798  <listitem>  <listitem>
2799  <para>  <para>
2800  Add support of the <command>dh_pycentral</command> command.  Add support for the <command>dh_pycentral</command> command. (deprecated)
2801  </para>  </para>
2802  <itemizedlist>  <itemizedlist>
2803  <listitem>  <listitem>
2804  <para>  <para>
2805  Install the <systemitem role="package">python-central</systemitem> package in  Include the <systemitem role="package">python-central</systemitem> package in
2806  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2807  </para>  </para>
2808  </listitem>  </listitem>
2809  <listitem>  <listitem>
2810  <para>  <para>
2811  Use <literal>dh --with python-central $@</literal> instead.  Use <literal>dh $@ --with python-central</literal> instead.
2812  </para>  </para>
2813  </listitem>  </listitem>
2814  <listitem>  <listitem>
# Line 2718  This handles Python modules using the <s Line 2825  This handles Python modules using the <s
2825  </listitem>  </listitem>
2826  <listitem>  <listitem>
2827  <para>  <para>
2828  Add support of the <command>dh_installtex</command> command.  Add support for the <command>dh_installtex</command> command.
2829  </para>  </para>
2830  <itemizedlist>  <itemizedlist>
2831  <listitem>  <listitem>
2832  <para>  <para>
2833  Install the <systemitem role="package">tex-common</systemitem> package in  Include the <systemitem role="package">tex-common</systemitem> package in
2834  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2835  </para>  </para>
2836  </listitem>  </listitem>
2837  <listitem>  <listitem>
2838  <para>  <para>
2839  Use <literal>dh --with tex $@</literal> instead.  Use <literal>dh $@ --with tex</literal> instead.
2840  </para>  </para>
2841  </listitem>  </listitem>
2842  <listitem>  <listitem>
2843  <para>  <para>
2844  This registers Type 1 fonts, hyphenation patterns, or formats with TeX.  This registers Type 1 fonts, hyphenation patterns, and formats with TeX.
2845  </para>  </para>
2846  </listitem>  </listitem>
2847  </itemizedlist>  </itemizedlist>
2848  </listitem>  </listitem>
2849  <listitem>  <listitem>
2850  <para>  <para>
2851  Add support of the <command>dh_quilt_patch</command> and  Add support for the <command>dh_quilt_patch</command> and
2852  <command>dh_quilt_unpatch</command> commands.  <command>dh_quilt_unpatch</command> commands.
2853  </para>  </para>
2854  <itemizedlist>  <itemizedlist>
2855  <listitem>  <listitem>
2856  <para>  <para>
2857  Install the <systemitem role="package">quilt</systemitem> package in  Include the <systemitem role="package">quilt</systemitem> package in
2858  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2859  </para>  </para>
2860  </listitem>  </listitem>
2861  <listitem>  <listitem>
2862  <para>  <para>
2863  Use <literal>dh --with quilt $@</literal> instead.  Use <literal>dh $@ --with quilt</literal> instead.
2864  </para>  </para>
2865  </listitem>  </listitem>
2866  <listitem>  <listitem>
2867  <para>  <para>
2868  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
2869  <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.  
2870  </para>  </para>
2871  </listitem>  </listitem>
2872  <listitem>  <listitem>
2873  <para>  <para>
2874  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
2875  package.  package format.
2876  </para>  </para>
2877  </listitem>  </listitem>
2878  </itemizedlist>  </itemizedlist>
2879  </listitem>  </listitem>
2880  <listitem>  <listitem>
2881  <para>  <para>
2882  Add support of the <command>dh_dkms</command> command.  Add support for the <command>dh_dkms</command> command.
2883  </para>  </para>
2884  <itemizedlist>  <itemizedlist>
2885  <listitem>  <listitem>
2886  <para>  <para>
2887  Install the <systemitem role="package">dkms</systemitem> package in  Include the <systemitem role="package">dkms</systemitem> package in
2888  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2889  </para>  </para>
2890  </listitem>  </listitem>
2891  <listitem>  <listitem>
2892  <para>  <para>
2893  Use <literal>dh --with dkms $@</literal> instead.  Use <literal>dh $@ --with dkms</literal> instead.
2894  </para>  </para>
2895  </listitem>  </listitem>
2896  <listitem>  <listitem>
2897  <para>  <para>
2898  This correctly handles DKMS usage by the kernel module package.  This correctly handles DKMS usage by kernel module packages.
2899  </para>  </para>
2900  </listitem>  </listitem>
2901  </itemizedlist>  </itemizedlist>
2902  </listitem>  </listitem>
2903  <listitem>  <listitem>
2904  <para>  <para>
2905  Add support of the <command>dh_autotools-dev_updateconfig</command> and  Add support for the <command>dh_autotools-dev_updateconfig</command> and
2906  <command>dh_autotools-dev_restoreconfig</command> commands.  <command>dh_autotools-dev_restoreconfig</command> commands.
2907  </para>  </para>
2908  <itemizedlist>  <itemizedlist>
2909  <listitem>  <listitem>
2910  <para>  <para>
2911  Install the <systemitem role="package">autotools-dev</systemitem> package in  Include the <systemitem role="package">autotools-dev</systemitem> package in
2912  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2913  </para>  </para>
2914  </listitem>  </listitem>
2915  <listitem>  <listitem>
2916  <para>  <para>
2917  Use <literal>dh --with autotools-dev $@</literal> instead.  Use <literal>dh $@ --with autotools-dev</literal> instead.
2918  </para>  </para>
2919  </listitem>  </listitem>
2920  <listitem>  <listitem>
# Line 2821  This updates and restores <filename>conf Line 2927  This updates and restores <filename>conf
2927  </listitem>  </listitem>
2928  <listitem>  <listitem>
2929  <para>  <para>
2930  Add support of the <command>dh_autoreconf</command> and  Add support for the <command>dh_autoreconf</command> and
2931  <command>dh_autoreconf_clean</command> commands.  <command>dh_autoreconf_clean</command> commands.
2932  </para>  </para>
2933  <itemizedlist>  <itemizedlist>
2934  <listitem>  <listitem>
2935  <para>  <para>
2936  Install the <systemitem role="package">dh-autoreconf</systemitem> package in  Include the <systemitem role="package">dh-autoreconf</systemitem> package in
2937  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2938  </para>  </para>
2939  </listitem>  </listitem>
2940  <listitem>  <listitem>
2941  <para>  <para>
2942  Use <literal>dh --with autoreconf $@</literal> instead.  Use <literal>dh $@ --with autoreconf</literal> instead.
2943  </para>  </para>
2944  </listitem>  </listitem>
2945  <listitem>  <listitem>
# Line 2845  This updates the GNU Build System files Line 2951  This updates the GNU Build System files
2951  </listitem>  </listitem>
2952  <listitem>  <listitem>
2953  <para>  <para>
2954  Add support to the <command>bash</command> completion feature.  Add support for the <command>bash</command> completion feature.
2955  </para>  </para>
2956  <itemizedlist>  <itemizedlist>
2957  <listitem>  <listitem>
2958  <para>  <para>
2959  Install the <systemitem role="package">bash-completion</systemitem> package in  Includes the <systemitem role="package">bash-completion</systemitem> package in
2960  <literal>Build-Depends</literal>.  <literal>Build-Depends</literal>.
2961  </para>  </para>
2962  </listitem>  </listitem>
2963  <listitem>  <listitem>
2964  <para>  <para>
2965  Use <literal>dh --with bash-completion $@</literal> instead.  Use <literal>dh $@ --with bash-completion</literal> instead.
2966  </para>  </para>
2967  </listitem>  </listitem>
2968  <listitem>  <listitem>
2969  <para>  <para>
2970  This installs <command>bash</command> completions using configuration file at  This installs <command>bash</command> completions using a configuration file at
2971  <filename>debian/<replaceable>package</replaceable>.bash-completion</filename>.  <filename>debian/<replaceable>package</replaceable>.bash-completion</filename>.
2972  </para>  </para>
2973  </listitem>  </listitem>
# Line 2875  command can be customized by the corresp Line 2981  command can be customized by the corresp
2981  manpage of each command for the customization of such features.  manpage of each command for the customization of such features.
2982  </para>  </para>
2983  <para>  <para>
2984  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>
2985  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.
2986  commands with them or to skip them.  For such cases, you create an  For such cases, you create an
2987  <literal>override_dh_<replaceable>foo</replaceable></literal> target with its  <literal>override_dh_<replaceable>foo</replaceable></literal> target with its
2988  rule in the <filename>rules</filename> file only for the  rule in the <filename>rules</filename> file defining an
2989    <literal>override_dh_<replaceable>foo</replaceable></literal> target for the
2990  <command>dh_<replaceable>foo</replaceable></command> command you want to  <command>dh_<replaceable>foo</replaceable></command> command you want to
2991  change.  It basically say <emphasis>run me instead</emphasis>.  change.  It basically says <emphasis>run me instead</emphasis>.
2992  <footnote><para> Under <literal>lenny</literal>, if you wanted to change the  <footnote><para> Under <literal>lenny</literal>, if you wanted to change the
2993  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
2994  <filename>rules</filename> file and adjusted it.  </para> </footnote>  <filename>rules</filename> file and adjusted it.  </para> </footnote>
2995  </para>  </para>
2996  <para>  <para>
2997  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
2998  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
2999  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
3000  <literal>override_dh_*</literal> targets except the  to substitute simplified equivalent commands (except for the
3001  <literal>override_dh_auto_clean</literal> target is a bad idea since it may  <literal>override_dh_auto_clean</literal> target) since it may
3002  kill such <systemitem role="package">debhelper</systemitem>'s smart features.  bypass such smart <systemitem role="package">debhelper</systemitem> features.
3003  </para>  </para>
3004  <para>  <para>
3005  If you want to store the system configuration data in the  So, for instance, if you want to store system configuration data in the
3006  <filename>/etc/gentoo</filename> directory instead of the usual  <filename>/etc/gentoo</filename> directory instead of the usual
3007  <filename>/etc</filename> directory for the recent  <filename>/etc</filename> directory for the recent
3008  <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 2910  override_dh_auto_configure: Line 3017  override_dh_auto_configure:
3017  <para>  <para>
3018  The arguments given after <literal>--</literal> are appended to the default  The arguments given after <literal>--</literal> are appended to the default
3019  arguments of the auto-executed program to override them.  Using the  arguments of the auto-executed program to override them.  Using the
3020  <command>dh_auto_configure</command> command is better than the  <command>dh_auto_configure</command> command is better than directly invoking the
3021  <command>./configure</command> command here since it will only override the  <command>./configure</command> command here since it will only override the
3022  <literal>--sysconfig</literal> argument and keeps well intended other arguments  <literal>--sysconfig</literal> argument and retains any other, benign arguments
3023  to the <command>./configure</command> command.  to the <command>./configure</command> command.
3024  </para>  </para>
3025  <para>  <para>
3026  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
3027  <literal>build</literal> as its target to build it <footnote><para>  <literal>build</literal> as its target to build it <footnote><para>
3028  <command>dh_auto_build</command> without any arguments will execute the first  <command>dh_auto_build</command> without any arguments will execute the first
3029  target in the <filename>Makefile</filename> file.  </para> </footnote>, you  target in the <filename>Makefile</filename>.  </para> </footnote>, you
3030  create an <literal>override_dh_auto_build</literal> target to enable it.  create an <literal>override_dh_auto_build</literal> target to enable this.
3031  </para>  </para>
3032  <screen>  <screen>
3033  override_dh_auto_build:  override_dh_auto_build:
3034          dh_auto_build -- build          dh_auto_build -- build
3035  </screen>  </screen>
3036  <para>  <para>
3037  This ensures to run $(MAKE) with all the default arguments given by the  This ensures <literal>$(MAKE)</literal> is run with all the default arguments given by the
3038  <command>dh_auto_build</command> command and <literal>build</literal> argument.  <command>dh_auto_build</command> command plus the <literal>build</literal> argument.
3039  </para>  </para>
3040  <para>  <para>
3041  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
3042  <literal>packageclean</literal> target to clean it for Debian package instead  <literal>packageclean</literal> target to clean it for the Debian package instead
3043  of the <literal>distclean</literal> or <literal>clean</literal> targets in the  of using <literal>distclean</literal> or <literal>clean</literal> targets,
3044  <filename>Makefile</filename> file, you create an  you can create an
3045  <literal>override_dh_auto_clean</literal> target to enable it.  <literal>override_dh_auto_clean</literal> target to enable thit.
3046  </para>  </para>
3047  <screen>  <screen>
3048  override_dh_auto_clean:  override_dh_auto_clean:
3049          $(MAKE) packageclean          $(MAKE) packageclean
3050  </screen>  </screen>
3051  <para>  <para>
3052  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
3053  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
3054  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.
3055  </para>  </para>
3056  <screen>  <screen>
3057  override_dh_auto_test:  override_dh_auto_test:
# Line 2956  changelog file called <filename>FIXES</f Line 3063  changelog file called <filename>FIXES</f
3063  The <command>dh_installchangelogs</command> command requires  The <command>dh_installchangelogs</command> command requires
3064  <filename>FIXES</filename> as its argument to install it.  <footnote><para> The  <filename>FIXES</filename> as its argument to install it.  <footnote><para> The
3065  <filename>debian/changelog</filename> and <filename>debian/NEWS</filename>  <filename>debian/changelog</filename> and <filename>debian/NEWS</filename>
3066  files are always automatically installed.  The upstream changelog is searched  files are always automatically installed.  The upstream changelog is found
3067  by converting filenames to the lower case and matching them with the  by converting filenames to lower case and matching them against
3068  <filename>changelog</filename>, <filename>changes</filename>,  <filename>changelog</filename>, <filename>changes</filename>,
3069  <filename>changelog.txt</filename>, and <filename>changes.txt</filename>.  <filename>changelog.txt</filename>, and <filename>changes.txt</filename>.
3070  </para> </footnote>  </para> </footnote>
# Line 2968  override_dh_installchangelogs: Line 3075  override_dh_installchangelogs:
3075  </screen>  </screen>
3076  <para>  <para>
3077  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
3078  such as the ones listed in <xref linkend="targets"/> except  such as the ones listed in <xref linkend="targets"/>, other than the
3079  <literal>get-orig-source</literal> target may make it difficult to understand  <literal>get-orig-source</literal> target, may make it difficult to understand
3080  their exact effects.  Please limit explicit targets to  their exact effects.  Please limit explicit targets to
3081  <literal>override_dh_*</literal> targets and completely independent ones, if  <literal>override_dh_*</literal> targets and completely independent ones, if
3082  possible.  possible.
# Line 2995  prefixed by the binary package name such Line 3102  prefixed by the binary package name such
3102  them.  them.
3103  <footnote><para>  <footnote><para>
3104  In this chapter, files in the <filename>debian</filename> directory are  In this chapter, files in the <filename>debian</filename> directory are
3105  referred to without the preceding <filename>debian/</filename> for simplicity whenever  referred to without the leading <filename>debian/</filename> for simplicity whenever
3106  they are obvious.  the meaning is obvious.
3107  </para></footnote>  </para></footnote>
3108  </para>  </para>
3109  <para>  <para>
# Line 3359  the installation directory (relative to Line 3466  the installation directory (relative to
3466  src/<replaceable>bar</replaceable> usr/bin  src/<replaceable>bar</replaceable> usr/bin
3467  </screen>  </screen>
3468  <para>  <para>
3469  This means when this package is installed, there will be a binary executable  This means when this package is installed, there will be an executable command
3470  <filename>/usr/bin/<replaceable>bar</replaceable></filename>.  <filename>/usr/bin/<replaceable>bar</replaceable></filename>.
3471  </para>  </para>
3472  <para>  <para>
# Line 3548  override_dh_auto_build: Line 3655  override_dh_auto_build:
3655  </itemizedlist>  </itemizedlist>
3656  </section>  </section>
3657  </section>  </section>
3658  <section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename> file</title>  <section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename></title>
3659  <para>  <para>
3660  If your package has manual pages, you should install them using <citerefentry>  If your package has manual pages, you should install them using <citerefentry>
3661  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum>
# Line 3969  Debian archives.  See Line 4076  Debian archives.  See
4076  <ulink url="&keycreate;">Creating a new GPG key</ulink> and  <ulink url="&keycreate;">Creating a new GPG key</ulink> and
4077  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
4078  </para></footnote>  </para></footnote>
4079    If you are building Debian packages only for your own local use, you can skip
4080    promptings for the GPG signatures on the <filename>.dsc</filename> file and the
4081    <filename>.changes</filename> file like this:
4082  </para>  </para>
4083    <screen>
4084    $ dpkg-buildpackage -us -uc
4085    </screen>
4086  <para>  <para>
4087  After all this is done for the non-native Debian package, you will see the following files in the directory above  For a non-native Debian package, e.g.,
4088  (<filename>~/gentoo</filename>):  <systemitem role="package">gentoo</systemitem>, you will see the following
4089    files in the parent directory (<filename>~/gentoo</filename>) after building
4090    packages:
4091  </para>  </para>
4092  <itemizedlist>  <itemizedlist>
4093  <listitem>  <listitem>
# Line 4056  mentioned.  Anyone downloading your file Line 4171  mentioned.  Anyone downloading your file
4171  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,  <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match,
4172  they'll know the file is corrupt or has been tampered with.  they'll know the file is corrupt or has been tampered with.
4173  </para>  </para>
4174    <para>
4175    For a native Debian package, e.g.,
4176    <systemitem role="package">mypackage</systemitem>, you will see the following
4177    files in the parent directory after building packages:
4178    </para>
4179    <itemizedlist>
4180    <listitem>
4181    <para>
4182    <filename>mypackage_1.0.tar.gz</filename>
4183    </para>
4184    <para>
4185    This is the source code tarball created from the
4186    <filename>mypackage-1.0</filename> directory by the
4187    <command>dpkg-source</command> command.  (Its suffix is not <filename>orig.tar.gz</filename>.)
4188    </para>
4189    </listitem>
4190    <listitem>
4191    <para>
4192    <filename>mypackage_1.0.dsc</filename>
4193    </para>
4194    <para>
4195    This is a summary of the contents of the source code as in the non-native
4196    Debian package. (There is no Debian revision.)
4197    </para>
4198    </listitem>
4199    <listitem>
4200    <para>
4201    <filename>mypackage_1.0_i386.deb</filename>
4202    </para>
4203    <para>
4204    This is your completed binary package as in the non-native Debian package.
4205    (There is no Debian revision.)
4206    </para>
4207    </listitem>
4208    <listitem>
4209    <para>
4210    <filename>mypackage_1.0_i386.changes</filename>
4211    </para>
4212    <para>
4213    This file describes all the changes made in the current package version as in
4214    the non-native Debian package. (There is no Debian revision.)
4215    </para>
4216    </listitem>
4217    </itemizedlist>
4218  </section>  </section>
4219  <section id="autobuilder"><title>Autobuilder</title>  <section id="autobuilder"><title>Autobuilder</title>
4220  <para>  <para>
# Line 4171  Cleaning the source and rebuilding the p Line 4330  Cleaning the source and rebuilding the p
4330  $ debuild  $ debuild
4331  </screen>  </screen>
4332  <para>  <para>
4333  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
4334  <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
4335  source can be specified as:  <filename>.changes</filename> file like this:
4336  </para>  </para>
4337  <screen>  <screen>
4338  $ debuild -sa  $ debuild -us -uc
4339  </screen>  </screen>
4340  <para>  <para>
4341  You can clean the source tree as simply as:  You can clean the source tree as simply as:
# Line 4197  under the <literal>sid</literal> auto-bu Line 4356  under the <literal>sid</literal> auto-bu
4356  avoids a severity serious FTBFS (Fails To Build From Source) bug which is  avoids a severity serious FTBFS (Fails To Build From Source) bug which is
4357  always in the RC (release critical) category.  always in the RC (release critical) category.
4358  <footnote><para>See <ulink url="&buildd-do;"/> for more on  <footnote><para>See <ulink url="&buildd-do;"/> for more on
4359  Debian package auto-building.  Debian package auto-building.</para></footnote>
 .</para></footnote>  
4360  </para>  </para>
4361  <para>  <para>
4362  Let's customize the <systemitem role="package">pbuilder</systemitem> package as  Let's customize the <systemitem role="package">pbuilder</systemitem> package as
# Line 4224  configuring <filename>~/.pbuilderrc</fil Line 4382  configuring <filename>~/.pbuilderrc</fil
4382  <filename>/etc/pbuilderrc</filename> to include the followsing.  <filename>/etc/pbuilderrc</filename> to include the followsing.
4383  </para>  </para>
4384  <screen>  <screen>
4385  AUTO_DEBSIGN=yes  AUTO_DEBSIGN=${AUTO_DEBSIGN:-yes}
4386  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>  HOOKDIR=<replaceable>/var/cache/pbuilder/hooks</replaceable>
4387  </screen>  </screen>
4388  </listitem>  </listitem>
# Line 4251  the local <systemitem role="package">pbu Line 4409  the local <systemitem role="package">pbu
4409  </para>  </para>
4410  <screen>  <screen>
4411  $ sudo pbuilder --update  $ sudo pbuilder --update
4412  $ sudo pbuilder --build <replaceable>foo</replaceable>.dsc  $ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc
4413  </screen>  </screen>
4414  <para>  <para>
4415  Please note that the <command>dpkg-buildpackage</command> option  The newly built packages without the GPG signatures will be located in
4416  <literal>-sa</literal> to include the original <filename>orig.tar.gz</filename>  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.
 source can be specified as:  
4417  </para>  </para>
 <screen>  
 $ sudo pbuilder --build --debbuildopts -sa <replaceable>foo</replaceable>.dsc  
 </screen>  
4418  <para>  <para>
4419  The newly built packages will be located in  The GPG signatures on the <filename>.dsc</filename> file and the
4420  <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.  <filename>.changes</filename> file can be generated as:
4421  </para>  </para>
4422    <screen>
4423    $ cd /var/cache/pbuilder/result/
4424    $ debsign <replaceable>foo_version</replaceable>.dsc
4425    $ debsign <replaceable>foo_version_arch</replaceable>.changes
4426    </screen>
4427  <para>  <para>
4428  If you have an updated source tree but have not generated the matching  If you have an updated source tree but have not generated the matching
4429  source package, issue the following commands in the source directory where the  source package, issue the following commands in the source directory where the
# Line 4275  $ sudo pbuilder --update Line 4434  $ sudo pbuilder --update
4434  $ pdebuild  $ pdebuild
4435  </screen>  </screen>
4436  <para>  <para>
4437  Please note that the <command>dpkg-buildpackage</command> option  Here, if you are building Debian packages only for your local use, you can skip
4438  <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
4439  source can be specified as:  <filename>.changes</filename> file as:
4440  </para>  </para>
4441  <screen>  <screen>
4442  $ pdebuild --debbuildopts -sa  $ AUTO_DEBSIGN=no pdebuild
4443  </screen>  </screen>
4444  <para>  <para>
4445  You can log into its <command>chroot</command> environment with the  You can log into its <command>chroot</command> environment with the
# Line 4325  release for <literal>stable-proposed-upd Line 4484  release for <literal>stable-proposed-upd
4484  restrictions for such updates of your <literal>stable</literal> package.  restrictions for such updates of your <literal>stable</literal> package.
4485  </para> </footnote> For such occasions, the fact you may be running a <literal>sid</literal>  </para> </footnote> For such occasions, the fact you may be running a <literal>sid</literal>
4486  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  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
4487  environments of almost any Debian derivative distribution of the same CPU  environments of almost any Debian derivative distribution of the same
4488  architecture.  architecture.
4489  </para>  </para>
4490  <para>  <para>
# Line 4415  before uploading it to the public archiv Line 4574  before uploading it to the public archiv
4574  It's also a good idea to carry out testing on a machine other than your own.  You must watch  It's also a good idea to carry out testing on a machine other than your own.  You must watch
4575  closely for any warnings or errors for all the tests described here.  closely for any warnings or errors for all the tests described here.
4576  </para>  </para>
4577    <section id="inadvent"><title>Suspicious changes</title>
4578    <para>
4579    If you find a new autogenerated patch file such as
4580    <filename>debian-changes-*</filename> in the
4581    <filename>debian/patches</filename> directory after building your non-native
4582    Debian package in <literal>3.0 (quilt)</literal> format, chances are you
4583    changed some files by accident or the build script modified the upstream
4584    source.  If it is your mistake, fix it.  If it is caused by the build script,
4585    fix the root cause with <command>dh-autoreconf</command> as in
4586    <xref linkend="customrules"/> or work around it with
4587    <filename>source/options</filename> as in <xref linkend="sourceopt"/>.
4588    </para>
4589    </section>
4590  <section id="pinstall"><title>Verifying a package's installation</title>  <section id="pinstall"><title>Verifying a package's installation</title>
4591  <para>  <para>
4592  You must test your package for whether it installs without problem.  The <citerefentry>  You must test your package for whether it installs without problem.  The <citerefentry>
# Line 4429  To prevent installation problem on diffe Line 4601  To prevent installation problem on diffe
4601  sure that there are no filenames conflicting with other existing packages,  sure that there are no filenames conflicting with other existing packages,
4602  using the  using the
4603  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded  <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded
4604  from the Debian archive,  from the Debian archive.
4605  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
4606  are collisions, please take action to avoid this real problem, whether by  are collisions, please take action to avoid this real problem, whether by
4607  renaming the file, moving a common file to a separate package that  renaming the file, moving a common file to a separate package that
# Line 4657  a public archive to share it. Line 4829  a public archive to share it.
4829  <para>  <para>
4830  Once you become an official developer,  Once you become an official developer,
4831  <footnote><para>  <footnote><para>
4832  See <xref linkend="socialdynamism"/>.  See <xref linkend="socialdynamics"/>.
4833  </para></footnote>  </para></footnote>
4834  you can upload the package to the Debian archive.  you can upload the package to the Debian archive.
4835  <footnote><para>  <footnote><para>
# Line 4739  When you first upload the package to the Line 4911  When you first upload the package to the
4911  original <filename>orig.tar.gz</filename> source, too.  If the Debian revision  original <filename>orig.tar.gz</filename> source, too.  If the Debian revision
4912  number of this package is neither <literal>1</literal> nor  number of this package is neither <literal>1</literal> nor
4913  <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command>  <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command>
4914  command with the <literal>-sa</literal> option.  On the other hand, the  option <literal>-sa</literal>.
4915  <literal>-sd</literal> option will force the exclusion of the original  </para>
4916  <filename>orig.tar.gz</filename> source.  <para>
4917    For the <command>dpkg-buildpackage</command> command:
4918    </para>
4919    <screen>
4920    $ dpkg-buildpackage -sa
4921    </screen>
4922    <para>
4923    For the <command>debuild</command> command:
4924    </para>
4925    <screen>
4926    $ debuild -sa
4927    </screen>
4928    <para>
4929    For the <command>pdebuild</command> command:
4930    </para>
4931    <screen>
4932    $ pdebuild --debbuildopts -sa
4933    </screen>
4934    <para>
4935    On the other hand, the <literal>-sd</literal> option will force the exclusion
4936    of the original <filename>orig.tar.gz</filename> source.
4937  </para>  </para>
4938  </section>  </section>
4939  <section id="skipped-uploads"><title>Skipped uploads</title>  <section id="skipped-uploads"><title>Skipped uploads</title>
# Line 4749  command with the <literal>-sa</literal> Line 4941  command with the <literal>-sa</literal>
4941  If you created multiple entries in <filename>debian/changelog</filename> by  If you created multiple entries in <filename>debian/changelog</filename> by
4942  skipping uploads, you must create a proper <filename>*_.changes</filename> file  skipping uploads, you must create a proper <filename>*_.changes</filename> file
4943  which includes all changes from the last upload.  which includes all changes from the last upload.
4944    This can be done by specifying the <command>dpkg-buildpackage</command> option
4945    <literal>-v</literal> with the version, e.g.,
4946    <literal><replaceable>1.2</replaceable></literal>.
4947  </para>  </para>
4948  <para>  <para>
4949  This can be done by specifying the <literal>-v</literal> option to the package  For the <command>dpkg-buildpackage</command> command:
 building programs such as <command>dpkg-buildpackage</command>,  
 <command>debuild</command>, <command>pdebuild</command>, etc.  
4950  </para>  </para>
4951    <screen>
4952    $ dpkg-buildpackage -v<replaceable>1.2</replaceable>
4953    </screen>
4954    <para>
4955    For the <command>debuild</command> command:
4956    </para>
4957    <screen>
4958    $ debuild -v<replaceable>1.2</replaceable>
4959    </screen>
4960    <para>
4961    For the <command>pdebuild</command> command:
4962    </para>
4963    <screen>
4964    $ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>"
4965    </screen>
4966  </section>  </section>
4967  </chapter>  </chapter>
4968  <chapter id="update"><title>Updating the package</title>  <chapter id="update"><title>Updating the package</title>
4969  <para>  <para>
4970  Once you release a package, you need to update it soon.  After you release a package, you will soon need to update it.
4971  </para>  </para>
4972  <section id="newrevision"><title>New Debian revision</title>  <section id="newrevision"><title>New Debian revision</title>
4973  <para>  <para>
4974  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
4975  <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.
4976  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.
4977  </para>  </para>
4978  <itemizedlist>  <itemizedlist>
4979  <listitem>  <listitem>
# Line 4776  If this is to be recorded as a new patch Line 4984  If this is to be recorded as a new patch
4984  <listitem>  <listitem>
4985  <para>  <para>
4986  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set
4987  patch name;  the patch name;
4988  </para>  </para>
4989  </listitem>  </listitem>
4990  <listitem>  <listitem>
4991  <para>  <para>
4992  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare
4993  file to be modified;  the file to be modified;
4994  </para>  </para>
4995  </listitem>  </listitem>
4996  <listitem>  <listitem>
# Line 4792  Correct the problem in the package sourc Line 5000  Correct the problem in the package sourc
5000  </listitem>  </listitem>
5001  <listitem>  <listitem>
5002  <para>  <para>
5003  <literal>dquilt refresh</literal> to record to  <literal>dquilt refresh</literal> to record it to
5004  <filename><replaceable>bugname.patch</replaceable></filename>;  <filename><replaceable>bugname.patch</replaceable></filename>;
5005  </para>  </para>
5006  </listitem>  </listitem>
# Line 4811  If this is to update an existing patch, Line 5019  If this is to update an existing patch,
5019  <listitem>  <listitem>
5020  <para>  <para>
5021  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall
5022  existing <filename><replaceable>foo.patch</replaceable></filename>;  the existing <filename><replaceable>foo.patch</replaceable></filename>;
5023  </para>  </para>
5024  </listitem>  </listitem>
5025  <listitem>  <listitem>
# Line 4845  Add a new revision at the top of the Deb Line 5053  Add a new revision at the top of the Deb
5053  file, for example with <literal>dch -i</literal>, or explicitly with  file, for example with <literal>dch -i</literal>, or explicitly with
5054  <literal>dch -v  <literal>dch -v
5055  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>  <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>
5056  and then insert the comments using your preferred editor.  <footnote><para> To  and then insert the comments using your preferred editor.  <footnote><para>To
5057  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>.
5058  </para> </footnote>  </para> </footnote>
5059  </para>  </para>
# Line 4853  get the date in the required format, use Line 5061  get the date in the required format, use
5061  <listitem>  <listitem>
5062  <para>  <para>
5063  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,
5064  followed by <literal>Closes: #54321</literal>.  That way, the bug report will  followed by <literal>Closes: #654321</literal>.  That way, the bug report will
5065  be <emphasis>automagically</emphasis> closed by the archive maintenance  be <emphasis>automagically</emphasis> closed by the archive maintenance
5066  software the moment your package gets accepted in the Debian archive.  software the moment your package gets accepted into the Debian archive.
5067  </para>  </para>
5068  </listitem>  </listitem>
5069  <listitem>  <listitem>
# Line 4872  changed and it already exists in the Deb Line 5080  changed and it already exists in the Deb
5080  </para>  </para>
5081  </listitem>  </listitem>
5082  </itemizedlist>  </itemizedlist>
5083    <para>
5084    One tricky case can occur when you make a local package to experiment with
5085    the packaging before uploading  the normal version to the official archive,
5086    e.g.,
5087    <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>.
5088    For smoother upgrades, it is a good idea to create a
5089    <filename>changelog</filename> entry with a version string as
5090    <literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>.
5091    You may unclutter <filename>changelog</filename>
5092    by consolidating such local change entries into a single entry for the official package.
5093    See <xref linkend="namever"/> for the order of version strings.
5094    </para>
5095    <para>
5096    </para>
5097  </section>  </section>
5098  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>  <section id="inspectnewupstream"><title>Inspection of the new upstream release</title>
5099  <para>  <para>
5100  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
5101  must check the new upstream release, first.  must check the new upstream release, first.
5102  </para>  </para>
5103  <para>  <para>
5104  You start this by reading the upstream <filename>changelog</filename>,  Start by reading the upstream <filename>changelog</filename>,
5105  <filename>NEWS</filename>, and whatever other documentations they may have  <filename>NEWS</filename>, and whatever other documentation they may have
5106  released with the new version.  released with the new version.
5107  </para>  </para>
5108  <para>  <para>
5109  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,
5110  watch out for anything suspicious.  watching out for anything suspicious.
5111  </para>  </para>
5112  <screen>  <screen>
5113  $ 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 4897  Changes to some auto-generated files by Line 5119  Changes to some auto-generated files by
5119  <filename>config.sub</filename>, <filename>configure</filename>,  <filename>config.sub</filename>, <filename>configure</filename>,
5120  <filename>depcomp</filename>, <filename>install-sh</filename>,  <filename>depcomp</filename>, <filename>install-sh</filename>,
5121  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be  <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be
5122  ignored.  You may erase them before running <command>diff</command> to the  ignored.  You may delete them before running <command>diff</command> on the
5123  source for inspection.  source for inspection.
5124  </para>  </para>
5125  </section>  </section>
# Line 4913  in the new extracted source.  <footnote> Line 5135  in the new extracted source.  <footnote>
5135  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
5136  /<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
5137  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of  -p1</literal> in the new extracted source, instead.  </para> </footnote> Of
5138  course, you need to do few obvious chores.  course, you need to do some obvious chores.
5139  </para>  </para>
5140  <itemizedlist>  <itemizedlist>
5141  <listitem>  <listitem>
5142  <para>  <para>
5143  Create a copy of upstream source as the  Create a copy of the upstream source as the
5144  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.  <filename>foo_<replaceable>newversion</replaceable>.tar.gz</filename> file.
5145  </para>  </para>
5146  </listitem>  </listitem>
# Line 4961  in <filename>.rej</filename> files). Line 5183  in <filename>.rej</filename> files).
5183  <itemizedlist>  <itemizedlist>
5184  <listitem>  <listitem>
5185  <para>  <para>
5186  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,
5187  </para>  </para>
5188  <itemizedlist>  <itemizedlist>
5189  <listitem>  <listitem>
# Line 4986  upstream source, Line 5208  upstream source,
5208  <listitem>  <listitem>
5209  <para>  <para>
5210  Edit the <filename><replaceable>baz</replaceable></filename> file manually to  Edit the <filename><replaceable>baz</replaceable></filename> file manually to
5211  realize intended effect of  bring about the intended effect of
5212  <filename><replaceable>baz</replaceable>.rej</filename>.  <filename><replaceable>baz</replaceable>.rej</filename>.
5213  </para>  </para>
5214  </listitem>  </listitem>
# Line 4999  realize intended effect of Line 5221  realize intended effect of
5221  </listitem>  </listitem>
5222  <listitem>  <listitem>
5223  <para>  <para>
5224  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>.
5225  </para>  </para>
5226  </listitem>  </listitem>
5227  </itemizedlist>  </itemizedlist>
# Line 5047  You can release this updated source by r Line 5269  You can release this updated source by r
5269  <section id="packagestyle"><title>Updating the packaging style</title>  <section id="packagestyle"><title>Updating the packaging style</title>
5270  <para>  <para>
5271  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
5272  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
5273  source format by doing this.  <footnote><para> If your sponsor or other  <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal>
5274  maintainers object to updating the existing packaging style, it is not worth  source format.  <footnote><para> If your sponsor or other
5275  bothering nor arguing.  There are more important things to do.  </para>  maintainers object to updating the existing packaging style, don't bother
5276    arguing.  There are more important things to do.  </para>
5277  </footnote>  </footnote>
5278  </para>  </para>
5279  <itemizedlist>  <itemizedlist>
5280  <listitem>  <listitem>
5281  <para>  <para>
5282  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
5283  <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
5284  <literal>--addmissing</literal> option.  Then edit them properly.  the <literal>--addmissing</literal> option.  Then edit them appropriately.
5285  </para>  </para>
5286  </listitem>  </listitem>
5287  <listitem>  <listitem>
5288  <para>  <para>
5289  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
5290  <filename>debian/rules</filename> file, update it to use <command>dh</command>.  <filename>debian/rules</filename> file, update it to use <command>dh</command>.
5291  Update the <filename>debian/control</filename> file accordingly.  Update the <filename>debian/control</filename> file accordingly.
5292  </para>  </para>
# Line 5073  Update the <filename>debian/control</fil Line 5296  Update the <filename>debian/control</fil
5296  If you want to update the <filename>rules</filename> file created with the  If you want to update the <filename>rules</filename> file created with the
5297  <filename>Makefile</filename> inclusion mechanism of the Common Debian Build  <filename>Makefile</filename> inclusion mechanism of the Common Debian Build
5298  System (<systemitem role="package">cdbs</systemitem>) to the  System (<systemitem role="package">cdbs</systemitem>) to the
5299  <command>dh</command> syntax, see  <command>dh</command> syntax, see the following to understand its
5300  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its  <literal>DEB_*</literal> configuration variables.
5301  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the  </para>
5302    <itemizedlist>
5303    <listitem><para>local copy of <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink></para></listitem>
5304    <listitem><para><ulink url="&cdbs-tutorial;">The Common Debian Build System (CDBS), FOSDEM 2009</ulink></para></listitem>
5305    </itemizedlist>
5306    <!--
5307    <footnote><para> In the
5308  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some
5309  negative descriptions of the <filename>rules</filename> file created by the  negative descriptions of the <filename>rules</filename> file created by the
5310  <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
5311  only for <literal>lenny</literal> which created explicit targets with long list  only for <literal>lenny</literal> which created explicit targets with long lists
5312  of <command>dh_*</command> commands.  </para> </footnote>  of <command>dh_*</command> commands.  </para> </footnote>
5313  </para>  -->
5314  </listitem>  </listitem>
5315  <listitem>  <listitem>
5316  <para>  <para>
# Line 5089  If you have a <literal>1.0</literal> sou Line 5318  If you have a <literal>1.0</literal> sou
5318  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5319  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
5320  creating <filename>debian/source/format</filename> with <literal>3.0  creating <filename>debian/source/format</filename> with <literal>3.0
5321  (native)</literal>.  The rest of <filename>debian/*</filename> files can be  (native)</literal>.  The rest of the <filename>debian/*</filename> files can just be
5322  just copied.  copied.
5323  </para>  </para>
5324  </listitem>  </listitem>
5325  <listitem>  <listitem>
# Line 5099  If you have a <literal>1.0</literal> sou Line 5328  If you have a <literal>1.0</literal> sou
5328  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can  <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can
5329  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
5330  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.  <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.
5331  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
5332  <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
5333  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>  '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal>
5334  command to your <command>quilt</command> system, if needed.  <footnote><para>  to your <command>quilt</command> system, if needed.  <footnote><para>
5335  You may split <filename>big.diff</filename> into many small incremental patches  You can split <filename>big.diff</filename> into many small incremental patches
5336  using the <command>splitdiff</command> command.  </para> </footnote>  using the <command>splitdiff</command> command.  </para> </footnote>
5337  </para>  </para>
5338  </listitem>  </listitem>
5339  <listitem>  <listitem>
5340  <para>  <para>
5341  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>,
5342  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the  <literal>-p1</literal>, or <literal>-p2</literal>, convert it to the
5343  <systemitem role="package">quilt</systemitem> command using  <systemitem role="package">quilt</systemitem> command using
5344  <filename>deb3</filename> at <ulink url="&deb3;"/>.  <filename>deb3</filename> at <ulink url="&deb3;"/>.
# Line 5120  If it was packaged with another patch sy Line 5349  If it was packaged with another patch sy
5349  If it was packaged with the <command>dh</command> command with the  If it was packaged with the <command>dh</command> command with the
5350  <literal>--with quilt</literal> option or with the  <literal>--with quilt</literal> option or with the
5351  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>  <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command>
5352  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
5353  (native)</literal> source format.  (native)</literal> source format.
5354  </para>  </para>
5355  </listitem>  </listitem>
5356  </itemizedlist>  </itemizedlist>
5357  <para>  <para>
5358  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.
5359  </para>  </para>
5360  </section>  </section>
5361  <section id="reminders"><title>Reminders for updating packages</title>  <section id="reminders"><title>Reminders for updating packages</title>
# Line 5137  Here are few reminders for updating pack Line 5366  Here are few reminders for updating pack
5366  <listitem>  <listitem>
5367  <para>  <para>
5368  Preserve old <filename>changelog</filename> entries (sounds obvious, but there  Preserve old <filename>changelog</filename> entries (sounds obvious, but there
5369  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
5370  <literal>dch -i</literal>.)  <literal>dch -i</literal>.)
5371  </para>  </para>
5372  </listitem>  </listitem>
# Line 5158  and <filename>debian/control</filename> Line 5387  and <filename>debian/control</filename>
5387  </listitem>  </listitem>
5388  <listitem>  <listitem>
5389  <para>  <para>
5390  Check to see <ulink url="&bts;">Debian Bug Tracking  Check the <ulink url="&bts;">Debian Bug Tracking
5391  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
5392  currently open in it.  currently open.
5393  </para>  </para>
5394  </listitem>  </listitem>
5395  <listitem>  <listitem>
5396  <para>  <para>
5397  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
5398  are uploading to the correct distribution, the proper bugs closures are listed  are uploading to the correct distribution, the proper bug closures are listed
5399  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and  in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and
5400  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.  <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.
5401  </para>  </para>

Legend:
Removed from v.8742  
changed lines
  Added in v.9043

  ViewVC Help
Powered by ViewVC 1.1.5