/[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 8640 by osamu, Wed Apr 6 19:00:00 2011 UTC revision 8718 by osamu, Sun Apr 24 09:54:41 2011 UTC
# Line 2  Line 2 
2  <!-- -*- DocBook -*- -->  <!-- -*- DocBook -*- -->
3  <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"  <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
5    <!ENTITY % trans    SYSTEM "po4a/maint-guide.en.ent">   %trans;
6  <!ENTITY % common   SYSTEM "common.ent">   %common;  <!ENTITY % common   SYSTEM "common.ent">   %common;
7  <!ENTITY % version  SYSTEM "version.ent">  %version;  <!ENTITY % version  SYSTEM "version.ent">  %version;
8  ]>  ]>
9  <book lang="en">  <book lang="en">
10  <!-- This is UTF-8 encoded. -->  <!-- This is UTF-8 encoded. -->
11  <!-- This is reorganized to make this document robust for translaion when some externally referenced information changes. -->  <!--
12  <title>Debian New Maintainers' Guide</title>  This is reorganized to make this document robust for translation
13  <bookinfo>  when some externally referenced information changes.
 <authorgroup>  
 <author> <personname> <firstname>Josip</firstname> <surname>Rodin</surname> </personname> <email>joy-mg@debian.org</email> <contrib>(original contents)</contrib> </author>  
 <author> <personname> <firstname>Osamu</firstname> <surname>Aoki</surname> </personname> <email>osamu@debian.org</email> <contrib>(updated contents)</contrib> </author>  
   
14    
15    If you want to add extra contents to this document, please do so by
16     * adding tag like &othercredit; in English and provide it for each language.
17     * add extra content within msgstr but within <footnote>...</footnote>
18    Please note there will be content checker to match tags of msgid and msgstr.
19    The second rule is a way to get exception to this rule.
20    
21    Please try to correct something in translation.  If you think contents needs fix,
22    Let's fix it in the root cause.
23    
24  <!-- BEGIN: Add othercredit for translator via po4a/maint-guide.*.patch -->  Please understand to keep this document focused.  Not everything you think important
25  <!-- END: Add othercredit for translator via po4a/maint-guide.*.patch -->  for new maintainer should be written down.  Something social needs to be elsewhere.
26  <!-- dummy -->  Some thing should be left to the practice.  Something needs to be left for exercise
27  <!-- dummy -->  for people to check official documentations.
28    -->
29    <title>Debian New Maintainers' Guide</title>
30    <bookinfo>
31    <authorgroup>
32    <!-- do not use firstname and surname tags it braks Japanese.  The same with othercredit -->
33    <author> <personname>Josip Rodin</personname> <email>joy-mg@debian.org</email> <contrib>original contents</contrib> </author>
34    <author> <personname>Osamu Aoki</personname> <email>osamu@debian.org</email> <contrib>updated contents</contrib> </author>
35    <!-- translator credits in po4a/translator.*.ent -->
36    &othercredit;
37  </authorgroup>  </authorgroup>
38  <releaseinfo>version &docversion;</releaseinfo>  <releaseinfo>version &docversion;</releaseinfo>
39  <pubdate>&docisodate;</pubdate>  <pubdate>&docisodate;</pubdate>
# Line 36  version 2 or higher. Line 49  version 2 or higher.
49  <para>  <para>
50  This document was made using with these two documents as examples:  This document was made using with these two documents as examples:
51  </para>  </para>
52    <itemizedlist>
53    <listitem>
54  <para>  <para>
55  Making a Debian Package (AKA the Debmake Manual), copyright © 1997 Jaldhar  Making a Debian Package (AKA the Debmake Manual), copyright © 1997 Jaldhar
56  Vyas.  Vyas.
57  </para>  </para>
58    </listitem>
59    <listitem>
60  <para>  <para>
61  The New-Maintainer's Debian Packaging Howto, copyright © 1997 Will Lowe.  The New-Maintainer's Debian Packaging Howto, copyright © 1997 Will Lowe.
62  </para>  </para>
63    </listitem>
64    </itemizedlist>
65  </legalnotice>  </legalnotice>
66  <!-- toc -->  <!-- toc -->
67  </bookinfo>  </bookinfo>
68  <chapter id="start"><title>Getting started The Right Way</title>  <chapter id="start"><title>Getting started The Right Way</title>
69  <para>  <para>
70  This document tries to describe building of a Debian package to the common  This document tries to describe the building of a Debian package to ordinary
71  Debian user, and the prospectus developer.  It uses pretty common language, and  Debian users and prospective developers.  It uses fairly non-technical language, and
72  it's well covered with working examples.  There is an old Roman saying,  it's well covered with working examples.  There is an old Latin saying:
73  <emphasis>Longum iter est per preaecepta, breve et efficax per  <emphasis>Longum iter est per praecepta, breve et efficax per
74  exempla!</emphasis> (It's a long way by the rules, but short and efficient with  exempla</emphasis> (It's a long way by the rules, but short and efficient with
75  examples!).  examples).
76  </para>  </para>
77  <para>  <para>
78  This document has been updated for the Debian <literal>&base-release;</literal>  This document has been updated for the Debian <literal>&base-release;</literal>
79  release.  release.
80  <footnote><para> The document assumes you are using the  <footnote><para> The document assumes you are using a
81  <literal>&base-release;</literal> system or newer.  If you need to follow this  <literal>&base-release;</literal> or newer system.  If you need to follow this
82  text in the older system (including the older Ubuntu system etc.), you must  text in an older system (including an older Ubuntu system etc.), you must
83  install backported <systemitem role="package">dpkg</systemitem> and  install backported <systemitem role="package">dpkg</systemitem> and
84  <systemitem role="package">debhelper</systemitem> packages, at least.  <systemitem role="package">debhelper</systemitem> packages, at least.
85  </para> </footnote>  </para> </footnote>
# Line 69  install backported <systemitem role="pac Line 88  install backported <systemitem role="pac
88  One of the things that makes Debian such a top-notch distribution is its  One of the things that makes Debian such a top-notch distribution is its
89  package system.  While there is a vast quantity of software already in the  package system.  While there is a vast quantity of software already in the
90  Debian format, sometimes you need to install software that isn't.  You may be  Debian format, sometimes you need to install software that isn't.  You may be
91  wondering how you can make your own packages and perhaps you think it is a very  wondering how you can make your own packages; and perhaps you think it is a very
92  difficult task.  Well, if you are a real novice on Linux, it is hard, but if  difficult task.  Well, if you are a real novice on Linux, it is hard, but if
93  you were rookie, you wouldn't be reading this doc now.  :-) You do need to know  you were a rookie, you wouldn't be reading this document now&nbsp;:-)
94  a little about Unix programming but you certainly don't need to be a wizard.  You do need to know a little about Unix programming but you certainly
95    don't need to be a wizard.
96  <footnote><para>  <footnote><para>
97  You can learn basic operations of the Debian system from  You can learn about the basic handling of a Debian system from the
98  <ulink url="&debref;">Debian Reference</ulink>.  It contains some pointers to  <ulink url="&debref;">Debian Reference</ulink>.  It contains some pointers to
99  learn about Unix programming, too.  learn about Unix programming, too.
100  </para></footnote>  </para></footnote>
101  </para>  </para>
102  <para>  <para>
103  One thing is certain, though: to properly create and maintain Debian packages  One thing is certain, though: to properly create and maintain Debian packages
104  you need many hours.  Make no mistake, for our system to work the maintainers  takes many hours.  Make no mistake, for our system to work the maintainers
105  need to be both technically competent and diligent.  need to be both technically competent and diligent.
106  </para>  </para>
107  <para>  <para>
108  This document will explain every little (at first maybe irrelevant) step, and  This document will explain every little (at first maybe irrelevant) step, and
109  help you create that first package, and to gain some experience in building  help you create that first package, and to gain some experience in building
110  next releases of that and maybe other packages later on.  the next releases of that and maybe other packages later on.
111  </para>  </para>
112  <para>  <para>
113  If you need some help on packaging, please read <xref linkend="helpme"/> .  If you need some help on packaging, please read <xref linkend="helpme"/>.
114  </para>  </para>
115  <para>  <para>
116  Newer versions of this document should always be available online at  Newer versions of this document should always be available online at
117  <ulink url="&maint-guide;"/> and in the  <ulink url="&maint-guide;"/> and in the
118  <systemitem role="package">maint-guide</systemitem> package.  <systemitem role="package">maint-guide</systemitem> package.
119  The translations may be available in packages such as  The translations may be available in packages such as
120  <systemitem role="package">maint-guide-es</systemitem>.  <systemitem role="package">maint-guide-es</systemitem>.
121    Please note that this documentation may be slightly outdated.
122  </para>  </para>
123  <section id="needprogs"><title>Programs you need for development</title>  <section id="socialdynamism"><title>Social dynamics of Debian</title>
124  <para>  <para>
125  Before you start anything, you should make sure that you have properly  Here are some observations of Debian's social dynamics, presented in the hope
126  installed some additional packages needed for development.  Note that the list  that it will prepare you for interactions with Debian.
 doesn't contain any packages marked <literal>essential</literal> or  
 <literal>required</literal> - we expect that you have those installed already.  
 </para>  
 <para>  
 The following packages come with the standard Debian installation, so you  
 probably have them already (along with any additional packages they depend on).  
 Still, you should check it with <literal>aptitude show  
 <replaceable>package</replaceable></literal>  
 or with <literal>dpkg -s <replaceable>package</replaceable></literal>.  
 </para>  
 <para>  
 The most important package to install on your development system is the  
 <systemitem role="package">build-essential</systemitem> package.  Once you try  
 to install it, it will <emphasis>pull in</emphasis> other packages required to  
 have a basic build environment.  
 </para>  
 <para>  
 For some types of packages, that is all you will require, however there is  
 another set of packages that while not essential for all package builds are  
 useful to have install or may be required by your package:  
127  </para>  </para>
128  <itemizedlist>  <itemizedlist>
129  <listitem>  <listitem><para>We all are volunteers.</para>
130  <para>      <itemizedlist>
131  <systemitem role="package">file</systemitem> - this handy program can determine      <listitem><para>You cannot impose on others what to do.</para></listitem>
132  what type a file is.  (see <citerefentry> <refentrytitle>file</refentrytitle>      <listitem><para>You should be motivated to do things by yourself.</para></listitem>
133  <manvolnum>1</manvolnum> </citerefentry>)      </itemizedlist></listitem>
134  </para>  <listitem><para>Friendly cooperation is the driving force.</para>
135  </listitem>      <itemizedlist>
136  <listitem>      <listitem><para>Your contribution should not overstrain others.</para></listitem>
137  <para>      <listitem><para>Your contribution is valuable only when others appreciate it.</para></listitem>
138  <systemitem role="package">patch</systemitem> - this very useful utility will      </itemizedlist></listitem>
139  take a file containing a difference listing (produced by the  <listitem><para>Debian is not your school where you get automatic attention of teachers.</para>
140  <command>diff</command> program) and apply it to the original file, producing a      <itemizedlist>
141  patched version.  (see <citerefentry> <refentrytitle>patch</refentrytitle>      <listitem><para>You should be able to learn many things by yourself.</para></listitem>
142  <manvolnum>1</manvolnum> </citerefentry>)      <listitem><para>Attention from other volunteers is a very scarce resource.</para></listitem>
143  </para>      </itemizedlist></listitem>
144  </listitem>  <listitem><para>Debian is constantly improving.</para>
145  <listitem>      <itemizedlist>
146  <para>      <listitem><para>You are expected to make high quality packages.</para></listitem>
147  <systemitem role="package">perl</systemitem> - Perl is one of the most used      <listitem><para>You should adapt yourself to change.</para></listitem>
148  interpreted scripting languages on today's Unix-like systems, often referred to      </itemizedlist></listitem>
149  as Unix's Swiss Army Chainsaw.  (see <citerefentry>  </itemizedlist>
 <refentrytitle>perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)  
 </para>  
 </listitem>  
 <listitem>  
150  <para>  <para>
151  <systemitem role="package">python</systemitem> - Python is another of the most  There are several types of people interacting around Debian with different
152  used interpreted scripting languages on the Debian system that combines  roles.
 remarkable power with very clear syntax.  (see <citerefentry>  
 <refentrytitle>python</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)  
153  </para>  </para>
154  </listitem>  <itemizedlist>
155  <listitem>  <listitem>
156  <para>  <para>
157  <systemitem role="package">autoconf</systemitem>, <systemitem role="package">automake</systemitem> and <systemitem role="package">autotools-dev</systemitem> - many newer programs use configure  <emphasis role="strong">upstream author</emphasis>: the person who made the
158  scripts and <filename>Makefile</filename> files preprocessed with help of  original program.
 programs like these.  (see <literal>info autoconf</literal>, <literal>info  
 automake</literal>).  The <systemitem role="package">autotools-dev</systemitem>  
 keeps up-to-date versions of certain auto files and has documentation about the  
 best way to use those files.  
159  </para>  </para>
160  </listitem>  </listitem>
161  <listitem>  <listitem>
162  <para>  <para>
163  <systemitem role="package">dh-make</systemitem> and <systemitem role="package">debhelper</systemitem> - <systemitem role="package">dh-make</systemitem> is necessary to create the skeleton of our  <emphasis role="strong">upstream maintainer</emphasis>: the person who
164  example package, and it will use some of the <systemitem role="package">debhelper</systemitem> tools for creating packages.  They are  currently maintains the program.
 not essential for creation of packages, but are <emphasis>highly</emphasis>  
 recommended for new maintainers.  It makes the whole process very much easier  
 to start, and control afterwards.  (see <citerefentry>  
 <refentrytitle>dh_make</refentrytitle> <manvolnum>1</manvolnum>  
 </citerefentry>, <citerefentry> <refentrytitle>debhelper</refentrytitle>  
 <manvolnum>1</manvolnum> </citerefentry>) <footnote><para> There  
 are few similar but specialized packages such as <systemitem role="package">dh-make-perl</systemitem>, <systemitem role="package">dh-make-php</systemitem>, etc.  </para> </footnote>  
165  </para>  </para>
166  </listitem>  </listitem>
167  <listitem>  <listitem>
168  <para>  <para>
169  <systemitem role="package">devscripts</systemitem> - this package contains some  <emphasis role="strong">maintainer</emphasis>: the person making the Debian
170  nice and useful scripts that can be helpful to the maintainers, but they are  package of the program.
 also not necessary for building packages.  Packages recommended and suggested  
 by this package are worth looking into.  (see  
 <ulink url="&devscripts-readme;"/>.)  
171  </para>  </para>
172  </listitem>  </listitem>
173  <listitem>  <listitem>
174  <para>  <para>
175  <systemitem role="package">fakeroot</systemitem> - this utility lets you  <emphasis role="strong">sponsor</emphasis>: a person who helps maintainers to
176  emulate being root which is necessary for some parts of the build process.  upload packages to the official Debian package archive (after checking their
177  (see <citerefentry> <refentrytitle>fakeroot</refentrytitle>  contents).
 <manvolnum>1</manvolnum> </citerefentry>)  
178  </para>  </para>
179  </listitem>  </listitem>
180  <listitem>  <listitem>
181  <para>  <para>
182  <systemitem role="package">gnupg</systemitem> - a tool that enables you to  <emphasis role="strong">mentor</emphasis>: a person who helps novice
183  digitally <emphasis>sign</emphasis> packages.  This is especially important if  maintainers with packaging etc.
 you want to distribute it to other people, and you will certainly be doing that  
 when your work gets included in the Debian distribution.  (see <citerefentry>  
 <refentrytitle>gpg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)  
184  </para>  </para>
185  </listitem>  </listitem>
186  <listitem>  <listitem>
187  <para>  <para>
188  <systemitem role="package">gfortran</systemitem> - the GNU Fortran 95 compiler,  <emphasis role="strong">Debian Developer</emphasis> (DD): a member of
189  necessary if your program is written in Fortran.  (see <citerefentry>  the Debian project with full upload rights to the official Debian package
190  <refentrytitle>gfortran</refentrytitle> <manvolnum>1</manvolnum>  archive.
 </citerefentry>)  
191  </para>  </para>
192  </listitem>  </listitem>
193  <listitem>  <listitem>
194  <para>  <para>
195  <systemitem role="package">gpc</systemitem> - the GNU Pascal compiler,  <emphasis role="strong">Debian Maintainer</emphasis> (DM): a person with
196  necessary if your program is written in Pascal.  Worthy of note here is  limited upload rights to the official Debian package archive.
 <systemitem role="package">fp-compiler</systemitem>, the Free Pascal Compiler,  
 which is also good at this task.  (see <citerefentry>  
 <refentrytitle>gpc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  
 <citerefentry> <refentrytitle>ppc386</refentrytitle> <manvolnum>1</manvolnum>  
 </citerefentry>)  
197  </para>  </para>
198  </listitem>  </listitem>
199  <listitem>  </itemizedlist>
200  <para>  <para>
201  <systemitem role="package">xutils-dev</systemitem> - some programs, usually  Please note that you cannot become an official
202  those made for X11, also use these programs to generate  <emphasis role="strong">Debian Developer</emphasis> (DD) overnight, because it
203  <filename>Makefile</filename> files from sets of macro functions.  (see  takes more than technical skill.  Please do not be discouraged by this.  If it
204  <citerefentry> <refentrytitle>imake</refentrytitle> <manvolnum>1</manvolnum>  is useful to others, you can still upload your package either as a
205  </citerefentry>, <citerefentry> <refentrytitle>xmkmf</refentrytitle>  <emphasis role="strong">maintainer</emphasis> through a
206  <manvolnum>1</manvolnum> </citerefentry>)  <emphasis role="strong">sponsor</emphasis> or as a
207    <emphasis role="strong">Debian Maintainer</emphasis>.
208  </para>  </para>
 </listitem>  
 <listitem>  
209  <para>  <para>
210  <systemitem role="package">lintian</systemitem> - this is the Debian package  Please note that you do not need to create any new package to become an
211  checker that can let you know of any common mistakes after you build the  official Debian Developer.  Contributing to the existing packages can provide a
212  package, and explains the errors found.  (see <citerefentry>  path to becoming an official Debian Developer too.  There are many packages
213  <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum>  waiting for good maintainers (see <xref linkend="choose"/>).
 </citerefentry>,  
 <ulink url="&lintian-doc;">Lintian User's Manual</ulink>)  
214  </para>  </para>
 </listitem>  
 <listitem>  
215  <para>  <para>
216  <systemitem role="package">pbuilder</systemitem> - this package contains  Since we focus only on technical aspects of packaging in this document,
217  programs which are used for creating and maintaining <command>chroot</command>  please refer to the following to learn how Debian functions and how you can get involved.
 environment.  Building Debian package in this <command>chroot</command>  
 environment verifies the proper build dependency and avoid FTBFS (Fails To  
 Build From Source) bugs.  (see <citerefentry>  
 <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum>  
 </citerefentry> and <citerefentry> <refentrytitle>pdebuild</refentrytitle>  
 <manvolnum>1</manvolnum> </citerefentry>)  
218  </para>  </para>
219  </listitem>  <itemizedlist>
220  <listitem>  <listitem><para><ulink url="&logiciellibre;">Debian: 17 years of Free Software, "do-ocracy", and democracy</ulink> (Introductory slides) </para> </listitem>
221    <listitem><para><ulink url="&debianorghelp;">How can you help Debian?</ulink> (official) </para> </listitem>
222    <listitem><para><ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - 'Contributing to the Debian Project'</ulink> (semi-official) </para> </listitem>
223    <listitem><para><ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental) </para> </listitem>
224    <listitem><para><ulink url="&nm-do;">Debian New Maintainer site</ulink> (official) </para> </listitem>
225    <listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem>
226    </itemizedlist>
227    </section>
228    <section id="needprogs"><title>Programs you need for development</title>
229  <para>  <para>
230  <systemitem role="package">patchutils</systemitem> - this package contains some  Before you start anything, you should make sure that you have properly
231  utilities to work with patches such as the <command>lsdiff</command>,  installed some additional packages needed for development.  Note that the list
232  <command>interdiff</command> and <command>filterdiff</command> commands.  doesn't contain any packages marked <literal>essential</literal> or
233    <literal>required</literal> - we expect that you have those installed already.
234  </para>  </para>
 </listitem>  
 <listitem>  
235  <para>  <para>
236  <systemitem role="package">quilt</systemitem> - this package helps you to  The following packages come with the standard Debian installation, so you
237  manage a series of patches by keeping track of the changes each of them makes.  probably have them already (along with any additional packages they depend on).
238  They are logically organized as a stack, and you can apply (=push), un-apply  Still, you should check it with <literal>aptitude show
239  (=pop), refresh them easily by traveling into the stack.  (see <citerefentry>  <replaceable>package</replaceable></literal>
240  <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,  or with <literal>dpkg -s <replaceable>package</replaceable></literal>.
 <ulink url="&quilt-pdf;">quilt.pdf</ulink>)  
241  </para>  </para>
 </listitem>  
 <listitem>  
242  <para>  <para>
243  <systemitem role="package">git</systemitem> - this package provides popular  The most important package to install on your development system is the
244  version control system designed to handle very large projects with speed and  <systemitem role="package">build-essential</systemitem> package.  Once you try
245  efficiency; it is used for many high profile open source projects, most notably  to install that, it will <emphasis>pull in</emphasis> other packages required to
246  the Linux kernel.  (see <citerefentry> <refentrytitle>git</refentrytitle>  have a basic build environment.
 <manvolnum>1</manvolnum> </citerefentry>,  
 <ulink url="&git-doc;">git Manual</ulink>)  
247  </para>  </para>
 </listitem>  
 </itemizedlist>  
248  <para>  <para>
249  The following is the <emphasis>very important</emphasis> documentation which  For some types of packages, that is all you will require; however, there is
250  you should read along with this document:  another set of packages that while not essential for all package builds are
251    useful to have installed or may be required by your package:
252  </para>  </para>
253  <itemizedlist>  <itemizedlist>
254  <listitem>  <listitem>
255  <para>  <para>
256  <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy  <systemitem role="package">autoconf</systemitem>, <systemitem
257  Manual</ulink> includes explanations of the structure and contents of the  role="package">automake</systemitem>, and <systemitem
258  Debian archive, several OS design issues, the Filesystem Hierarchy Standard  role="package">autotools-dev</systemitem> - many newer programs use configure
259  (which says where each file and directory should be) etc.  For you, the most  scripts and <filename>Makefile</filename> files preprocessed with the help of
260  important thing is that it describes requirements that each package must  programs like these (see <literal>info autoconf</literal>, <literal>info
261  satisfy to be included in the distribution (see the local copy of  automake</literal>).  <systemitem role="package">autotools-dev</systemitem>
262  <ulink url="&policy-pdf;">policy.pdf</ulink>).  keeps up-to-date versions of certain auto files and has documentation about the
263    best way to use those files.
264  </para>  </para>
265  </listitem>  </listitem>
266  <listitem>  <listitem>
267  <para>  <para>
268  <systemitem role="package">developers-reference</systemitem> - the <ulink url="&developers-reference;">Debian Developer's  <systemitem role="package">debhelper</systemitem> and
269  Reference</ulink> describes all matters not specifically about the technical  <systemitem role="package">dh-make</systemitem> -
270  details of packaging, like the structure of the archive, how to rename, orphan,  <systemitem role="package">dh-make</systemitem> is necessary to create
271  pick up packages, how to do NMUs, how to manage bugs, best packaging practices,  the skeleton of our example package, and it will use some of the
272  when and where to upload etc.  (see the local copy of  <systemitem role="package">debhelper</systemitem> tools for creating
273  <ulink url="&developers-refpdf;">developers-reference.pdf</ulink>).  packages.  They are not essential for this purpose, but are
274    <emphasis>highly</emphasis> recommended for new maintainers.  It makes
275    the whole process very much easier to start, and to control afterwards.
276    (See <citerefentry> <refentrytitle>dh_make</refentrytitle>
277    <manvolnum>1</manvolnum> </citerefentry>, <citerefentry>
278    <refentrytitle>debhelper</refentrytitle> <manvolnum>1</manvolnum>
279    </citerefentry>.) <footnote><para> There are also some more specialized
280    but similar packages such as
281    <systemitem role="package">dh-make-perl</systemitem>,
282    <systemitem role="package">dh-make-php</systemitem>, etc.  </para>
283    </footnote>
284  </para>  </para>
285  </listitem>  </listitem>
286  <listitem>  <listitem>
287  <para>  <para>
288  <ulink url="&autotools-tutorial;">Autotools  <systemitem role="package">devscripts</systemitem> - this package contains some
289  Tutorial</ulink> provides very good tutorial for <ulink url="&gnu-build-system;">the GNU Build System known  useful scripts that can be helpful for maintainers, but they are also
290  as the GNU Autotools</ulink> whose most important components are Autoconf,  not necessary for building packages.  Packages recommended and suggested
291  Automake, Libtool, and gettext.  by this package are worth looking into.  (See <ulink url="&devscripts-readme;"/>.)
292  </para>  </para>
293  </listitem>  </listitem>
294  <listitem>  <listitem>
295  <para>  <para>
296  <systemitem role="package">gnu-standards</systemitem> - this package contains  <systemitem role="package">fakeroot</systemitem> - this utility lets you
297  two pieces of documentation from the GNU project:  emulate being root which is necessary for some parts of the build process.
298  <ulink url="&gnu-standard;">GNU Coding Standards</ulink>, and  (See <citerefentry> <refentrytitle>fakeroot</refentrytitle>
299  <ulink url="&gnu-maintainer;">Information for Maintainers of GNU Software</ulink>.  <manvolnum>1</manvolnum> </citerefentry>.)
 Although Debian does not require these to  
 be followed, these are still helpful as guidelines and common sense.  (see the local copies of  
 <ulink url="&gnu-standard-pdf;">standards.pdf</ulink> and  
 <ulink url="&gnu-maintainer-pdf;">maintain.pdf</ulink>).  
300  </para>  </para>
301  </listitem>  </listitem>
 </itemizedlist>  
 <para>  
 If this document contradicts with any of the documents mentioned above, they  
 are correct.  Please file a bug report on the  
 <systemitem role="package">maint-guide</systemitem> package using  
 <command>reportbug</command>.  
 </para>  
 <para>  
 The short descriptions that are given above only serve to introduce you to what  
 each package does.  Before continuing please thoroughly read the documentation  
 of each program, at least, for the standard usage.  It may seem like heavy  
 going now, but later on you'll be <emphasis>very</emphasis> glad you read it.  
 </para>  
 </section>  
 <section id="terminology"><title>Basic terminology</title>  
 <para>  
 There are two types of packages.  
 </para>  
 <itemizedlist>  
302  <listitem>  <listitem>
303  <para>  <para>
304  <emphasis role="strong">source package</emphasis>: A source package is a set of  <systemitem role="package">file</systemitem> - this handy program can determine
305  files which contain code and data which you can compile and process into  what type a file is.  (See <citerefentry> <refentrytitle>file</refentrytitle>
306  execution programs and formatted documents.  It usually comes as a combination  <manvolnum>1</manvolnum> </citerefentry>.)
 of <filename>*.orig.tar.gz</filename>, <filename>*.debian.tar.gz</filename> (or  
 <filename>*.diff.gz</filename>), and <filename>*.dsc</filename>.  Some other  
 archive and compression methods may be used, too.  
307  </para>  </para>
308  </listitem>  </listitem>
309  <listitem>  <listitem>
310  <para>  <para>
311  <emphasis role="strong">binary package</emphasis>: A binary package contains  <systemitem role="package">gfortran</systemitem> - the GNU Fortran 95 compiler,
312  execution programs and formatted documents.  It usually comes as  necessary if your program is written in Fortran.  (See <citerefentry>
313  <filename>*.deb</filename> for the normal Debian system and as  <refentrytitle>gfortran</refentrytitle> <manvolnum>1</manvolnum>
314  <filename>*.udeb</filename> for the Debian Installer.  </citerefentry>.)
315  </para>  </para>
316  </listitem>  </listitem>
 </itemizedlist>  
 <para>  
 Don't mix terms like source of the program and the source package of the  
 program!  
 </para>  
 <para>  
 There are several role names used around Debian.  
 </para>  
 <itemizedlist>  
317  <listitem>  <listitem>
318  <para>  <para>
319  <emphasis role="strong">upstream author</emphasis>: The person who made the  <systemitem role="package">git</systemitem> - this package provides a popular
320  original program.  version control system designed to handle very large projects with speed and
321    efficiency; it is used for many high profile open source projects, most notably
322    the Linux kernel.  (See <citerefentry> <refentrytitle>git</refentrytitle>
323    <manvolnum>1</manvolnum> </citerefentry>,
324    <ulink url="&git-doc;">git Manual</ulink>.)
325  </para>  </para>
326  </listitem>  </listitem>
327  <listitem>  <listitem>
328  <para>  <para>
329  <emphasis role="strong">upstream maintainer</emphasis>: The person who  <systemitem role="package">gnupg</systemitem> - a tool that enables you to
330  currently maintains the program.  digitally <emphasis>sign</emphasis> packages.  This is especially important if
331    you want to distribute it to other people, and you will certainly be doing that
332    when your work gets included in the Debian distribution.  (See <citerefentry>
333    <refentrytitle>gpg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
334  </para>  </para>
335  </listitem>  </listitem>
336  <listitem>  <listitem>
337  <para>  <para>
338  <emphasis role="strong">maintainer</emphasis>: The person who makes Debian  <systemitem role="package">gpc</systemitem> - the GNU Pascal compiler,
339  package of the program.  necessary if your program is written in Pascal.  Worthy of note here is
340    <systemitem role="package">fp-compiler</systemitem>, the Free Pascal Compiler,
341    which is also good at this task.  (See <citerefentry>
342    <refentrytitle>gpc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>,
343    <citerefentry> <refentrytitle>ppc386</refentrytitle>
344    <manvolnum>1</manvolnum> </citerefentry>.)
345  </para>  </para>
346  </listitem>  </listitem>
347  <listitem>  <listitem>
348  <para>  <para>
349  <emphasis role="strong">sponsor</emphasis>: The person who helps maintainers to  <systemitem role="package">lintian</systemitem> - this is the Debian package
350  upload packages to the official Debian Package Archive after checking their  checker, which can let you know of any common mistakes after you build the
351  contents.  package, and explains the errors found.  (See <citerefentry>
352    <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum>
353    </citerefentry>,
354    <ulink url="&lintian-doc;">Lintian User's Manual</ulink>.)
355  </para>  </para>
356  </listitem>  </listitem>
357  <listitem>  <listitem>
358  <para>  <para>
359  <emphasis role="strong">mentor</emphasis>: The person who helps novice  <systemitem role="package">patch</systemitem> - this very useful utility will
360  maintainers on packaging etc.  take a file containing a difference listing (produced by the
361    <command>diff</command> program) and apply it to the original file, producing a
362    patched version.  (See <citerefentry> <refentrytitle>patch</refentrytitle>
363    <manvolnum>1</manvolnum> </citerefentry>.)
364  </para>  </para>
365  </listitem>  </listitem>
366  <listitem>  <listitem>
367  <para>  <para>
368  <emphasis role="strong">Debian Developer</emphasis> (DD): The person who is a  <systemitem role="package">patchutils</systemitem> - this package contains some
369  member of Debian.  He has full upload right to the official Debian Package  utilities to work with patches such as the <command>lsdiff</command>,
370  Archive.  <command>interdiff</command> and <command>filterdiff</command> commands.
371  </para>  </para>
372  </listitem>  </listitem>
373  <listitem>  <listitem>
374  <para>  <para>
375  <emphasis role="strong">Debian Maintainer</emphasis> (DM): The person who has  <systemitem role="package">pbuilder</systemitem> - this package contains
376  limited upload right to the official Debian Package Archive.  programs which are used for creating and maintaining <command>chroot</command>
377    environment.  Building Debian package in this <command>chroot</command>
378    environment verifies the proper build dependency and avoid FTBFS (Fails To
379    Build From Source) bugs.  (see <citerefentry>
380    <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum>
381    </citerefentry> and <citerefentry> <refentrytitle>pdebuild</refentrytitle>
382    <manvolnum>1</manvolnum> </citerefentry>)
383  </para>  </para>
384  </listitem>  </listitem>
 </itemizedlist>  
 <para>  
 There are several version names<footnote><para>see <ulink url="&policy-control;#s-f-Version">Debian Policy  Manual: 5.6.12 Version</ulink>.</para></footnote> used around Debian.  
 </para>  
 <itemizedlist>  
385  <listitem>  <listitem>
386  <para>  <para>
387  <emphasis role="strong">upstream source version</emphasis>: The upstream source  <systemitem role="package">perl</systemitem> - Perl is one of the most used
388  version is referred as <literal><replaceable>version</replaceable></literal>.  interpreted scripting languages on today's Unix-like systems, often referred to
389    as Unix's Swiss Army Chainsaw. (See <citerefentry>
390    <refentrytitle>perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
391  </para>  </para>
392  </listitem>  </listitem>
393  <listitem>  <listitem>
394  <para>  <para>
395  <emphasis role="strong">Debian revision</emphasis>: The revision by Debian on  <systemitem role="package">python</systemitem> - Python is another of the most
396  package is referred as <literal><replaceable>revision</replaceable></literal>.  used interpreted scripting languages on the Debian system, combining
397    remarkable power with very clear syntax. (See <citerefentry>
398    <refentrytitle>python</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
399  </para>  </para>
400  </listitem>  </listitem>
401  <listitem>  <listitem>
402  <para>  <para>
403  <emphasis role="strong">Debian package version</emphasis>: The Debian package  <systemitem role="package">quilt</systemitem> - this package helps you to
404  version is referred as the following.  manage large numbers of patches by keeping track of the changes each patch
405  </para>  makes. Patches can be applied, un-applied, refreshed, and more.  (See
406  <itemizedlist>  <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum></citerefentry>,
407  <listitem>  <ulink url="&quilt-pdf;">quilt.pdf</ulink>.)
 <para>  
 <literal><replaceable>version</replaceable></literal> for the native Debian  
 binary package and for the Debian source package.  
408  </para>  </para>
409  </listitem>  </listitem>
410  <listitem>  <listitem>
411  <para>  <para>
412  <literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>  <systemitem role="package">xutils-dev</systemitem> - some programs, usually
413  for the non-native Debian binary package.  those made for X11, also use these programs to generate
414    <filename>Makefile</filename> files from sets of macro functions.  (See
415    <citerefentry> <refentrytitle>imake</refentrytitle> <manvolnum>1</manvolnum>
416    </citerefentry>, <citerefentry> <refentrytitle>xmkmf</refentrytitle>
417    <manvolnum>1</manvolnum> </citerefentry>.)
418  </para>  </para>
419  </listitem>  </listitem>
420  </itemizedlist>  </itemizedlist>
 </listitem>  
 </itemizedlist>  
421  <para>  <para>
422  Please read the other manuals if you need more details on terminology.  The short descriptions that are given above only serve to introduce you to what
423  </para>  each package does.  Before continuing please thoroughly read the documentation
424  </section>  of each program including ones installed through the package dependency such as
425  <section id="debiandeveloper"><title>Official Debian Developer</title>  <command>make</command>, at least, for the standard usage.  It may seem like heavy
426  <para>  going now, but later on you'll be <emphasis>very</emphasis> glad you read it.
 You can not become an official  
 <emphasis role="strong">Debian Developer</emphasis> (DD) over night because it  
 takes more than technical skill.  Please do not be discouraged by this.  If it  
 is useful to others, you can still upload your package either as a  
 <emphasis role="strong">maintainer</emphasis> through a  
 <emphasis role="strong">sponsor</emphasis> or as a  
 <emphasis role="strong">Debian Maintainer</emphasis>.  
 </para>  
 <para>  
 Please make sure to check the latest proper procedure to become an official Debian Developer.  
427  </para>  </para>
 <itemizedlist>  
 <listitem><para><ulink url="&nm-do;">Debian New Maintainer site</ulink> (official) </para> </listitem>  
 <listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem>  
 </itemizedlist>  
428  <para>  <para>
429  Please note that you do not need to create any new package to become an  If you have specific questions later, I would suggest re-reading the documents
430  official Debian Developer.  Contributing to the existing packages can provide a  mentioned above.  Since this is a tutorial, I have intentionally skipped
431  path to become an official Debian Developer too.  There are many packages  details and provided only pointers to keep it simple.
 waiting for good maintainers (see <xref linkend="choose"/> ).  
432  </para>  </para>
433  </section>  </section>
434  <section id="helpme"><title>Where to ask for help</title>  <section id="needdocs"><title>Documentation needed for development</title>
435  <para>  <para>
436  Before you decide to ask your question in some public place, please read the fine documentation.  The following is the <emphasis>very important</emphasis> documentation which
437    you should read along with this document:
438  </para>  </para>
439  <itemizedlist>  <itemizedlist>
440  <listitem>  <listitem>
441  <para>  <para>
442  files in <filename>/usr/share/doc/dpkg</filename>  <ulink url="&autotools-tutorial;">Autotools
443    Tutorial</ulink> provides a very good tutorial for <ulink url="&gnu-build-system;">the GNU Build System known
444    as the GNU Autotools</ulink> whose most important components are Autoconf,
445    Automake, Libtool, and gettext.
446  </para>  </para>
447  </listitem>  </listitem>
448  <listitem>  <listitem>
449  <para>  <para>
450  files in <filename>/usr/share/doc/debian</filename>  <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy
451  <!-- /usr/share/doc/debian is used be doc-debian and debian-faq -->  Manual</ulink> includes explanations of the structure and contents of the
452    Debian archive, several OS design issues, the <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink>
453    (FHS, which says where each file and directory should be), etc.  For you, the most
454    important thing is that it describes requirements that each package must
455    satisfy to be included in the distribution (see the local copies of
456    <ulink url="&policy-pdf;">policy.pdf</ulink> and <ulink url="&fhs-pdf;">fhs-2.3.pdf</ulink>).
457  </para>  </para>
458  </listitem>  </listitem>
459  <listitem>  <listitem>
460  <para>  <para>
461  files in <filename>/usr/share/doc/autotools-dev</filename>  <systemitem role="package">developers-reference</systemitem>
462    - the <ulink url="&developers-reference;">Debian Developer's Reference</ulink>
463    describes all matters not specifically about the technical
464    details of packaging, like the structure of the archive, how to rename, orphan,
465    or adopt packages, how to do NMUs, how to manage bugs, best packaging practices,
466    when and where to upload etc.  (See the local copy of
467    <ulink url="&developers-refpdf;">developers-reference.pdf</ulink>.)
468  </para>  </para>
469  </listitem>  </listitem>
470  <listitem>  <listitem>
471  <para>  <para>
472  files in <filename>/usr/share/doc/<replaceable>package</replaceable></filename> for all pertinent packages.  <systemitem role="package">gnu-standards</systemitem> - this package contains
473    two pieces of documentation from the GNU project:
474    <ulink url="&gnu-standard;">GNU Coding Standards</ulink>, and
475    <ulink url="&gnu-maintainer;">Information for Maintainers of GNU Software</ulink>.
476    Although Debian does not require these to
477    be followed, these are still helpful as guidelines and common sense.
478    (See the local copies of
479    <ulink url="&gnu-standard-pdf;">standards.pdf</ulink> and
480    <ulink url="&gnu-maintainer-pdf;">maintain.pdf</ulink>.)
481  </para>  </para>
482  </listitem>  </listitem>
483  <listitem>  </itemizedlist>
484  <para>  <para>
485  contents of "<literal><command>man</command> <replaceable>command</replaceable></literal>" for all pertinent commands  If this document contradicts any of the documents mentioned above, they
486    are correct.  Please file a bug report on the
487    <systemitem role="package">maint-guide</systemitem> package using
488    <command>reportbug</command>.
489  </para>  </para>
490  </listitem>  </section>
491    <section id="helpme"><title>Where to ask for help</title>
492    <para>
493    Before you decide to ask your question in some public place, please read the fine documentation.
494    </para>
495    <itemizedlist>
496  <listitem>  <listitem>
497  <para>  <para>
498  contents of "<literal><command>info</command> <replaceable>command</replaceable></literal>" for all pertinent commands  files in <filename>/usr/share/doc/<replaceable>package</replaceable></filename> for all pertinent packages
499  </para>  </para>
500  </listitem>  </listitem>
501  <listitem>  <listitem>
502  <para>  <para>
503  contents of <ulink url="&nm-do;">Debian New Maintainer site</ulink>  contents of <literal><command>man</command> <replaceable>command</replaceable></literal> for all pertinent commands
504  </para>  </para>
505  </listitem>  </listitem>
506  <listitem>  <listitem>
507  <para>  <para>
508  contents of <ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink>  contents of <literal><command>info</command> <replaceable>command</replaceable></literal> for all pertinent commands
509  </para>  </para>
510  </listitem>  </listitem>
511  <listitem>  <listitem>
# Line 545  contents of <ulink url="&debian-devel-ld Line 520  contents of <ulink url="&debian-devel-ld
520  </listitem>  </listitem>
521  </itemizedlist>  </itemizedlist>
522  <para>  <para>
523  Please consider to use web search engine effectively by including search string  You can use web search engines more effectively by including search strings
524  such as "<literal>site:lists.debian.org</literal>" to limit the domain.  such as <literal>site:lists.debian.org</literal> to limit the domain.
525  </para>  </para>
526  <para>  <para>
527  Making a small test package is good way to learn details of packaging.  Making a small test package is a good way to learn details of packaging.
528  Inspecting existing well maintained packages is the best way to learn how other  Inspecting existing well maintained packages is the best way to learn how other
529  people make packages.  people make packages.
530  </para>  </para>
# Line 575  in the available documentation and web r Line 550  in the available documentation and web r
550  </listitem>  </listitem>
551  </itemizedlist>  </itemizedlist>
552  <para>  <para>
553  The more experienced Debian developers will gladly help you, but do read at  The more experienced Debian developers will gladly help you, if you ask
554  least some of the documentation before asking a question!  properly after making your required efforts.
555  </para>  </para>
556  <para>  <para>
557  When you receive a bug report (yes, actual bug reports!), you will know that it  When you receive a bug report (yes, actual bug reports!), you will know that it
# Line 584  is time for you to dig into the Line 559  is time for you to dig into the
559  <ulink url="&bts;">Debian Bug Tracking System</ulink>  <ulink url="&bts;">Debian Bug Tracking System</ulink>
560  and read the documentation there, to be able to  and read the documentation there, to be able to
561  deal with the reports efficiently.  I highly recommend reading the  deal with the reports efficiently.  I highly recommend reading the
562  <ulink url="&devref-bug-handling;">Debian Developer's Reference, 5.8.  'Handling bugs'</ulink>.  <ulink url="&devref-bug-handling;">Debian Developer's Reference, 5.8:
563    "Handling bugs"</ulink>.
564  </para>  </para>
565  <para>  <para>
566  Even if it all worked well, it's time to start praying.  Why?  Because in just  Even if it all worked well, it's time to start praying.  Why?  Because in just
# Line 602  documentation</emphasis> for details). Line 578  documentation</emphasis> for details).
578  </chapter>  </chapter>
579  <chapter id="first"><title>First steps</title>  <chapter id="first"><title>First steps</title>
580  <para>  <para>
581  Let's try to make your own package (or, better even, adopt an existing one).  Let's start by creating a package of your own (or, even better,
582    adopting an existing one).
583    </para>
584    <section id="workflow"><title>Workflow of the Debian package building</title>
585    <para>
586    If you are making a Debian package with an upstream program,
587    typical workflow of the Debian package building involves generating several
588    specifically named files for each step as the following.
589    </para>
590    <itemizedlist>
591    <listitem>
592    <para>We obtain an upstream program file usually in a compressed tar format.</para>
593      <itemizedlist>
594      <listitem><literal><replaceable>programname</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem>
595      </itemizedlist>
596    </listitem>
597    <listitem>
598    <para>
599    We create a non-native Debian source package in the "3.0 (quilt)" format, which refers to the set of input files for
600    the Debian package building, by adding Debian package modifications to the upstream program under the <filename>debian</filename> directory.
601    </para>
602      <itemizedlist>
603      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem>
604      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.debian.tar.gz</literal>
605        <footnote><para>For the older non-native Debian source package in the "1.0" format,
606        <literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal>
607        is used instead. </para></footnote></listitem>
608      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem>
609      </itemizedlist>
610    </listitem>
611    <listitem>
612    <para>
613    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.
614    </para>
615      <itemizedlist>
616      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>
617      </itemizedlist>
618    </listitem>
619    </itemizedlist>
620    <para>
621    Please note that the character separating
622    <literal><replaceable>programname</replaceable></literal> and
623    <literal><replaceable>version</replaceable></literal> was changed from
624    <literal>-</literal> (hyphen) to <literal>_</literal> (underscore).
625    </para>
626    <para>
627    If you are making a Debian specific package without an upstream program instead,
628    typical workflow of the Debian package building is simpler.
629    </para>
630    <itemizedlist>
631    <listitem>
632    <para>
633    We create a native Debian source package in the "3.0 (native)" format using a compressed tar format in which required files under the <filename>debian</filename> directory are also included.
634  </para>  </para>
635      <itemizedlist>
636      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem>
637      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>.dsc</literal></listitem>
638      </itemizedlist>
639    </listitem>
640    <listitem>
641    <para>
642    We build Debian binary packages from the native Debian source package.
643    </para>
644      <itemizedlist>
645      <listitem><literal><replaceable>programname</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem>
646      </itemizedlist>
647    </listitem>
648    </itemizedlist>
649    <para>
650    Here,
651    <literal><replaceable>programname</replaceable></literal> part of the file name is substituted by the
652    <emphasis role="strong">package name</emphasis>,
653    <literal><replaceable>version</replaceable></literal> part of it is substituted by the
654    <emphasis role="strong">upstream version</emphasis>,
655    <literal><replaceable>revision</replaceable></literal> part of it is substituted by the
656    <emphasis role="strong">Debian revision</emphasis>,
657    <literal><replaceable>arch</replaceable></literal> part of it is substituted by the
658    <emphasis role="strong">package architecture</emphasis>.
659    <footnote><para>
660    The <emphasis role="strong">package name</emphasis>, <emphasis
661    role="strong">upstream version</emphasis>, and <emphasis role="strong">Debian
662    revision</emphasis> must be adjusted to comply with the Debian Policy Manual:
663    <ulink url="&policy-source;">5.6.1 Source</ulink>,
664    <ulink url="&policy-package;">5.6.7 Package</ulink>, and
665    <ulink url="&policy-version;">5.6.12 Version</ulink>.
666    The <emphasis role="strong">package architecture</emphasis> follows the
667    Debian Policy Manual: <ulink url="&policy-architecture;">5.6.8 Architecture</ulink>
668    and is automatically assigned by the package build process.</para></footnote>
669    </para>
670    <para>
671    In the following, each step of this is explained with detailed examples.
672    </para>
673    </section>
674  <section id="choose"><title>Choose your program</title>  <section id="choose"><title>Choose your program</title>
675  <para>  <para>
676  You have probably chosen the package you want to create.  The first thing you  You have probably chosen the package you want to create.  The first thing you
# Line 615  using the following. Line 682  using the following.
682  <para>the <command>aptitude</command> command</para>  <para>the <command>aptitude</command> command</para>
683  </listitem>  </listitem>
684  <listitem>  <listitem>
685  <para><ulink url="&packages-do;">Debian packages</ulink> web page</para>  <para>the <ulink url="&packages-do;">Debian packages</ulink> web page</para>
686  </listitem>  </listitem>
687  <listitem>  <listitem>
688  <para><ulink url="&packages-qa-do;">Debian Package Tracking System</ulink> web page</para>  <para>the <ulink url="&packages-qa-do;">Debian Package Tracking System</ulink> web page</para>
689  </listitem>  </listitem>
690  </itemizedlist>  </itemizedlist>
691  <para>  <para>
692  If the package already exists, well, install it!  :-) If it happens to be  If the package already exists, well, install it!  :-) If it happens to be
693  <emphasis role="strong">orphaned</emphasis> -- if its maintainer is set to  <emphasis role="strong">orphaned</emphasis> (that is, if its
694  <ulink url="&qa-do;">Debian QA Group</ulink>, you may be able to pick it up if  maintainer is set to <ulink url="&qa-do;">Debian QA Group</ulink>),
695  it's still available.  You may also adopt a package for which the corresponding  you may be able to pick it up if it's still available.  You may also
696  maintainer has filed a Request for Adoption  adopt a package whose maintainer has filed a Request for Adoption
697  (<emphasis role="strong">RFA</emphasis>).  (<emphasis role="strong">RFA</emphasis>).<footnote> <para>See
698    <ulink url="&devref-adopt;">Debian Developer's Reference 5.9.5.
699    "Adopting a package"</ulink>.</para> </footnote>
700  </para>  </para>
701  <para>  <para>
702  There are several package ownership status resorces.  There are several package ownership status resources.
703  </para>  </para>
704  <itemizedlist>  <itemizedlist>
705  <listitem>  <listitem>
706  <para> <ulink url="&wnpp-do;">Work-Needing and Prospective Packages</ulink> </para>  <para> <ulink url="&wnpp-do;">Work-Needing and Prospective Packages</ulink> </para>
707  </listitem>  </listitem>
708  <listitem>  <listitem>
709  <para> <ulink url="&wnpp-bts;">Debian Bug report logs: Bugs in package wnpp in unstable</ulink> </para>  <para> <ulink url="&wnpp-bts;">Debian Bug report logs: Bugs in pseudo-package <systemitem role="package">wnpp</systemitem> in <literal>unstable</literal></ulink> </para>
710  </listitem>  </listitem>
711  <listitem>  <listitem>
712  <para> <ulink url="&wnpp-dn;">Debian Packages that Need Lovin'</ulink> </para>  <para> <ulink url="&wnpp-dn;">Debian Packages that Need Lovin'</ulink> </para>
713  </listitem>  </listitem>
714  <listitem>  <listitem>
715  <para> <ulink url="&wnpp-debtags;">Browse WNPP bugs based on debtags</ulink> </para>  <para> <ulink url="&wnpp-debtags;">Browse <systemitem role="package">wnpp</systemitem> bugs based on debtags</ulink> </para>
716  </listitem>  </listitem>
717  </itemizedlist>  </itemizedlist>
718  <para>  <para>
# Line 652  for most kinds of programs, and the numb Line 721  for most kinds of programs, and the numb
721  archive is much larger than that of contributors with upload rights.  Thus,  archive is much larger than that of contributors with upload rights.  Thus,
722  contributions to packages already in the archive are far more appreciated (and  contributions to packages already in the archive are far more appreciated (and
723  more likely to receive sponsorship) by other developers <footnote><para> Having  more likely to receive sponsorship) by other developers <footnote><para> Having
724  said that, there will of course always be new programs that are worthwhile  said that, there will of course always be new programs that are worth
725  packaging.  </para> </footnote>.  You can do that in various ways.  packaging.  </para> </footnote>.  You can contribute in various ways.
726  </para>  </para>
727  <itemizedlist>  <itemizedlist>
728  <listitem>  <listitem>
# Line 683  If you are able to adopt the package, ge Line 752  If you are able to adopt the package, ge
752  examine them.  This document unfortunately doesn't include comprehensive  examine them.  This document unfortunately doesn't include comprehensive
753  information about adopting packages.  Thankfully you shouldn't have a hard time  information about adopting packages.  Thankfully you shouldn't have a hard time
754  figuring out how the package works since someone has already done the initial  figuring out how the package works since someone has already done the initial
755  set up for you.  Keep reading, though, a lot of the advice below will still be  setup for you.  Keep reading, though; a lot of the advice below will still be
756  applicable for your case.  applicable for your case.
757  </para>  </para>
758  <para>  <para>
# Line 693  as follows: Line 762  as follows:
762  <itemizedlist>  <itemizedlist>
763  <listitem>  <listitem>
764  <para>  <para>
765  First, you must know that program works, and have tried it for some time to  First, you must know that the program works, and have tried it for some time to
766  confirm its usefulness.  confirm its usefulness.
767  </para>  </para>
768  </listitem>  </listitem>
769  <listitem>  <listitem>
770  <para>  <para>
771  You must check if no one else is working on the package already at the  You must check that no one else is already working on the package on the
772  <ulink url="&wnpp-do;">Work-Needing and Prospective Packages</ulink> site.  <ulink url="&wnpp-do;">Work-Needing and Prospective Packages</ulink> site.
773  If no one else is working on it, file an ITP (Intent  If no one else is working on it, file an ITP (Intent
774  To Package) bug report to the <systemitem role="package">wnpp</systemitem>  To Package) bug report to the <systemitem role="package">wnpp</systemitem>
775  pseudo-package using <command>reportbug</command>.  If someone's already on it,  pseudo-package using <command>reportbug</command>.  If someone's already on it,
776  contact them if you feel you need to.  If not - find another interesting  contact them if you feel you need to.  If not - find another interesting
777  program that nobody maintains.  program that nobody is maintaining.
778  </para>  </para>
779  </listitem>  </listitem>
780  <listitem>  <listitem>
781  <para>  <para>
782  That program <emphasis role="strong">must have a license</emphasis>.  The software <emphasis role="strong">must have a license</emphasis>.
783  </para>  </para>
784  <itemizedlist>  <itemizedlist>
785  <listitem>  <listitem>
786  <para>  <para>
787  For the <literal>main</literal> section, it <emphasis role="strong">must be  For the <literal>main</literal> section, Debian Policy requires it
788  compliant to all the Debian Free Software Guidelines</emphasis> (<ulink url="&dfsg;">DFSG</ulink>)  <emphasis role="strong">to be fully compliant with the Debian Free Software
789  and <emphasis role="strong">that program must not require a package outside of  Guidelines</emphasis> (<ulink url="&dfsg;">DFSG</ulink>)
790  <literal>main</literal></emphasis> for compilation or execution as required by  and <emphasis role="strong">not to require a package outside of
791  the Debian Policy.  This is desired case.  <literal>main</literal></emphasis> for compilation or execution.  This
792    is the desired case.
793  </para>  </para>
794  </listitem>  </listitem>
795  <listitem>  <listitem>
796  <para>  <para>
797  For the <literal>contrib</literal> section, it must be compliant to all the  For the <literal>contrib</literal> section, it must comply with the
798  DFSG but it may require a package outside of <literal>main</literal> for  DFSG but it may require a package outside of <literal>main</literal> for
799  compilation or execution.  compilation or execution.
800  </para>  </para>
801  </listitem>  </listitem>
802  <listitem>  <listitem>
803  <para>  <para>
804  For the <literal>non-free</literal> section, it may not be compliant to some of  For the <literal>non-free</literal> section, it may be non-compliant
805  the DFSG but it <emphasis role="strong">must be distributable</emphasis>.  with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.
806  </para>  </para>
807  </listitem>  </listitem>
808  </itemizedlist>  </itemizedlist>
# Line 743  and ask for advice. Line 813  and ask for advice.
813  </listitem>  </listitem>
814  <listitem>  <listitem>
815  <para>  <para>
816  That program certainly should <emphasis role="strong">not</emphasis> run setuid  The program certainly should <emphasis role="strong">not</emphasis> run setuid
817  root, or even better - it shouldn't need to be setuid or setgid to anything.  root, or even better, it shouldn't need to be setuid or setgid to anything.
818  </para>  </para>
819  </listitem>  </listitem>
820  <listitem>  <listitem>
821  <para>  <para>
822  That program should not be a daemon, or something that goes in  The program should not be a daemon, or go in an
823  <filename>*/sbin</filename> directories, or open a port as root.  <filename>*/sbin</filename> directory, or open a port as root.
824  </para>  </para>
825  </listitem>  </listitem>
826  <listitem>  <listitem>
827  <para>  <para>
828  That program should result in binary executable form, libraries are harder to  The program should be in binary executable form; libraries are harder to handle.
 handle.  
829  </para>  </para>
830  </listitem>  </listitem>
831  <listitem>  <listitem>
832  <para>  <para>
833  That program should be well documented and its code needs to be understandable  The program should be well documented and its code needs to be understandable
834  (i.e.  not obfuscated).  (i.e.  not obfuscated).
835  </para>  </para>
836  </listitem>  </listitem>
837  <listitem>  <listitem>
838  <para>  <para>
839  You should contact program's author(s) to check if they agree with packaging it  You should contact the program's author(s) to check if they agree with packaging it
840  and amicable to Debian.  It is important to be able to consult with author(s)  and are amicable to Debian.  It is important to be able to consult with the author(s)
841  about the program in case of any program specific problems, so don't try to  in case of any problems with the program, so don't try to package
842  package unmaintained pieces of software.  unmaintained software.
843  </para>  </para>
844  </listitem>  </listitem>
845  </itemizedlist>  </itemizedlist>
846  <para>  <para>
847  Of course, these things are just safety measures, and intended to save you from  Of course, these are just safety measures, and intended to save you from
848  raging users if you do something wrong in some setuid daemon...  When you gain  enraging users if you do something wrong in some setuid daemon...  When you gain
849  some more experience in packaging, you'll be able to package such packages.  more experience in packaging, you'll be able to package such software.
850  </para>  </para>
851  </section>  </section>
852  <section id="getit"><title>Get the program, and try it out</title>  <section id="getit"><title>Get the program, and try it out</title>
853  <para>  <para>
854  So the first thing to do is to find and download the original source code.  I  So the first thing to do is to find and download the original source code.
855  presume that you already have the source file that you picked up at the  Presumably you already have the source file that you picked up at the
856  author's homepage.  Sources for free Unix programs usually come in  author's homepage.  Sources for free Unix programs usually come in
857  <command>tar</command>+<command>gzip</command> format with extension  <command>tar</command>+<command>gzip</command> format with the extension
858  <filename>.tar.gz</filename>, or  <filename>.tar.gz</filename>,
859  <command>tar</command>+<command>bzip2</command> format with extension  <command>tar</command>+<command>bzip2</command> format with the extension
860  <filename>.tar.bz2</filename>.  These usually contain the subdirectory called  <filename>.tar.bz2</filename>, or
861    <command>tar</command>+<command>xz</command> format with the extension
862    <filename>.tar.xz</filename>.  These usually contain a directory called
863  <filename><replaceable>programname</replaceable>-<replaceable>version</replaceable></filename>  <filename><replaceable>programname</replaceable>-<replaceable>version</replaceable></filename>
864  in them and all the sources under it.  with all the sources inside.
865  </para>  </para>
866  <para>  <para>
867  If the latest version of such sources are available through VCS such as Git,  If the latest version of the source is available through a VCS such as Git,
868  Subversion, or CVS repository, you need to get it with <literal>git  Subversion, or CVS, you need to get it with <literal>git
869  clone</literal>, <literal>svn co</literal>, or <literal>cvs co</literal> and  clone</literal>, <literal>svn co</literal>, or <literal>cvs co</literal> and
870  repack it into <command>tar</command>+<command>gzip</command> format by  repack it into <command>tar</command>+<command>gzip</command> format yourself
871  yourself using the <literal>--exclude-vcs</literal> option.  by using the <literal>--exclude-vcs</literal> option.
872  </para>  </para>
873  <para>  <para>
874  If your program's source comes as some other sort of archive (for instance, the  If your program's source comes as some other sort of archive (for instance, the
875  filename ends in <filename>.Z</filename> or  filename ends in <filename>.Z</filename> or
876  <filename>.zip</filename><footnote><para> You can identify the archive format  <filename>.zip</filename><footnote><para> You can identify the archive format
877  using the <command>file</command> command when the file extension is not  using the <command>file</command> command when the file extension is not
878  enough.  </para> </footnote>), unpack it with appropriate tools and repack it,  enough.  </para> </footnote>), you should also unpack it with the
879  too.  appropriate tools and repack it.
880  </para>  </para>
881  <para>  <para>
882  As an example, I'll use a program called <command>gentoo</command>, an X GTK+  As an example, I'll use a program called <command>gentoo</command>, a GTK+
883  file manager.<footnote><para> This program is already packaged.  file manager.
884  <ulink url="&gentoo-package;">Current  <footnote><para> This program is already packaged. The
885  version</ulink> has changed substantially from the version 0.9.12 in the  <ulink url="&gentoo-package;">current version</ulink> uses Autotools as its
886  following examples.</para> </footnote>  build structure and is substantially different from the following examples,
887    which were based on version 0.9.12.</para>
888    </footnote>
889  </para>  </para>
890  <para>  <para>
891  Create a subdirectory under your home directory named  Create a subdirectory under your home directory named
892  <filename>debian</filename> or <filename>deb</filename> or anything you find  <filename>debian</filename> or <filename>deb</filename> or anything you find
893  appropriate (e.g.  just <filename>~/gentoo</filename> would do fine in this  appropriate (e.g.  just <filename>~/gentoo</filename> would do fine in this
894  case).  Place the downloaded archive in it, and extract it (with <literal>tar  case).  Place the downloaded archive in it, and extract it (with <literal>tar
895  xzf gentoo-0.9.12.tar.gz</literal>).  Make sure there are no errors, even some  xzf gentoo-0.9.12.tar.gz</literal>).  Make sure there are no warning
896  <emphasis>irrelevant</emphasis> ones, because there will most probably be  messages, even <emphasis>irrelevant</emphasis> ones, because other
897  problems unpacking on other people's systems, whose unpacking tools may or may  people's unpacking tools may or may not ignore these anomalies, so they
898  not ignore those anomalies.  On your console screen, you should see the  may have problems unpacking them.  Your shell command line may look
899  following.  something like this:
900  </para>  </para>
901  <screen>  <screen>
902  $ mkdir ~/gentoo ; cd ~/gentoo  $ mkdir ~/gentoo ; cd ~/gentoo
# Line 838  Now you have another subdirectory, calle Line 911  Now you have another subdirectory, calle
911  Change to that directory and <emphasis>thoroughly</emphasis> read the provided  Change to that directory and <emphasis>thoroughly</emphasis> read the provided
912  documentation.  Usually there are files named <filename>README*</filename>,  documentation.  Usually there are files named <filename>README*</filename>,
913  <filename>INSTALL*</filename>, <filename>*.lsm</filename> or  <filename>INSTALL*</filename>, <filename>*.lsm</filename> or
914  <filename>*.html</filename>.  You must find instructions on how to correctly  <filename>*.html</filename>.  You must find instructions on how to
915  compile and install the program (most probably they'll assume you want to  compile and install the program (most probably they'll assume you want to
916  install to <filename>/usr/local/bin</filename> directory; you won't be doing  install to the <filename>/usr/local/bin</filename> directory; you won't be doing
917  that, but more on that later in <xref linkend="destdir"/> ).  that, but more on that later in <xref linkend="destdir"/>).
918  </para>  </para>
919  <para>  <para>
920  Simple programs come with a <filename>Makefile</filename> file in them and can  You should start packaging with a completely clean (pristine) source directory,
921  be compiled simply with <literal>make</literal>.<footnote><para>  or simply with freshly unpacked sources.
922    </para>
923    </section>
924    <section id="simplemake"><title>Simple build systems</title>
925    <para>
926    Simple programs come with a <filename>Makefile</filename> and can
927    be compiled just by invoking <literal>make</literal>.<footnote><para>
928  Many modern programs come with a script <filename>configure</filename> which  Many modern programs come with a script <filename>configure</filename> which
929  creates a <filename>Makefile</filename> file customized for your system upon  when executed creates a <filename>Makefile</filename> customized for
930  its execution.</para></footnote> Some of them support  your system.</para></footnote> Some of them support
931  <literal>make check</literal>, which runs included self-checks.  Installation  <literal>make check</literal>, which runs included self-tests.  Installation
932  to the destination directories is usually done with <literal>make  to the destination directories is usually done with <literal>make
933  install</literal>.  install</literal>.
934  </para>  </para>
# Line 864  there's even a <literal>make uninstall</ Line 943  there's even a <literal>make uninstall</
943  all the installed files.  all the installed files.
944  </para>  </para>
945  </section>  </section>
946  <section id="portable"><title>Free portable programs</title>  <section id="portable"><title>Popular portable build systems</title>
947  <para>  <para>
948  A lot of Free programs are written in the <ulink url="&c-program;">C</ulink> and  A lot of free software programs are written in the <ulink url="&c-program;">C</ulink> and
949  <ulink url="&cxx;">C++</ulink> languages.  Many of  <ulink url="&cxx;">C++</ulink> languages.  Many of these use Autotools or
950  these use Autotools or CMake to make them portable across different platforms.  CMake to make them portable across different platforms.  These build tools need
951  These tools are used to generate <filename>Makefile</filename> and other  to be used to generate the <filename>Makefile</filename> and other
952  required source files.  Then, such programs are built with usual <literal>make;  required source files first.  Then, such programs are built using the usual
953  make install</literal>.  <literal>make; make install</literal>.
954  </para>  </para>
955  <para>  <para>
956  <ulink url="&gnu-build-system;">Autotools</ulink>  <ulink url="&gnu-build-system;">Autotools</ulink> is the GNU build
957  are the GNU build system comprising <ulink url="&autoconf;">Autoconf</ulink>, <ulink url="&automake;">Automake</ulink>, <ulink url="&libtool;">Libtool</ulink>, and <ulink url="&gettext;">gettext</ulink>.  You can notice  system comprising <ulink url="&autoconf;">Autoconf</ulink>,
958    <ulink url="&automake;">Automake</ulink>,
959    <ulink url="&libtool;">Libtool</ulink>, and
960    <ulink url="&gettext;">gettext</ulink>.  You can recognize
961  such sources by the <filename>configure.ac</filename>,  such sources by the <filename>configure.ac</filename>,
962  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.  <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.
963  <footnote><para> See <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink>  <footnote><para>Autotools is too big to deal in this small tutorial. This
964  and <ulink url="&autotools-readme;"/>.  </para> </footnote>  section is mean to provide keywords and references only.  Please make sure to read the
965    <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and
966    <ulink url="&autotools-readme;"/>, if you need to use it.</para></footnote>
967  </para>  </para>
968  <para>  <para>
969  The first step of Autotools work flow is usually that the upstream runs  The first step of the Autotools workflow is usually that upstream runs
970  <literal>autoreconf -i -f</literal> in the source and distributes this source  <literal>autoreconf -i -f</literal> in the source directory and
971  with generated files.  distributes the generated files along with the source.
972  </para>  </para>
973  <screen>  <screen>
974  configure.ac-----+-&gt; autoreconf -+-&gt; configure  configure.ac-----+-&gt; autoreconf -+-&gt; configure
# Line 903  files requires some knowledge of <comman Line 987  files requires some knowledge of <comman
987  <literal>info automake</literal>.  <literal>info automake</literal>.
988  </para>  </para>
989  <para>  <para>
990  The second step of Autotools work flow is usually that the user obtains this  The second step of the Autotools workflow is usually that the user obtains this
991  distributed source and runs <literal>./configure &amp;&amp; make</literal> in  distributed source and runs <literal>./configure &amp;&amp; make</literal> in
992  the source to compile program into a  the source directory to compile the program into a
993  <command><replaceable>binary</replaceable></command>.  <command><replaceable>binary</replaceable></command>.
994  </para>  </para>
995  <screen>  <screen>
# Line 917  config.h.in -----+                +-&gt; Line 1001  config.h.in -----+                +-&gt;
1001             config.guess --+             config.guess --+
1002  </screen>  </screen>
1003  <para>  <para>
1004  You can change many things in the <filename>Makefile</filename> file such as  You can change many things in the <filename>Makefile</filename>; for
1005  the default file install location using the command option, e.g.  instance you can change the default location for file installation
1006  <command>./configure --prefix=/usr</command>.  using the option <command>./configure --prefix=/usr</command>.
1007  </para>  </para>
1008  <para>  <para>
1009  Although it is not required, updating the <filename>configure</filename> and  Although it is not required, updating the <filename>configure</filename> and
1010  other files with <literal>autoreconf -i -f</literal> as the user may improve  other files with <literal>autoreconf -i -f</literal> may improve
1011  the compatibility of the source.  the compatibility of the source.
1012    <footnote><para>You can automate this by using
1013    <systemitem role="package">dh-autoreconf</systemitem> package.
1014    See <xref linkend="customrules"/>.</para></footnote>
1015  </para>  </para>
1016  <para>  <para>
1017  <ulink url="&cmake;">CMake</ulink> is an alternative  <ulink url="&cmake;">CMake</ulink> is an alternative
1018  build system.  You can notice such sources by the  build system.  You can recognize such sources by the
1019  <filename>CMakeLists.txt</filename> file.  <filename>CMakeLists.txt</filename> file.
1020  </para>  </para>
1021  </section>  </section>
1022  <section id="namever"><title>Package name and version</title>  <section id="namever"><title>Package name and version</title>
1023  <para>  <para>
1024  You should start packaging with a completely clean (pristine) source directory,  If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can
1025  or simply with freshly unpacked sources.  consider
1026    <emphasis role="strong">package name</emphasis> to be <literal>gentoo</literal> and
1027    <emphasis role="strong">upstream version</emphasis> to be <literal>0.9.12</literal>.
1028    These are used in the <filename>debian/changelog</filename> file described later in
1029    <xref linkend="changelog"/>, too.
1030    </para>
1031    <para>
1032    Although this simple approach works most of the times, you may need to adjust
1033    <emphasis role="strong">package name</emphasis> and
1034    <emphasis role="strong">upstream version</emphasis> by renaming the upstream
1035    source to follow the Debian policy and the existing convention.
1036    </para>
1037    <para>
1038    You must choose the <emphasis role="strong">package name</emphasis>
1039    to consist only of lower case letters (<literal>a-z</literal>), digits
1040    (<literal>0-9</literal>), plus (<literal>+</literal>) and minus
1041    (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be
1042    at least two characters long, must start with an alphanumeric character, and
1043    must not be the same as existing ones.
1044    It is good idea to keep its length within 30 characters and should not exceed
1045    40 characters.
1046  </para>  </para>
1047    <!--
1048    Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
1049    === stat for package name string length ===
1050    11 1947 36.9%   mode
1051    14 1717 54.7%  50% median
1052    23 611 91.0%   90%
1053    32 89 99.0%    99%
1054    41 12 99.9%    99.9%
1055    52 1 100.0%
1056    Previous 20 chars is becoming too short for 17% of packages
1057    Default aptitude setting display up to 30 chars (98.3%).
1058    -->
1059  <para>  <para>
1060  For the package to be built correctly, you must make the program's original  If upstream source uses generic words such as <literal>test-suite</literal> as
1061  name lowercase (if it isn't already), and you should move the source directory  its name, it is good idea to rename it not to contaminate name space for the
1062  to  package name and to identify its contents explicitly.
1063  <filename><replaceable>packagename</replaceable>-<replaceable>version</replaceable></filename>.  <footnote><para>If you follow the
1064  </para>  <ulink url="&devref-newpackage;">Developer's Reference 5.1. 'New packages'</ulink>,
1065  <para>  the ITP process will usually catch this kind of issues.</para></footnote>.
 If the program name consists of more than one word, contract them to one word,  
 or make an abbreviation.  For example, program John's little editor for X  
 package would be named <systemitem role="package">johnledx</systemitem>, or  
 <systemitem role="package">jle4x</systemitem>, or whatever you decide, as long  
 as it's under some reasonable limit, e.g.  20 characters.  
 </para>  
 <para>  
 Also check for the exact version of the program (to be included in the package  
 version).  If that piece of software is not numbered with versions like  
 <literal>X.Y.Z</literal>, but with some kind of date, feel free to use that  
 date as the version number, as long as newer version numbers will look larger.  
 While it is best to use the same version number as what upstream uses, if it is  
 in the format of <literal>09Oct23</literal> you may need to convert it to  
 <literal>YYYYMMDD</literal> format, which would be <literal>20091023</literal>,  
 to ensure proper order for upgrade with the <command>dpkg</command>  
 program.<footnote><para> Version string can be compared by <literal>dpkg  
 --compare-versions <replaceable>ver1</replaceable>  
 <replaceable>op</replaceable> <replaceable>ver2</replaceable></literal>.  See  
 <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum>  
 </citerefentry> manpage.  </para> </footnote>  
1066  </para>  </para>
1067  <para>  <para>
1068  Some programs won't be numbered at all, in which case you should contact the  You should choose the <emphasis role="strong">upstream version</emphasis>
1069  upstream maintainer to see if they've got some other revision-tracking method.  to consist only of
1070    alphanumerics (<literal>0-9A-Za-z</literal>), plus (<literal>+</literal>),
1071    tilde (<literal>~</literal>), and periods (<literal>.</literal>). It must
1072    start with a digit (<literal>0-9</literal>).  <footnote><para>This stricter
1073    rule should help you avoid confusing file names.</para></footnote>
1074    It is good idea to keep its length within 8 characters if possible.
1075    </para>
1076    <!--
1077    Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64):
1078    === stat for upstream version string length ===
1079    5 9765 60.2%  50% median and mode
1080    6 3765 73.3%
1081    7 2789 82.9%
1082    8 1158 86.9%
1083    9 501 88.6%
1084    10 773 91.3%  90%
1085    18 55 99.1%   99%
1086    27 11 99.9%    99.9
1087    35 6 100.0%
1088    === stat for debian revision string length ===
1089    1 22556 83.3%  50% median and mode
1090    2 1106 87.2%
1091    3 1312 91.7%   90%
1092    4 2127 99.1%   99%
1093    7 14 99.9%     99.9%
1094    
1095    aptitude display 10 = 8char for up + 1char (for -) + 1char for deb
1096    90chars as max for file name of binary debs (package+up+deb+arch+.deb)
1097    -->
1098    <para>
1099    If the upstream software does not use normal version system like
1100    <literal>2.30.32</literal> but uses some kind of date such as
1101    <literal>09Oct23</literal>, a random codename string or a VCS hush value as a part
1102    of version, make sure to remove them from the
1103    <emphasis role="strong">upstream version</emphasis>.  Such information can be
1104    recorded in the <filename>debian/changelog</filename> file.  If you need to
1105    invent a version string, use the <literal>YYYYMMDD</literal> format such as
1106    <literal>20110429</literal> as upstream version.  This ensures that
1107    <command>dpkg</command> properly sees later versions as upgrades.
1108    </para>
1109    <para>
1110    Version strings can be compared with <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as the following.
1111    </para>
1112    <screen>
1113     $ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable>
1114    </screen>
1115    <para>
1116    The version comparison rule can be summarized as the folowing.
1117    </para>
1118    <itemizedlist>
1119    <listitem><para>The strings are compared from the head to the tail.</para></listitem>
1120    <listitem><para>Alphabets are larger than numbers.</para></listitem>
1121    <listitem><para>Numbers are compared as the integer.</para></listitem>
1122    <listitem><para>Alphabets are compared in the ASCII code order.</para></listitem>
1123    <listitem><para>There are some special rules for periods (<literal>.</literal>), plus (<literal>+</literal>) and tilde (<literal>~</literal>) as the followings.</para>
1124      <para>
1125      <literal>0.0</literal> &lt;
1126      <literal>0.5</literal> &lt;
1127      <literal>0.10</literal> &lt;
1128      <literal>0.99</literal> &lt;
1129      <literal>1</literal> &lt;
1130      <literal>1.0~rc1</literal> &lt;
1131      <literal>1.0</literal> &lt;
1132      <literal>1.0+b1</literal> &lt;
1133      <literal>1.0+nmu1</literal> &lt;
1134      <literal>1.1</literal> &lt;
1135      <literal>2.0</literal>
1136      </para>
1137    </listitem>
1138    </itemizedlist>
1139    <para>
1140    One of the tricky case happens when the upstream releases
1141    <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the
1142    pre-release of <filename>gentoo-0.9.12.tar.gz</filename>.  You need to make
1143    sure that the upgrade works properly by renaming the upstream source to
1144    <filename>gentoo-0.9.12~rc99.tar.gz</filename>.
1145  </para>  </para>
1146  </section>  </section>
1147  <section id="dh-make"><title>Initial Debian package</title>  <section id="dh-make"><title>Initial Debian package</title>
1148  <para>  <para>
1149  Let's set up the shell environment variable <literal>$DEBEMAIL</literal> and  Set up the shell environment variables <literal>$DEBEMAIL</literal> and
1150  <literal>$DEBFULLNAME</literal> so many Debian maintenance tools recognize your  <literal>$DEBFULLNAME</literal> so that various Debian maintenance
1151  name and email address to use for packages as follows.<footnote><para> The  tools recognize your email address and name to use for packages. <footnote><para> The
1152  following text assumes you are using Bash as your login shell.  If you use  following text assumes you are using Bash as your login shell.  If you use
1153  other login shells such as Z shell, use their pertinent configuration files  some other login shell such as Z shell, use their corresponding
1154  instead of <filename>~/.bashrc</filename>.  </para> </footnote>.  configuration files instead of <filename>~/.bashrc</filename>. </para> </footnote>
1155  </para>  </para>
1156  <screen>  <screen>
1157  $ cat &gt;&gt;~/.bashrc &lt;&lt;EOF  $ cat &gt;&gt;~/.bashrc &lt;&lt;EOF
# Line 987  export DEBEMAIL DEBFULLNAME Line 1161  export DEBEMAIL DEBFULLNAME
1161  EOF  EOF
1162  </screen>  </screen>
1163  <para>  <para>
1164  Let's make an initial Debian package by issuing the <command>dh_make</command>  You can create an initial Debian package by issuing the
1165  command as follows.  <command>dh_make</command> command as follows.
1166  </para>  </para>
1167  <screen>  <screen>
1168  $ . ~/.bashrc  $ . ~/.bashrc
# Line 999  $ dh_make -f ../gentoo-0.9.12.tar.gz Line 1173  $ dh_make -f ../gentoo-0.9.12.tar.gz
1173  Of course, replace the filename with the name of your original source archive.  Of course, replace the filename with the name of your original source archive.
1174  <footnote><para> If the upstream source provides the  <footnote><para> If the upstream source provides the
1175  <filename>debian</filename> directory and its contents, run the  <filename>debian</filename> directory and its contents, run the
1176  <command>dh_make</command> command with the <literal>--addmissing</literal>  <command>dh_make</command> command with the extra option
1177  option, instead.  The new source <literal>3.0 (quilt)</literal> format is quite  <literal>--addmissing</literal>.  The new source <literal>3.0 (quilt)</literal> format is
1178  robust not to break even for these packages.  You may need to update contents  robust enough not to break even for these packages.  You may need to update the contents
1179  provided by the upstream for your Debian package.  </para> </footnote> See  provided by the upstream for your Debian package.  </para> </footnote> See
1180  <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>1</manvolnum>  <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>1</manvolnum>
1181  </citerefentry> for details.  </citerefentry> for details.
1182  </para>  </para>
1183  <para>  <para>
1184  Some information will come up.  It will ask you what sort of package you want  You should see some output asking you what sort of package you want
1185  to create.  Gentoo is a single binary package - it creates only one binary, and  to create.  Gentoo is a single binary package - it creates only one binary, and
1186  thus one <filename>.deb</filename> file - so we will select the first option,  thus one <filename>.deb</filename> file - so we will select the first option
1187  with the <literal>s</literal> key, check the information on the screen and  (with the <literal>s</literal> key), check the information on the screen, and
1188  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.  confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.
1189  <footnote><para> There are few choices here: <literal>s</literal> for Single  <footnote><para> There are several choices here: <literal>s</literal> for Single
1190  binary, <literal>i</literal> for Arch-Independent, <literal>m</literal> for  binary, <literal>i</literal> for arch-Independent, <literal>m</literal> for
1191  Multiple binary, <literal>l</literal> for Library, <literal>k</literal> for  Multiple binary, <literal>l</literal> for Library, <literal>k</literal> for
1192  Kernel module, <literal>n</literal> for Kernel patch and <literal>b</literal>  Kernel module, <literal>n</literal> for kernel patch, and <literal>b</literal>
1193  for <systemitem role="package">cdbs</systemitem>.  This document focuses on the  for <systemitem role="package">cdbs</systemitem>.  This document focuses on the
1194  use of the <systemitem role="package">debhelper</systemitem> package with the  use of the <command>dh</command> command (from the package
1195  <command>dh</command> command.  This document focuses on the use of the new  <systemitem role="package">debhelper</systemitem>) to create a single-binary package,
1196  <command>dh</command> command for Single binary and touches on it for  but also touches on how to use it for arch-independent or
1197  Arch-Independent and Multiple binary.  The <systemitem role="package">cdbs</systemitem> package offers alternative package script  multiple-binary packages.  The package
1198  infrastructure to the <command>dh</command> command and outside of the scope of  <systemitem role="package">cdbs</systemitem> offers an alternative packaging script
1199    infrastructure to the <command>dh</command> command and is outside the scope of
1200  this document.  </para> </footnote>  this document.  </para> </footnote>
1201  </para>  </para>
1202  <para>  <para>
1203  After this execution of <command>dh_make</command>, a copy of the upstream  This execution of <command>dh_make</command> creates a copy of the upstream
1204  tarball is created as <filename>gentoo_0.9.12.orig.tar.gz</filename> in the  tarball as <filename>gentoo_0.9.12.orig.tar.gz</filename> in the
1205  parent directory to accommodate the creation of the non-native Debian source  parent directory to accommodate the creation of the non-native Debian source
1206  package with the <filename>debian.tar.gz</filename> later.  package with the name <filename>debian.tar.gz</filename> later.
1207  </para>  </para>
1208  <screen>  <screen>
1209  $ cd ~/gentoo ; ls -F  $ cd ~/gentoo ; ls -F
# Line 1037  gentoo-0.9.12.tar.gz Line 1212  gentoo-0.9.12.tar.gz
1212  gentoo_0.9.12.orig.tar.gz  gentoo_0.9.12.orig.tar.gz
1213  </screen>  </screen>
1214  <para>  <para>
1215  Please note 2 key features in this  Please note two key features of this filename
1216  <filename>gentoo_0.9.12.orig.tar.gz</filename> file name:  <filename>gentoo_0.9.12.orig.tar.gz</filename>:
1217  </para>  </para>
1218  <itemizedlist>  <itemizedlist>
1219  <listitem>  <listitem>
1220  <para>  <para>
1221  Package name and version are separated by the <literal>_</literal>  Package name and version are separated by the character <literal>_</literal>
1222  (underscore).  (underscore).
1223  </para>  </para>
1224  </listitem>  </listitem>
1225  <listitem>  <listitem>
1226  <para>  <para>
1227  There is the <filename>.orig</filename> before the  The string <filename>.orig</filename> is inserted before the
1228  <filename>.tar.gz</filename>.  <filename>.tar.gz</filename>.
1229  </para>  </para>
1230  </listitem>  </listitem>
1231  </itemizedlist>  </itemizedlist>
1232  <para>  <para>
1233  You should also notice that many template files are created in the source under  You should also notice that many template files are created in the source under
1234  the <filename>debian</filename> directory.  These will be explained in <xref linkend="dreq"/> and <xref linkend="dother"/> .  You should also understand  the <filename>debian</filename> directory.  These will be explained in
1235  that the packaging is not automatic process.  You need to modify the upstream  <xref linkend="dreq"/> and <xref linkend="dother"/>.  You should also understand
1236  source for Debian as <xref linkend="modify"/> .  After all these, you need to  that packaging cannot be a fully automated process.  You will need to modify the upstream
1237  build Debian packages under the proper method as <xref linkend="build"/> ,  source for Debian (see <xref linkend="modify"/>).  After this, you need to
1238  check them as <xref linkend="checkit"/> , and upload them as <xref linkend="upload"/> .  I will explain all these steps.  use the proper methods for building Debian packages (<xref linkend="build"/>),
1239    testing them (<xref linkend="checkit"/>), and uploading them (<xref linkend="upload"/>).
1240    All the steps will be explained.
1241  </para>  </para>
1242  <para>  <para>
1243  Once again, as a new maintainer you are discouraged from creating complicated  Once again, as a new maintainer you are discouraged from creating complicated
1244  packages, e.g.,  packages, e.g.:
1245  </para>  </para>
1246  <itemizedlist>  <itemizedlist>
1247  <listitem>  <listitem>
1248  <para>  <para>
1249  multiple binary packages,  multiple binary packages;
1250  </para>  </para>
1251  </listitem>  </listitem>
1252  <listitem>  <listitem>
1253  <para>  <para>
1254  library packages,  library packages;
1255  </para>  </para>
1256  </listitem>  </listitem>
1257  <listitem>  <listitem>
1258  <para>  <para>
1259  kernel module packages,  kernel module packages;
1260  </para>  </para>
1261  </listitem>  </listitem>
1262  <listitem>  <listitem>
1263  <para>  <para>
1264  kernel patch packages,  kernel patch packages;
1265  </para>  </para>
1266  </listitem>  </listitem>
1267  <listitem>  <listitem>
1268  <para>  <para>
1269  the source file format being neither in <filename>tar.gz</filename> nor  packages with the source in a format other than <filename>tar.gz</filename> or
1270  <filename>tar.bz2</filename>, or  <filename>tar.bz2</filename>; or
1271  </para>  </para>
1272  </listitem>  </listitem>
1273  <listitem>  <listitem>
1274  <para>  <para>
1275  the source tarball containing undistributable contents.  packages where the source tarball contains undistributable contents.
1276  </para>  </para>
1277  </listitem>  </listitem>
1278  </itemizedlist>  </itemizedlist>
1279  <para>  <para>
1280  It's not too hard, but it does require a bit more knowledge, so we won't  Doing so is not too hard, but it requires a bit more knowledge, so we won't
1281  describe all of it here.  describe all of it here.
1282  </para>  </para>
1283  <para>  <para>
# Line 1110  recover them by running <command>dh_make Line 1287  recover them by running <command>dh_make
1287  </para>  </para>
1288  <para>  <para>
1289  Updating an existing package may get complicated since it may be using older  Updating an existing package may get complicated since it may be using older
1290  techniques.  Please stick with fresh packaging cases for now to learn basics.  techniques.  While learning the basics, please stick to creating a fresh
1291  I will come back to explain it later in <xref linkend="update"/> .  package; further explanations are given in <xref linkend="update"/>.
1292  </para>  </para>
1293  </section>  </section>
1294  </chapter>  </chapter>
# Line 1121  Please note that there isn't space here Line 1298  Please note that there isn't space here
1298  details of fixing upstream sources, but here are some basic steps and problems  details of fixing upstream sources, but here are some basic steps and problems
1299  people often run across.  people often run across.
1300  </para>  </para>
1301  <section id="quiltrc"><title>Set up <command>quilt</command></title>  <section id="quiltrc"><title>Setting up <command>quilt</command></title>
1302  <para>  <para>
1303  The <command>quilt</command> program offers the basic method to record  The program <command>quilt</command> offers a basic method for recording
1304  modification to the source for the Debian packaging.  Since slightly different  modifications to the upstream source for Debian packaging.  It's
1305  default is desirable for Debian packaging, let's set up  useful to have a slightly customized default, so let's create an alias
1306  <filename>~/.quiltrc</filename> as follows.  <footnote><para> You can disable  <command>dquilt</command> for Debian packaging by adding the following
1307  this configuration by starting the <command>quilt</command> command as  line to <filename>~/.bashrc</filename>.
1308  <literal>quilt --quiltrc /dev/null ...</literal>.  </para> </footnote>  </para>
1309    <screen>
1310    alias dquilt="quilt --quiltrc=~/.quiltrc-dpkg"
1311    </screen>
1312    <para>
1313    Then let's create <filename>~/.quiltrc-dpkg</filename> as follows.
1314  </para>  </para>
1315  <screen>  <screen>
1316  d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done  d=. ; while [ ! -d $d/debian -a `readlink -e $d` != / ]; do d=$d/..; done
1317  if [ -d $d/debian ] &amp;&amp; [ -z $QUILT_PATCHES ]; then  if [ -d $d/debian ] &amp;&amp; [ -z $QUILT_PATCHES ]; then
1318      # Debian packaging case and unset $QUILT_PATCHES      # if in Debian packaging tree with unset $QUILT_PATCHES
1319      QUILT_PATCHES=debian/patches      QUILT_PATCHES="debian/patches"
1320      QUILT_PATCH_OPTS=--reject-format=unified      QUILT_PATCH_OPTS="--reject-format=unified"
1321      QUILT_DIFF_ARGS=-p ab --no-timestamps --no-index --color=auto      QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
1322      QUILT_REFRESH_ARGS=-p ab --no-timestamps --no-index      QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
1323      QUILT_COLORS=diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33      QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
1324      if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi      if ! [ -d $d/debian/patches ]; then mkdir $d/debian/patches; fi
1325  fi  fi
1326  </screen>  </screen>
1327  <para>  <para>
1328  See <citerefentry> <refentrytitle>quilt</refentrytitle>  See <citerefentry> <refentrytitle>quilt</refentrytitle>
1329  <manvolnum>1</manvolnum> </citerefentry> and  <manvolnum>1</manvolnum> </citerefentry> and
1330  <ulink url="&quilt-pdf;">quilt.pdf</ulink> for how to use  <ulink url="&quilt-pdf;">quilt.pdf</ulink> on how to use
1331  <command>quilt</command>.  <command>quilt</command>.
1332  </para>  </para>
1333  </section>  </section>
1334  <section id="fixupstream"><title>Fixing upstream bug</title>  <section id="fixupstream"><title>Fixing upstream bugs</title>
1335  <para>  <para>
1336  Let's assume you find an error in the upstream <filename>Makefile</filename>  Let's assume you find an error in the upstream <filename>Makefile</filename>
1337  file as follows where <literal>install: gentoo</literal> should have been  as follows where <literal>install: gentoo</literal> should have been
1338  <literal>install: gentoo-target</literal>.  <literal>install: gentoo-target</literal>.
1339  </para>  </para>
1340  <screen>  <screen>
# Line 1162  install: gentoo Line 1344  install: gentoo
1344          install gentoorc-example $(HOME)/.gentoorc          install gentoorc-example $(HOME)/.gentoorc
1345  </screen>  </screen>
1346  <para>  <para>
1347  Let's fix this and record this with the <command>quilt</command> command as  Let's fix this and record it with the <command>dquilt</command> command as
1348  <filename>fix-gentoo-target.patch</filename>.  <footnote><para> The  <filename>fix-gentoo-target.patch</filename>.  <footnote><para> The
1349  <filename>debian/patches</filename> directory should exist now if you run  <filename>debian/patches</filename> directory should exist now if you ran
1350  <command>dh_make</command> as described before.  This example operation creates  <command>dh_make</command> as described before.  This example operation creates
1351  it just in case you are updating the existing package.  </para> </footnote>  it just in case you are updating an existing package.  </para> </footnote>
1352  </para>  </para>
1353  <screen>  <screen>
1354  $ mkdir debian/patches  $ mkdir debian/patches
1355  $ quilt new fix-gentoo-target.patch  $ dquilt new fix-gentoo-target.patch
1356  $ quilt add Makefile  $ dquilt add Makefile
1357  </screen>  </screen>
1358  <para>  <para>
1359  You change the <filename>Makefile</filename> file as follows.  You change the <filename>Makefile</filename> file as follows.
# Line 1183  install: gentoo-target Line 1365  install: gentoo-target
1365          install gentoorc-example $(HOME)/.gentoorc          install gentoorc-example $(HOME)/.gentoorc
1366  </screen>  </screen>
1367  <para>  <para>
1368  Ask <command>quilt</command> to refresh the patch to create  Ask <command>dquilt</command> to generate the patch to create
1369  <filename>debian/patches/fix-gentoo-target.patch</filename> and add its  <filename>debian/patches/fix-gentoo-target.patch</filename> and add its
1370  description following <ulink url="&dep3;">DEP-3: Patch Tagging Guidelines</ulink>.  description following <ulink url="&dep3;">DEP-3: Patch Tagging Guidelines</ulink>.
1371  </para>  </para>
1372  <screen>  <screen>
1373  $ quilt refresh  $ dquilt refresh
1374  $ quilt header -e  $ dquilt header -e
1375  ... describe patch  ... describe patch
1376  </screen>  </screen>
1377  </section>  </section>
1378    <section id="destdir"><title>Installation of files to their destination</title>
 <section id="destdir"><title>Installation of files to the destination</title>  
1379  <para>  <para>
1380  Normally, programs install themselves in the <filename>/usr/local</filename>  Most third-party software installs itself in the <filename>/usr/local</filename>
1381  subdirectory.  Since it is reserved for system administrator's (or user's)  directory hierarchy.  On Debian this is reserved for private use
1382  private use, Debian packages must not use that directory but should use system  by the system administrator, so packages must not use directories such
1383  directories such as the <filename>/usr/bin</filename> subdirectory following  as <filename>/usr/local/bin</filename> but should instead use system
1384  the Filesystem Hierarchy Standard (<ulink url="&fhs;">FHS</ulink>,  directories such as <filename>/usr/bin</filename>, obeying the
1385  <ulink url="&fhs-pdf;">fhs-2.3.pdf</ulink>).  <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink> (FHS).
1386  </para>  </para>
1387  <para>  <para>
1388  Normally, <citerefentry> <refentrytitle>make</refentrytitle>  Normally, <citerefentry> <refentrytitle>make</refentrytitle>
1389  <manvolnum>1</manvolnum> </citerefentry> is used to automate building the  <manvolnum>1</manvolnum> </citerefentry> is used to automate building the
1390  program and the execution of <literal>make install</literal> installs programs  program, and executing <literal>make install</literal> installs programs
1391  directly to the desired destination by the <literal>install</literal> target of  directly to the desired destination (following the
1392  the <filename>Makefile</filename> file.  In order for Debian to provide binary  <literal>install</literal> target in the
1393  packages, the build system installs programs to the file tree image created  <filename>Makefile</filename>).  In order for Debian to provide
1394  under a temporary directory instead to the actual destination.  pre-built installable packages, it modifies the build system to install
1395    programs into a file tree image created under a temporary directory
1396    instead of the actual destination.
1397  </para>  </para>
1398  <para>  <para>
1399  These 2 differences between (1) the normal program installation and (2) the  These two differences between normal program installation on one hand and the
1400  Debian packaging can be transparently addressed by the <systemitem role="package">debhelper</systemitem> package through the  Debian packaging system on the other can be transparently addressed by the
1401    <systemitem role="package">debhelper</systemitem> package through the
1402  <command>dh_auto_configure</command> and <command>dh_auto_install</command>  <command>dh_auto_configure</command> and <command>dh_auto_install</command>
1403  commands if the following conditions are met.  commands if the following conditions are met.
1404  </para>  </para>
1405  <itemizedlist>  <itemizedlist>
1406  <listitem>  <listitem>
1407  <para>  <para>
1408  The <filename>Makefile</filename> file follows the GNU conventions to support  The <filename>Makefile</filename> must follow GNU conventions and
1409  <literal>$(DESTDIR)</literal> variable.  support the <literal>$(DESTDIR)</literal> variable.
1410  <footnote><para> See <ulink url="&gnu-destdir;">GNU Coding Standards: 7.2.4 DESTDIR: Support for Staged Installs</ulink>.</para></footnote>  <footnote><para> See <ulink url="&gnu-destdir;">GNU Coding Standards: 7.2.4 DESTDIR: Support for Staged Installs</ulink>.</para></footnote>
1411  </para>  </para>
1412  </listitem>  </listitem>
1413  <listitem>  <listitem>
1414  <para>  <para>
1415  The source follows the Filesystem Hierarchy Standard (FHS).  The source must follow the Filesystem Hierarchy Standard (FHS).
1416  </para>  </para>
1417  </listitem>  </listitem>
1418  </itemizedlist>  </itemizedlist>
1419  <para>  <para>
1420  Programs that use GNU <command>autoconf</command>  Programs that use GNU <command>autoconf</command> follow the GNU conventions
1421  <emphasis>automatically</emphasis> follow the GNU conventions and their  automatically, so they can be trivial to package.  On the basis of
1422  packaging is almost <emphasis>automatic</emphasis>.  With this and other  this and other heuristics, it is estimated that the
1423  heuristics, the <systemitem role="package">debhelper</systemitem> package  <systemitem role="package">debhelper</systemitem> package will work for
1424  estimates that it works for about 90% of packages without making any intrusive  about 90% of packages without making any intrusive changes to their
1425  changes to their build system.  So the packaging is not as complicated as it  build system.  So packaging is not as complicated as it may seem.
 may seem.  
1426  </para>  </para>
1427  <para>  <para>
1428  If you need to make changes in the <filename>Makefile</filename> file, you  If you need to make changes in the <filename>Makefile</filename>, you
1429  should make sure to support these <literal>$(DESTDIR)</literal> variable.  The  should be careful to support the <literal>$(DESTDIR)</literal>
1430  <literal>$(DESTDIR)</literal> variable is unset in it and is prepended to each  variable.  Although it is unset by default, the <literal>$(DESTDIR)</literal>
1431  file path used for the program installation.  The packaging script will set  variable is prepended to each file path used for the program
1432  <literal>$(DESTDIR)</literal> to the temporary directory.  installation.  The packaging script will set
1433    <literal>$(DESTDIR)</literal> to the temporary directory.
1434  </para>  </para>
1435  <para>  <para>
1436  The temporary directory used by the <command>dh_auto_install</command> command  For packages of the single-binary type, the temporary directory used
1437  is chosen as <filename>debian/<replaceable>package</replaceable></filename> for  by the <command>dh_auto_install</command> command will be set to
1438  single binary packages.  <footnote><para> For multiple binary packages, the  <filename>debian/<replaceable>package</replaceable></filename>.
1439    <footnote><para> For packages of the multiple-binary type, the
1440  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>  <command>dh_auto_install</command> command uses <filename>debian/tmp</filename>
1441  as the temporary directory while the <command>dh_install</command> command with  as the temporary directory while the <command>dh_install</command> command with
1442  the help of  the help of
1443  <filename>debian/<replaceable>package-1</replaceable>.install</filename> and  <filename>debian/<replaceable>package-1</replaceable>.install</filename> and
1444  <filename>debian/<replaceable>package-2</replaceable>.install</filename> files  <filename>debian/<replaceable>package-2</replaceable>.install</filename> files
1445  will split contents of <filename>debian/tmp</filename> into  will split the contents of <filename>debian/tmp</filename> into
1446  <filename>debian/<replaceable>package-1</replaceable></filename> and  <filename>debian/<replaceable>package-1</replaceable></filename> and
1447  <filename>debian/<replaceable>package-2</replaceable></filename> temporary  <filename>debian/<replaceable>package-2</replaceable></filename> temporary
1448  directories to create multiple binary <filename>*.deb</filename> packages.  directories, to create
1449    <filename><replaceable>package-1</replaceable>_*.deb</filename> and
1450    <filename><replaceable>package-2</replaceable>_*.deb</filename> binary
1451    packages.
1452  </para> </footnote> Everything that is contained in the temporary directory  </para> </footnote> Everything that is contained in the temporary directory
1453  will be installed on a user's system when they install your package, the only  will be installed on users' systems when they install your package; the only
1454  difference is that <command>dpkg</command> will be installing the files in the  difference is that <command>dpkg</command> will be installing the
1455  root directory.  files to paths relative to the root directory rather than your working
1456    directory.
1457  </para>  </para>
1458  <para>  <para>
1459  Bear in mind that even though your program installs in  Bear in mind that even though your program installs in
1460  <filename>debian/<replaceable>package</replaceable></filename>, it still needs  <filename>debian/<replaceable>package</replaceable></filename>, it still needs
1461  to behave correctly when placed in the root directory, i.e.  when installed  to behave correctly when installed from the <filename>.deb</filename>
1462  from the <filename>.deb</filename> package.  So you must not allow the build  package under the root directory.  So you must not allow the build
1463  system to hardcode strings like  system to hardcode strings like
1464  <literal>/home/me/deb/<replaceable>package</replaceable>-<replaceable>version</replaceable>/usr/share/<replaceable>package</replaceable></literal>  <literal>/home/me/deb/<replaceable>package</replaceable>-<replaceable>version</replaceable>/usr/share/<replaceable>package</replaceable></literal>
1465  into the package file.  into files in the package.
1466  </para>  </para>
1467  <para>  <para>
1468  Here's the relevant part of <systemitem role="package">gentoo</systemitem>'s  Here's the relevant part of <systemitem role="package">gentoo</systemitem>'s
1469  <filename>Makefile</filename> file <footnote><para> This is just an example to  <filename>Makefile</filename><footnote><para> This is just an example to
1470  show how the <filename>Makefile</filename> file should look like.  If the  show what a <filename>Makefile</filename> should look like.  If the
1471  <filename>Makefile</filename> file is created by the  <filename>Makefile</filename> is created by the
1472  <command>./configure</command> command, the correct way to fix this kind of  <command>./configure</command> command, the correct way to fix this kind of
1473  <filename>Makefile</filename> is to executed the <command>./configure</command>  <filename>Makefile</filename> is to execute <command>./configure</command>
1474  command from the <command>dh_auto_configure</command> command with default  from the <command>dh_auto_configure</command> command with default
1475  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:  options including <literal>--prefix=/usr</literal>.  </para> </footnote>:
1476  </para>  </para>
1477  <screen>  <screen>
# Line 1293  ICONS   = /usr/local/share/gentoo Line 1482  ICONS   = /usr/local/share/gentoo
1482  </screen>  </screen>
1483  <para>  <para>
1484  We see that the files are set to install under <filename>/usr/local</filename>.  We see that the files are set to install under <filename>/usr/local</filename>.
1485  Change those paths to:  As explained above, that directory hierarchy is reserved for local use on
1486    Debian, so change those paths to:
1487  </para>  </para>
1488  <screen>  <screen>
1489  # Where to put binary on 'make install'?  # Where to put binary on 'make install'?
# Line 1302  BIN     = $(DESTDIR)/usr/bin Line 1492  BIN     = $(DESTDIR)/usr/bin
1492  ICONS   = $(DESTDIR)/usr/share/gentoo  ICONS   = $(DESTDIR)/usr/share/gentoo
1493  </screen>  </screen>
1494  <para>  <para>
1495  But why in that directory, and not some other?  Because Debian packages never  The exact locations that should be used for binaries, icons,
1496  install files beneath <filename>/usr/local</filename> -- that tree is reserved  documentation, etc. are specified in the Filesystem Hierarchy Standard
1497  for the system administrator's use.  Such files on Debian systems go under  (FHS).  You should browse through it and read the sections relevant to
1498  <filename>/usr</filename> instead.  your package.
 </para>  
 <para>  
 The more exact locations for binaries, icons, documentation etc.  are specified  
 in the Filesystem Hierarchy Standard (see  
 <ulink url="&fhs;">FHS</ulink>).  I recommend you  
 browse it and read the sections that might concern your package.  
1499  </para>  </para>
1500  <para>  <para>
1501  So, we should install the binary in <filename>/usr/bin</filename> instead of  So, we should install the binary in <filename>/usr/bin</filename> instead of
1502  <filename>/usr/local/bin</filename>, the manual page in  <filename>/usr/local/bin</filename>, the manual page in
1503  <filename>/usr/share/man/man1</filename> instead of  <filename>/usr/share/man/man1</filename> instead of
1504  <filename>/usr/local/man/man1</filename> etc.  Notice how there's no manual  <filename>/usr/local/man/man1</filename>, and so on.  Notice how there's no manual
1505  page mentioned in <systemitem role="package">gentoo</systemitem>'s  page mentioned in <systemitem role="package">gentoo</systemitem>'s
1506  <filename>Makefile</filename>, but since the Debian Policy requires that every  <filename>Makefile</filename>, but since Debian Policy requires that every
1507  program has one, we'll make one later and install it in  program has one, we'll make one later and install it in
1508  <filename>/usr/share/man/man1</filename>.  <filename>/usr/share/man/man1</filename>.
1509  </para>  </para>
# Line 1330  to fix them to use the right locations. Line 1514  to fix them to use the right locations.
1514  for?  You can find this out by issuing:  for?  You can find this out by issuing:
1515  </para>  </para>
1516  <screen>  <screen>
1517  $ grep -nr -e 'usr/local/lib' --include='*.[c|h]' .  $ grep -nr --include='*.[c|h]' -e 'usr/local/lib' .
1518  </screen>  </screen>
1519  <para>  <para>
1520  <command>grep</command> will run recursively through the source tree and tell  <command>grep</command> will run recursively through the source tree and tell
# Line 1341  Edit those files and in those lines repl Line 1525  Edit those files and in those lines repl
1525  with <literal>usr/lib</literal>.  This can be done automatically as follows:  with <literal>usr/lib</literal>.  This can be done automatically as follows:
1526  </para>  </para>
1527  <screen>  <screen>
1528  $ vim '+argdo %s/usr\/local\/lib/usr\/lib/gce|update' +q \  $ sed -i -e 's#usr/local/lib#usr/lib#g' \
1529        $(find . -type f -name '*.[c|h]')        $(find . -type f -name '*.[c|h]')
1530  </screen>  </screen>
1531  <para>  <para>
1532  Be careful that you don't mess up the rest of the code!  :-)  If you want to confirm each substitution instead, this can be done interactively as follows:
1533  </para>  </para>
1534    <screen>
1535    $ vim '+argdo %s#usr/local/lib#usr/lib#gce|update' +q \
1536          $(find . -type f -name '*.[c|h]')
1537    </screen>
1538    
1539  <para>  <para>
1540  After that you should find the install target (search for line that starts with  Next you should find the <literal>install</literal> target (searching
1541  <literal>install:</literal>, that will usually work) and rename all references  for the line that starts with <literal>install:</literal> will usually
1542  to directories other than ones defined at the top of the  work) and rename all references to directories other than ones defined
1543  <filename>Makefile</filename>.  at the top of the <filename>Makefile</filename>.
1544  </para>  </para>
1545  <para>  <para>
1546  Before your upstream bug fix, <systemitem role="package">gentoo</systemitem>'s  Originally, <systemitem role="package">gentoo</systemitem>'s
1547  install target said:  install target said:
1548  </para>  </para>
1549  <screen>  <screen>
# Line 1364  install: gentoo-target Line 1553  install: gentoo-target
1553          install gentoorc-example $(HOME)/.gentoorc          install gentoorc-example $(HOME)/.gentoorc
1554  </screen>  </screen>
1555  <para>  <para>
1556  Let's fix this and record this with the <command>quilt</command> command as  Let's fix this upstream bug and record it with the <command>dquilt</command> command as
1557  <filename>debian/patches/install.patch</filename>.  <filename>debian/patches/install.patch</filename>.
1558  </para>  </para>
1559  <screen>  <screen>
1560  $ quilt new install.patch  $ dquilt new install.patch
1561  $ quilt add Makefile  $ dquilt add Makefile
1562  </screen>  </screen>
1563  <para>  <para>
1564  Let's change this for Debian package as following using the editor:  In your editor, change this for the Debian package as follows:
1565  </para>  </para>
1566  <screen>  <screen>
1567  install: gentoo-target  install: gentoo-target
# Line 1382  install: gentoo-target Line 1571  install: gentoo-target
1571          install -m644 gentoorc-example $(DESTDIR)/etc/gentoorc          install -m644 gentoorc-example $(DESTDIR)/etc/gentoorc
1572  </screen>  </screen>
1573  <para>  <para>
1574  You've surely noticed that there's now a <literal>install -d</literal> command  You'll have noticed that there's now an <literal>install -d</literal> command
1575  before the other commands in the rule.  The original  before the other commands in the rule.  The original
1576  <filename>Makefile</filename> didn't have it because usually the  <filename>Makefile</filename> didn't have it because usually
1577  <literal>/usr/local/bin</literal> and other directories already exist on the  <literal>/usr/local/bin</literal> and other directories already exist on the
1578  system where one runs <literal>make install</literal>.  However, since we will  system where you are running <literal>make install</literal>.  However, since we will
1579  install into our own empty (or even nonexistent) directory, we will have to  be installing into a newly created private directory tree, we will have to
1580  create each and every one of those directories.  create each and every one of those directories.
1581  </para>  </para>
1582  <para>  <para>
# Line 1399  of additional documentation that the ups Line 1588  of additional documentation that the ups
1588          cp -a docs/* $(DESTDIR)/usr/share/doc/gentoo/html          cp -a docs/* $(DESTDIR)/usr/share/doc/gentoo/html
1589  </screen>  </screen>
1590  <para>  <para>
1591  After careful check, if everything is fine, ask <command>quilt</command> to  Check carefully, and if everything is okay, ask <command>dquilt</command> to
1592  refresh the patch to create <filename>debian/patches/install.patch</filename>  generate the patch to create <filename>debian/patches/install.patch</filename>
1593  and add its description.  and add its description.
1594  </para>  </para>
1595  <screen>  <screen>
1596  $ quilt refresh  $ dquilt refresh
1597  $ quilt header -e  $ dquilt header -e
1598  ... describe patch  ... describe patch
1599  </screen>  </screen>
1600  <para>  <para>
# Line 1428  Debian specific packaging modification: Line 1617  Debian specific packaging modification:
1617  Whenever you make changes that are not specifically related to Debian package  Whenever you make changes that are not specifically related to Debian package
1618  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
1619  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
1620  program revision and be useful to everyone else.  Also remember to make your  revision of the program and be useful to everyone else.  Also remember
1621  fixes not specific to Debian or Linux (or even Unix!) prior to sending them --  to avoid making your fixes specific to Debian or Linux - or even Unix!
1622  make them portable.  This will make your fixes much easier to apply.  Make them portable.  This will make your fixes much easier to apply.
1623  </para>  </para>
1624  <para>  <para>
1625  Note that you don't have to send the <filename>debian/*</filename> files  Note that you don't have to send the <filename>debian/*</filename> files
# Line 1441  upstream. Line 1630  upstream.
1630  <para>  <para>
1631  There is one other common problem: libraries are often different from platform  There is one other common problem: libraries are often different from platform
1632  to platform.  For example, a <filename>Makefile</filename> can contain a  to platform.  For example, a <filename>Makefile</filename> can contain a
1633  reference to a library which doesn't exist on Debian systems.  In that case, we  reference to a library which doesn't exist on the Debian system.  In that case, we
1634  need to change it to a library which does exist in Debian, and serves the same  need to change it to a library which does exist in Debian, and serves the same
1635  purpose.  purpose.
1636  </para>  </para>
1637  <para>  <para>
1638  So, if there is a line in your program's <filename>Makefile</filename> (or  Let's assume a line in your program's <filename>Makefile</filename> (or
1639  <filename>Makefile.in</filename>) that says something like this (and your  <filename>Makefile.in</filename>) as the following.
 program doesn't compile) <footnote><para> The author realizes that this is not  
 the best example considering our <systemitem role="package">libncurses</systemitem> package now ships with a  
 <filename>libcurses.so</filename> symlink, but he couldn't think of a better  
 one.  Suggestions very welcome :-) </para> </footnote>:  
1640  </para>  </para>
1641  <screen>  <screen>
1642  LIBS = -lcurses -lsomething -lsomethingelse  LIBS = -lfoo -lbar
1643  </screen>  </screen>
1644  <para>  <para>
1645  Let's fix this as <filename>debian/patches/ncurse.patch</filename> by changing  If your program doesn't compile since the <literal>foo</literal> library
1646  <literal>curses</literal> into <literal>ncurses</literal>.  doesn't exist and its equivalent is provided by the <literal>foo2</literal>
1647    library on the Debian system, you can fix this build problem as
1648    <filename>debian/patches/foo2.patch</filename> by changing
1649    <literal>foo</literal> into <literal>foo2</literal>.<footnote><para>If there
1650    are API changes from the <literal>foo</literal> library to the
1651    <literal>foo2</literal> library, required changes to the source code need to be
1652    made to match the new API.</para> </footnote>
1653  </para>  </para>
1654  <screen>  <screen>
1655  $ quilt new ncurse.patch  $ dquilt new foo2.patch
1656  $ quilt add Makefile  $ dquilt add Makefile
1657  $ sed -i -e s/-lcurses/-lncurses/g Makefile  $ sed -i -e 's/-lfoo/-lfoo2/g' Makefile
1658  $ quilt refresh  $ dquilt refresh
1659  $ quilt header -e  $ dquilt header -e
1660  ... describe patch  ... describe patch
1661  </screen>  </screen>
1662  </section>  </section>
# Line 1478  that we should edit in order to customiz Line 1669  that we should edit in order to customiz
1669  most important of them are <filename>control</filename>,  most important of them are <filename>control</filename>,
1670  <filename>changelog</filename>, <filename>copyright</filename> and  <filename>changelog</filename>, <filename>copyright</filename> and
1671  <filename>rules</filename>, which are required for all packages.  <filename>rules</filename>, which are required for all packages.
1672    <footnote><para>
1673    In this chapter, files in the <filename>debian</filename> directory are
1674    referred without preceding <filename>debian/</filename> for simplicity whenever
1675    they are obvious.
1676    </para></footnote>
1677  </para>  </para>
1678  <section id="control"><title><filename>control</filename> file</title>  <section id="control"><title><filename>control</filename> file</title>
1679  <para>  <para>
# Line 1530  for administrator-only programs, <litera Line 1726  for administrator-only programs, <litera
1726  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>  documentation, <literal>libs</literal> for libraries, <literal>mail</literal>
1727  for e-mail readers and daemons, <literal>net</literal> for network apps and  for e-mail readers and daemons, <literal>net</literal> for network apps and
1728  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,
1729  and many more.  See the <ulink url="&policy-subsections;">Debian  and many more.
1730  Policy Manual, 2.4 'Sections'</ulink> and <ulink url="&sections-unstable;">List of sections in 'sid'</ulink>  <footnote> <para>See
1731  for the guidance.  <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 'Sections'</ulink> and
1732    <ulink url="&sections-unstable;">List of sections in <literal>sid</literal></ulink>.</para>
1733    </footnote>
1734  </para>  </para>
1735  <para>  <para>
1736  Let's change it then to x11.  (A <literal>main/</literal> prefix is implied so  Let's change it then to x11.  (A <literal>main/</literal> prefix is implied so
1737  we can omit it.)  we can omit it.)
1738  </para>  </para>
1739  <para>  <para>
1740  Line 3 describes how important it is that the user installs this package.  See  Line 3 describes how important it is that the user installs this package.
1741  the <ulink url="&policy-priorities;">Debian  <footnote> <para>See
1742  Policy Manual, 2.5 'Priorities'</ulink> for the guidance.  <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 'Priorities'</ulink>.
1743    </para>
1744    </footnote>
1745  </para>  </para>
1746  <itemizedlist>  <itemizedlist>
1747  <listitem>  <listitem>
# Line 1577  you.  Avoid using commas, ampersands and Line 1777  you.  Avoid using commas, ampersands and
1777  <para>  <para>
1778  The 5th line includes the list of packages required to build your package as  The 5th line includes the list of packages required to build your package as
1779  the <literal>Build-Depends</literal> field.  You can also have the  the <literal>Build-Depends</literal> field.  You can also have the
1780  <literal>Build-Depends-Indep</literal> field as an additional line, here (see  <literal>Build-Depends-Indep</literal> field as an additional line, here.
1781  the <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian  <footnote><para>See <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian
1782  Policy Manual, 7.7 'Relationships between source and binary packages -  Policy Manual, 7.7 'Relationships between source and binary packages -
1783  Build-Depends, Build-Depends-Indep, Build-Conflicts,  Build-Depends, Build-Depends-Indep, Build-Conflicts,
1784  Build-Conflicts-Indep'</ulink>).  Some packages like <systemitem role="package">gcc</systemitem> and <systemitem role="package">make</systemitem> which are required by the <systemitem role="package">build-essential</systemitem> package are implied.  If you need  Build-Conflicts-Indep'</ulink>.</para></footnote>  Some packages like
1785    <systemitem role="package">gcc</systemitem> and
1786    <systemitem role="package">make</systemitem> which are required by the
1787    <systemitem role="package">build-essential</systemitem> package are implied.  If you need
1788  to have other tools to build your package, you should add them to these fields.  to have other tools to build your package, you should add them to these fields.
1789  Multiple entries are separated with commas; read on for the explanation of  Multiple entries are separated with commas; read on for the explanation of
1790  binary dependencies to find out more about the syntax of these lines.  binary dependencies to find out more about the syntax of these lines.
# Line 1600  satisfy the Debian Policy requirement fo Line 1803  satisfy the Debian Policy requirement fo
1803  For source packages which have some binary packages with <literal>Architecture:  For source packages which have some binary packages with <literal>Architecture:
1804  any</literal>, they are rebuild by the autobuilder.  Since this autobuilder  any</literal>, they are rebuild by the autobuilder.  Since this autobuilder
1805  procedure runs <literal>debian/rules build</literal> in it while installing  procedure runs <literal>debian/rules build</literal> in it while installing
1806  only packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="autobuilder"/> ), the <literal>Build-Depends</literal> field needs to  only packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="autobuilder"/>), the <literal>Build-Depends</literal> field needs to
1807  list practically all the required packages and the  list practically all the required packages and the
1808  <literal>Build-Depends-indep</literal> is rarely used.  <literal>Build-Depends-indep</literal> is rarely used.
1809  </para>  </para>
# Line 1701  these relations; if not, it will be expl Line 1904  these relations; if not, it will be expl
1904  </citerefentry> etc.)  </citerefentry> etc.)
1905  </para>  </para>
1906  <para>  <para>
1907  Here is a simplified description of package relationships.  Here is a simplified description of package relationships.
1908  <footnote><para>See  <footnote><para>See
1909  <ulink url="&policy-relationships;">Debian Policy Manual, 7 'Declaring relationships between packages'</ulink>  <ulink url="&policy-relationships;">Debian Policy Manual, 7 'Declaring relationships between packages'</ulink>.
1910  </para></footnote>:  </para></footnote>
1911  </para>  </para>
1912  <itemizedlist>  <itemizedlist>
1913  <listitem>  <listitem>
# Line 1825  Replaces: quux (&lt;&lt; 5), quux-foo (& Line 2028  Replaces: quux (&lt;&lt; 5), quux-foo (&
2028  <para>  <para>
2029  The last feature you need to know about is  The last feature you need to know about is
2030  <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>,  <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>,
2031  <literal>${misc:Depends}</literal>, etc.  These entries are substituted by the  <literal>${misc:Depends}</literal>, etc.
 list generated by other <systemitem role="package">debhelper</systemitem>  
 components when the <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>  
 <manvolnum>1</manvolnum> </citerefentry> command is executed.  
2032  </para>  </para>
2033  <para>  <para>
2034  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>  <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle>
2035  <manvolnum>1</manvolnum> </citerefentry> will scan it for binaries and  <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies
2036  libraries determine their shared library dependencies and detect which packages  for binary packages.  It generates a list of ELF executables and shared
2037  they are in, such as <systemitem role="package">libc6</systemitem> or  libraries it has found for each binary package.  Such list is used for
2038  <systemitem role="package">xlib6g</systemitem>, after your package has been  substituting <literal>${shlibs:Depends}</literal>.
 built and installed into the temporary directory.  This package list is used  
 for substituting <literal>${shlibs:Depends}</literal>.  
2039  </para>  </para>
2040  <para>  <para>
2041  The package list generated by <citerefentry>  <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum>
2042  <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>  </citerefentry> calculates Perl dependencies.  It generates a list of a
2043  is used for substituting <literal>${perl:Depends}</literal>.  dependency on <literal>perl</literal> or <literal>perlapi</literal> for each binary package.  Such list is used for
2044    substituting <literal>${perl:Depends}</literal>.
2045  </para>  </para>
2046  <para>  <para>
2047  Some <systemitem role="package">debhelper</systemitem> commands may make the  Some <systemitem role="package">debhelper</systemitem> commands may make the
2048  generated package need to depend on some other packages.  This list of required  generated package need to depend on some other packages.  All such commands
2049  packages is used for substituting <literal>${misc:Depends}</literal>.  generate a list of required packages for each binary package.
2050    Such list is used for substituting <literal>${misc:Depends}</literal>.
2051    </para>
2052    <para>
2053    <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle>
2054    <manvolnum>1</manvolnum> </citerefentry> generates
2055    <filename>DEBIAN/control</filename> for each binary package while
2056    substituting <literal>${shlibs:Depends}</literal>,
2057    <literal>${perl:Depends}</literal>, <literal>${misc:Depends}</literal>, etc.
2058  </para>  </para>
2059  <para>  <para>
2060  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
# Line 1874  English.  Translations of these descript Line 2081  English.  Translations of these descript
2081  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>  <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote>
2082  </para>  </para>
2083  <para>  <para>
2084  Let's insert <literal>Vcs-*</literal> fields documented in <ulink url="&devref-bpp-vcs;">Developer's  Let's insert <literal>Vcs-*</literal> fields to document the Version Control
2085  Reference, 6.2.5.  'Version Control System location'</ulink> between line 6 and  System (VCS) location between line 6 and 7.
2086  7.  Let's assume that the <systemitem role="package">gentoo</systemitem>  <footnote><para>See
2087  package is located in Debian Alioth Git Service at  <ulink url="&devref-bpp-vcs;">Developer's Reference, 6.2.5. 'Version Control System location'</ulink>.
2088    </para></footnote>
2089    Let's assume that the <systemitem role="package">gentoo</systemitem>
2090    package has its VCS located in Debian Alioth Git Service at
2091  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.  <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.
2092  </para>  </para>
2093  <para>  <para>
# Line 1920  Finally, here is the updated <filename>c Line 2130  Finally, here is the updated <filename>c
2130  <section id="copyright"><title><filename>copyright</filename> file</title>  <section id="copyright"><title><filename>copyright</filename> file</title>
2131  <para>  <para>
2132  This file contains the information about package upstream resources, copyright  This file contains the information about package upstream resources, copyright
2133  and license information.  Its format is not dictated by the Debian Policy  and license information.
2134  Manual, but the content is (<ulink url="&policy-copyright;">Debian  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 'Copyright information'</ulink>
2135  Policy Manual, 12.5 'Copyright information'</ulink>).  You may also consult  dictates its content and
2136  <ulink url="&dep5;">DEP-5: Machine-parseable  <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink>
2137  debian/copyright</ulink>.  provides guidelines for its format.
2138  </para>  </para>
2139  <para>  <para>
2140  <command>dh_make</command> can give you a template  <command>dh_make</command> can give you a template
# Line 1990  debian-devel-announce: <ulink url="&howt Line 2200  debian-devel-announce: <ulink url="&howt
2200  </section>  </section>
2201  <section id="changelog"><title><filename>changelog</filename> file</title>  <section id="changelog"><title><filename>changelog</filename> file</title>
2202  <para>  <para>
2203  This is a required file, which has a special format described in the <ulink url="&policy-dpkgchangelog;">Debian  This is a required file, which has a special format described in the
2204  Policy Manual, 4.4 'debian/changelog'</ulink>.  This format is used by  <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 'debian/changelog'</ulink>.
2205  <command>dpkg</command> and other programs to obtain the version number,  This format is used by <command>dpkg</command> and other programs to obtain the
2206  revision, distribution and urgency of your package.  version number, revision, distribution and urgency of your package.
2207  </para>  </para>
2208  <para>  <para>
2209  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 2055  You will end up with something like this Line 2265  You will end up with something like this
2265  </para>  </para>
2266  <para>  <para>
2267  You can read more about updating the <filename>changelog</filename> file later  You can read more about updating the <filename>changelog</filename> file later
2268  in <xref linkend="update"/> .  in <xref linkend="update"/>.
2269  </para>  </para>
2270  </section>  </section>
2271  <section id="rules"><title><filename>rules</filename> file</title>  <section id="rules"><title><filename>rules</filename> file</title>
# Line 2104  binary package under the <filename>debia Line 2314  binary package under the <filename>debia
2314  <literal>binary</literal> target: to create all binary packages (effectively  <literal>binary</literal> target: to create all binary packages (effectively
2315  combination of <literal>binary-arch</literal> and  combination of <literal>binary-arch</literal> and
2316  <literal>binary-indep</literal> targets).  (required)<footnote><para> This  <literal>binary-indep</literal> targets).  (required)<footnote><para> This
2317  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>
2318  </para>  </para>
2319  </listitem>  </listitem>
2320  <listitem>  <listitem>
# Line 2112  target is used by <literal>dpkg-buildpac Line 2322  target is used by <literal>dpkg-buildpac
2322  <literal>binary-arch</literal> target: to create arch-dependent  <literal>binary-arch</literal> target: to create arch-dependent
2323  (<literal>Architecture: any</literal>) binary packages in the parent directory.  (<literal>Architecture: any</literal>) binary packages in the parent directory.
2324  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage  (required)<footnote><para> This target is used by <literal>dpkg-buildpackage
2325  -B</literal> as in <xref linkend="autobuilder"/> .  </para> </footnote>  -B</literal> as in <xref linkend="autobuilder"/>.  </para> </footnote>
2326  </para>  </para>
2327  </listitem>  </listitem>
2328  <listitem>  <listitem>
# Line 2177  It tells the operating system that this Line 2387  It tells the operating system that this
2387  <filename>/usr/bin/make</filename>.  <filename>/usr/bin/make</filename>.
2388  </para>  </para>
2389  <para>  <para>
2390  Line 10 can be uncommented to set <literal>DH_VERBOSE</literal> variable to 1.  Line 11 can be uncommented to set <literal>DH_VERBOSE</literal> variable to 1.
2391  Then, the <command>dh</command> command will output which  Then, the <command>dh</command> command will output which
2392  <command>dh_*</command> commands are executed by the <command>dh</command>  <command>dh_*</command> commands are executed by the <command>dh</command>
2393  command.  You can also add <literal>export DH_OPTIONS=-v</literal> line here.  command.  You can also add <literal>export DH_OPTIONS=-v</literal> line here.
# Line 2199  complicated <filename>rules</filename> f Line 2409  complicated <filename>rules</filename> f
2409  scripts listed for each required explicit targets and frozen them to the state  scripts listed for each required explicit targets and frozen them to the state
2410  when it was initially packaged.  This new <command>dh</command> command is  when it was initially packaged.  This new <command>dh</command> command is
2411  simpler and frees us from this constrain.  You still have full power to  simpler and frees us from this constrain.  You still have full power to
2412  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 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
2413  package building process like the <systemitem role="package">cdbs</systemitem>  package building process like the <systemitem role="package">cdbs</systemitem>
2414  package.  </para> </footnote> The <command>dh</command> command is a wrapper  package.  </para> </footnote> The <command>dh</command> command is a wrapper
2415  script which runs appropriate sequences of <command>dh_*</command> programs  script which runs appropriate sequences of <command>dh_*</command> programs
# Line 2613  This installs <command>bash</command> co Line 2823  This installs <command>bash</command> co
2823  </listitem>  </listitem>
2824  </itemizedlist>  </itemizedlist>
2825  <para>  <para>
 For sources using Autotools, use combination of above as <literal>dh --with  
 autotools-dev --with autoreconf $@</literal> to be most current with the GNU  
 Build System.  
 </para>  
 <para>  
2826  Many <command>dh_*</command> commands invoked by the new <command>dh</command>  Many <command>dh_*</command> commands invoked by the new <command>dh</command>
2827  command can be customized by the corresponding configuration files in the  command can be customized by the corresponding configuration files in the
2828  <filename>debian</filename> directory.  See <xref linkend="dother"/> and the  <filename>debian</filename> directory.  See <xref linkend="dother"/> and the
# Line 2644  corner cases.  Use of simplified equival Line 2849  corner cases.  Use of simplified equival
2849  kill such <systemitem role="package">debhelper</systemitem>'s smart features.  kill such <systemitem role="package">debhelper</systemitem>'s smart features.
2850  </para>  </para>
2851  <para>  <para>
2852  If you want to store the system configuration data for the <systemitem role="package">gentoo</systemitem> package in the  If you want to store the system configuration data in the
2853  <filename>/etc/gentoo</filename> directory instead of the usual  <filename>/etc/gentoo</filename> directory instead of the usual
2854  <filename>/etc</filename> directory, you can override the default  <filename>/etc</filename> directory for the recent
2855    <systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default
2856  <literal>--sysconfig=/etc</literal> argument given by the  <literal>--sysconfig=/etc</literal> argument given by the
2857  <command>dh_auto_configure</command> command to the  <command>dh_auto_configure</command> command to the
2858  <command>./configure</command> command by the following.  <footnote><para> The  <command>./configure</command> command by the following.
 <systemitem role="package">gentoo</systemitem> package uses the <ulink url="&gnu-build-system;">GNU build  
 system</ulink>, also known as the Autotools.  
 </para> </footnote>  
2859  </para>  </para>
2860  <screen>  <screen>
2861  override_dh_auto_configure:  override_dh_auto_configure:
# Line 2744  filenames suffixed by <literal>.ex</lite Line 2947  filenames suffixed by <literal>.ex</lite
2947  prefixed by the binary package name such as  prefixed by the binary package name such as
2948  <literal><replaceable>package</replaceable></literal>.  Take a look at all of  <literal><replaceable>package</replaceable></literal>.  Take a look at all of
2949  them.  them.
2950    <footnote><para>
2951    In this chapter, files in the <filename>debian</filename> directory are
2952    referred without preceding <filename>debian/</filename> for simplicity whenever
2953    they are obvious.
2954    </para></footnote>
2955  </para>  </para>
2956  <para>  <para>
2957  The <command>dh_make</command> command may not create some template  The <command>dh_make</command> command may not create some template
# Line 2778  remove template files which you do not n Line 2986  remove template files which you do not n
2986  </listitem>  </listitem>
2987  <listitem>  <listitem>
2988  <para>  <para>
2989  modify the <filename>control</filename> file (see <xref linkend="control"/> ),  modify the <filename>control</filename> file (see <xref linkend="control"/>),
2990  if necessary.  if necessary.
2991  </para>  </para>
2992  </listitem>  </listitem>
2993  <listitem>  <listitem>
2994  <para>  <para>
2995  modify the <filename>rules</filename> file (see <xref linkend="rules"/> ), if  modify the <filename>rules</filename> file (see <xref linkend="rules"/>), if
2996  necessary.  necessary.
2997  </para>  </para>
2998  </listitem>  </listitem>
# Line 2875  the <filename>/etc</filename> directory. Line 3083  the <filename>/etc</filename> directory.
3083  </listitem>  </listitem>
3084  </itemizedlist>  </itemizedlist>
3085  <para>  <para>
3086  For more information on the <emphasis>maintainer scripts</emphasis>, see <xref linkend="maintscripts"/> .  For more information on the <emphasis>maintainer scripts</emphasis>, see <xref linkend="maintscripts"/>.
3087  </para>  </para>
3088  </section>  </section>
3089  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename> files</title>  <section id="crond"><title><filename><replaceable>package</replaceable>.cron.*</filename> files</title>
# Line 2944  means there is a problem with the <filen Line 3152  means there is a problem with the <filen
3152  </para>  </para>
3153  <para>  <para>
3154  Files listed in the <filename>install</filename> file doesn't need the  Files listed in the <filename>install</filename> file doesn't need the
3155  directories created first.  See <xref linkend="install"/> .  directories created first.  See <xref linkend="install"/>.
3156  </para>  </para>
3157  <para>  <para>
3158  It is best to first try to run the installation first and only use this if you  It is best to try to run the installation first and only use this if you
3159  run into trouble.  There is no preceding slash on the directory names listed in  run into trouble.  There is no preceding slash on the directory names listed in
3160  the <filename>dirs</filename> file.  the <filename>dirs</filename> file.
3161  </para>  </para>
# Line 2987  For information on the file format, see Line 3195  For information on the file format, see
3195  manual, in <ulink url="&doc-base;">Debian doc-base Manual</ulink>.  manual, in <ulink url="&doc-base;">Debian doc-base Manual</ulink>.
3196  </para>  </para>
3197  <para>  <para>
3198  For more details on installing additional documentation, look in <xref linkend="destdir"/> .  For more details on installing additional documentation, look in <xref linkend="destdir"/>.
3199  </para>  </para>
3200  </section>  </section>
3201  <section id="docs"><title><filename>docs</filename> file</title>  <section id="docs"><title><filename>docs</filename> file</title>
# Line 3045  obviously disregarded my initial recomme Line 3253  obviously disregarded my initial recomme
3253  <para>  <para>
3254  The <filename><replaceable>package</replaceable>.init</filename> file is  The <filename><replaceable>package</replaceable>.init</filename> file is
3255  installed as the  installed as the
3256  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script.  <filename>/etc/init.d/<replaceable>package</replaceable></filename> script
3257    for the <emphasis>init script</emphasis> which starts and stops a daemon.
3258  Its fairly generic skeleton template is provided by the  Its fairly generic skeleton template is provided by the
3259  <command>dh_make</command> command as <filename>init.d.ex</filename>.  You'll  <command>dh_make</command> command as <filename>init.d.ex</filename>.  You'll
3260  likely have to rename and edit it, a lot, while making sure to provide  likely have to rename and edit it, a lot, while making sure to provide
3261  Filesystem Hierarchy Standard (see <ulink url="&fhs;">FHS</ulink>) compliant headers.  It  <ulink url="&lsb;">Linux Standard Base</ulink> (LSB) compliant headers.  It
3262  gets installed into the temporary directory by <citerefentry>  gets installed into the temporary directory by <citerefentry>
3263  <refentrytitle>dh_installinit</refentrytitle> <manvolnum>1</manvolnum>  <refentrytitle>dh_installinit</refentrytitle> <manvolnum>1</manvolnum>
3264  </citerefentry>.  </citerefentry>.
# Line 3058  gets installed into the temporary direct Line 3267  gets installed into the temporary direct
3267  The <filename><replaceable>package</replaceable>.default</filename> file will  The <filename><replaceable>package</replaceable>.default</filename> file will
3268  be installed into  be installed into
3269  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This  <filename>/etc/default/<replaceable>package</replaceable></filename>.  This
3270  file sets defaults that are sourced by the init script.  Most times this  file sets defaults that are sourced by the <emphasis>init script</emphasis>.  Most times this
3271  default file is used to disable running a daemon, set some default flags or  <filename><replaceable>package</replaceable>.default</filename> file is used to disable running a daemon, set some default flags or
3272  timeouts.  If your init script has certain <emphasis>settable</emphasis>  timeouts.  If your <emphasis>init script</emphasis> has certain <emphasis>settable</emphasis>
3273  features you want to install these into the default file, not the init script.  features you want to install these into the <filename><replaceable>package</replaceable>.default</filename> file, not the <emphasis>init script</emphasis>.
3274  </para>  </para>
3275  <para>  <para>
3276  If your upstream program has an init file you can either use it or not.  If you  If your upstream program provides a file for the <emphasis>init script</emphasis>, you can either use it or not.  If you
3277  don't use their init.d script then create a new one in  don't use their <emphasis>init script</emphasis> then create a new one in
3278  <filename>debian/<replaceable>package</replaceable>.init</filename>.  However  <filename><replaceable>package</replaceable>.init</filename>.  However
3279  if the upstream init script looks fine and installs in the right place you  if the upstream <emphasis>init script</emphasis> looks fine and installs in the right place you
3280  still need to setup the <filename>rc*</filename> symlinks.  To do this you will  still need to setup the <filename>rc*</filename> symlinks.  To do this you will
3281  need to override <command>dh_installinit</command> in the  need to override <command>dh_installinit</command> in the
3282  <filename>rules</filename> file with the following lines:  <filename>rules</filename> file with the following lines:
# Line 3186  list of manual page sections: Line 3395  list of manual page sections:
3395      <row> <entry>1</entry> <entry>User command</entry> <entry>Executable commands or scripts</entry> </row>      <row> <entry>1</entry> <entry>User command</entry> <entry>Executable commands or scripts</entry> </row>
3396      <row> <entry>2</entry> <entry>System calls</entry> <entry>Functions provided by the kernel</entry> </row>      <row> <entry>2</entry> <entry>System calls</entry> <entry>Functions provided by the kernel</entry> </row>
3397      <row> <entry>3</entry> <entry>Library calls</entry> <entry>Functions within system libraries</entry> </row>      <row> <entry>3</entry> <entry>Library calls</entry> <entry>Functions within system libraries</entry> </row>
3398      <row> <entry>4</entry> <entry>Special files</entry> <entry>Usually found in /dev</entry> </row>      <row> <entry>4</entry> <entry>Special files</entry> <entry>Usually found in <filename>/dev</filename></entry> </row>
3399      <row> <entry>5</entry> <entry>File formats</entry> <entry>E.g. <filename>/etc/passwd</filename>'s format</entry> </row>      <row> <entry>5</entry> <entry>File formats</entry> <entry>E.g. <filename>/etc/passwd</filename>'s format</entry> </row>
3400      <row> <entry>6</entry> <entry>Games</entry> <entry>Games or other frivolous programs</entry> </row>      <row> <entry>6</entry> <entry>Games</entry> <entry>Games or other frivolous programs</entry> </row>
3401      <row> <entry>7</entry> <entry>Macro packages</entry> <entry>Such as man macros</entry> </row>      <row> <entry>7</entry> <entry>Macro packages</entry> <entry>Such as <command>man</command> macros</entry> </row>
3402      <row> <entry>8</entry> <entry>System administration</entry> <entry>Programs typically only run by root</entry> </row>      <row> <entry>8</entry> <entry>System administration</entry> <entry>Programs typically only run by root</entry> </row>
3403      <row> <entry>9</entry> <entry>Kernel routines</entry> <entry>Non-standard calls and internals</entry> </row>      <row> <entry>9</entry> <entry>Kernel routines</entry> <entry>Non-standard calls and internals</entry> </row>
3404    </tbody>    </tbody>
# Line 3302  If your package has manual pages, you sh Line 3511  If your package has manual pages, you sh
3511  </para>  </para>
3512  <para>  <para>
3513  To install <filename>docs/gentoo.1</filename> for the <systemitem role="package">gentoo</systemitem> package as its manpage, you create a  To install <filename>docs/gentoo.1</filename> for the <systemitem role="package">gentoo</systemitem> package as its manpage, you create a
3514  <filename>gentoo.manpages</filename> file as:  <filename>gentoo.manpages</filename> file as the following.
3515  </para>  </para>
3516  <screen>  <screen>
3517  docs/gentoo.1  docs/gentoo.1
# Line 3316  the system will be created for them. Line 3525  the system will be created for them.
3525  </para>  </para>
3526  <para>  <para>
3527  Here's the default <filename>menu.ex</filename> file that  Here's the default <filename>menu.ex</filename> file that
3528  <command>dh_make</command> created:  <command>dh_make</command> created.
3529  </para>  </para>
3530  <screen>  <screen>
3531  ?package(gentoo):needs=X11|text|vc|wm \  ?package(gentoo):needs=X11|text|vc|wm \
# Line 3329  specifies what kind of interface the pro Line 3538  specifies what kind of interface the pro
3538  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.  listed alternatives, e.g.  <literal>text</literal> or <literal>X11</literal>.
3539  </para>  </para>
3540  <para>  <para>
3541  The next is <literal>section</literal>, where the menu and submenu the entry  The next is <literal>section</literal>, where the menu and submenu entry
3542  should appear in.  The current list of sections <footnote><para> There were a  should appear in.
3543  major reorganization of menu structure for <literal>squeeze</literal>.  </para>  <footnote><para> The current list of sections is at
3544  </footnote> is at <ulink url="&menu-structure;">The Debian Menu sub-policy 2.1 'Preferred menu structure'</ulink>.  <ulink url="&menu-structure;">The Debian Menu sub-policy 2.1 'Preferred menu structure'</ulink>.
3545    There were a major reorganization of menu structure for <literal>squeeze</literal>.
3546    </para> </footnote>
3547  </para>  </para>
3548  <para>  <para>
3549  The <literal>title</literal> field is the name of the program.  You can start  The <literal>title</literal> field is the name of the program.  You can start
# Line 3448  Normally with this <filename>watch</file Line 3659  Normally with this <filename>watch</file
3659  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of  <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of
3660  the form <literal>&lt;a href=...&gt;</literal>.  The base name (just the part  the form <literal>&lt;a href=...&gt;</literal>.  The base name (just the part
3661  after the final <literal>/</literal>) of these linked URLs are matched against  after the final <literal>/</literal>) of these linked URLs are matched against
3662  Perl regexp (see <citerefentry> <refentrytitle>perlre</refentrytitle>  Perl regular expression (see <citerefentry> <refentrytitle>perlre</refentrytitle>
3663  <manvolnum>1</manvolnum> </citerefentry>) pattern  <manvolnum>1</manvolnum> </citerefentry>) pattern
3664  <literal>gentoo-(.+)\.tar\.gz</literal>.  Out of matched files, the file with  <literal>gentoo-(.+)\.tar\.gz</literal>.  Out of matched files, the file with
3665  the greatest version number is downloaded and the <command>uupdate</command>  the greatest version number is downloaded and the <command>uupdate</command>
# Line 3456  program is run to create the updated sou Line 3667  program is run to create the updated sou
3667  </para>  </para>
3668  <para>  <para>
3669  Although this is true for other sites, the SourceForge download service at  Although this is true for other sites, the SourceForge download service at
3670  <ulink url="&sf-net;">&sf-net;</ulink> is an exception.  When the  <ulink url="&sf-net;"/> is an exception.  When the
3671  <filename>watch</filename> file has an URL matching with the Perl regexp  <filename>watch</filename> file has an URL matching with the Perl regexp
3672  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program  <literal>^http://sf\.net/</literal>, the <command>uscan</command> program
3673  substitutes it with <literal>&qa-do;watch/sf.php/</literal> and  substitutes it with <literal>&qa-do;watch/sf.php/</literal> and
# Line 3520  Debian packaging to ease merging of the Line 3731  Debian packaging to ease merging of the
3731  </para>  </para>
3732  <para>  <para>
3733  After you build a package, the source is normally left patched.  You need to  After you build a package, the source is normally left patched.  You need to
3734  unpatch it manually by running <literal>quilt pop -a</literal> before  unpatch it manually by running <literal>dquilt pop -a</literal> before
3735  committing to the <literal>master</literal> branch.  You can automate this by  committing to the <literal>master</literal> branch.  You can automate this by
3736  adding the optional <filename>debian/source/local-options</filename> file  adding the optional <filename>debian/source/local-options</filename> file
3737  containing <literal>unapply-patches</literal>.  This file is not included in  containing <literal>unapply-patches</literal>.  This file is not included in
# Line 3542  such as <command>dh_autoreconf</command> Line 3753  such as <command>dh_autoreconf</command>
3753  <xref linkend="customrules"/>.  <xref linkend="customrules"/>.
3754  </para>  </para>
3755  <para>  <para>
3756  You can provide a Perl regular expression argument to the  You can provide a Perl regular expression to the
3757  <literal>--extend-diff-ignore</literal> option of <citerefentry>  <literal>--extend-diff-ignore</literal> option argument of <citerefentry>
3758  <refentrytitle>dpkg-source</refentrytitle><manvolnum>1</manvolnum>  <refentrytitle>dpkg-source</refentrytitle><manvolnum>1</manvolnum>
3759  </citerefentry> to ignore changes made to the autogenerated files while  </citerefentry> to ignore changes made to the autogenerated files while
3760  creating the source package.  creating the source package.
# Line 3552  creating the source package. Line 3763  creating the source package.
3763  You can store such <command>dpkg-source</command> option argument in the  You can store such <command>dpkg-source</command> option argument in the
3764  <filename>source/options</filename> file of the source package as the generic  <filename>source/options</filename> file of the source package as the generic
3765  solution to address this problem of the autogenerated files.  The following  solution to address this problem of the autogenerated files.  The following
3766  will skip creating patch files for <filename>config.sub</filename>  will skip creating patch files for <filename>config.sub</filename>,
3767  <filename>config.guess</filename> and <filename>Makefile</filename>.  <filename>config.guess</filename> and <filename>Makefile</filename>.
3768  </para>  </para>
3769  <screen>  <screen>
# Line 3597  documentation of your changes are very i Line 3808  documentation of your changes are very i
3808  by your sponsor.  </para> </footnote>  by your sponsor.  </para> </footnote>
3809  </para>  </para>
3810  <para>  <para>
3811  For <xref linkend="modify"/> , we created 3 patches in  For <xref linkend="modify"/>, we created 3 patches in
3812  <filename>debian/patches</filename>.  <filename>debian/patches</filename>.
3813  </para>  </para>
3814  <para>  <para>
3815  Since Debian patches are located in <filename>debian/patches</filename>, please  Since Debian patches are located in <filename>debian/patches</filename>, please
3816  make sure to setup the <command>quilt</command> command properly as described  make sure to setup the <command>dquilt</command> command properly as described
3817  in <xref linkend="quiltrc"/> .  in <xref linkend="quiltrc"/>.
3818  </para>  </para>
3819  <para>  <para>
3820  When someone (including yourself) provides you with a patch  When someone (including yourself) provides you with a patch
# Line 3614  quite simple: Line 3825  quite simple:
3825  <screen>  <screen>
3826  $ dpkg-source -x gentoo_0.9.12.dsc  $ dpkg-source -x gentoo_0.9.12.dsc
3827  $ cd gentoo-0.9.12  $ cd gentoo-0.9.12
3828  $ quilt import ../<replaceable>foo</replaceable>.patch  $ dquilt import ../<replaceable>foo</replaceable>.patch
3829  $ quilt push  $ dquilt push
3830  $ quilt refresh  $ dquilt refresh
3831  $ quilt header -e  $ dquilt header -e
3832  ... describe patch  ... describe patch
3833  </screen>  </screen>
3834  <para>  <para>
3835  The patches stored in the newer <literal>3.0 (quilt)</literal> source format  The patches stored in the newer <literal>3.0 (quilt)</literal> source format
3836  must be <emphasis>fuzz</emphasis> free.  You should ensure it as <literal>quilt  must be <emphasis>fuzz</emphasis> free.  You should ensure it as <literal>dquilt
3837  pop -a; while quilt push; do quilt refresh; done</literal>.  pop -a; while dquilt push; do dquilt refresh; done</literal>.
3838  </para>  </para>
3839  </section>  </section>
3840  </chapter>  </chapter>
# Line 3644  the <systemitem role="package">build-ess Line 3855  the <systemitem role="package">build-ess
3855  </listitem>  </listitem>
3856  <listitem>  <listitem>
3857  <para>  <para>
3858  packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/> ), and  packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/>), and
3859  </para>  </para>
3860  </listitem>  </listitem>
3861  <listitem>  <listitem>
3862  <para>  <para>
3863  packages listed in the <literal>Build-Depends-indep</literal> field (see <xref linkend="control"/> ).  packages listed in the <literal>Build-Depends-indep</literal> field (see <xref linkend="control"/>).
3864  </para>  </para>
3865  </listitem>  </listitem>
3866  </itemizedlist>  </itemizedlist>
# Line 3700  create and sign the upload <filename>.ch Line 3911  create and sign the upload <filename>.ch
3911  The only input that will be required of you is your GPG secret pass phrase,  The only input that will be required of you is your GPG secret pass phrase,
3912  twice.  twice.
3913  <footnote><para>  <footnote><para>
3914  This GPG key must be signed by the Debian developer to get connected to the web  This GPG key must be signed by a Debian developer to get connected to the web
3915  of trust.  This enables your uploaded packages to be accepted to the Debian  of trust and must be registered to <ulink url="&keyring;">the Debian
3916  archives.  See  keyring</ulink>.  This enables your uploaded packages to be accepted to the
3917    Debian archives.  See
3918  <ulink url="&keycreate;">Creating a new GPG key</ulink> and  <ulink url="&keycreate;">Creating a new GPG key</ulink> and
3919  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.  <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
3920  </para></footnote>  </para></footnote>
# Line 3751  copy the three files somewhere else and Line 3963  copy the three files somewhere else and
3963  gentoo_0.9.12-1.dsc</literal>.  <footnote><para> You can avoid applying  gentoo_0.9.12-1.dsc</literal>.  <footnote><para> You can avoid applying
3964  <command>quilt</command> patches in the <literal>3.0 (quilt)</literal> source  <command>quilt</command> patches in the <literal>3.0 (quilt)</literal> source
3965  format at the end of the extraction with the <literal>--skip-patches</literal>  format at the end of the extraction with the <literal>--skip-patches</literal>
3966  option.  Alternatively, you can run <literal>quilt pop -a</literal> after  option.  Alternatively, you can run <literal>dquilt pop -a</literal> after
3967  normal operation.  </para> </footnote>  normal operation.  </para> </footnote>
3968  </para>  </para>
3969  </listitem>  </listitem>
# Line 3819  the <systemitem role="package">build-ess Line 4031  the <systemitem role="package">build-ess
4031  </listitem>  </listitem>
4032  <listitem>  <listitem>
4033  <para>  <para>
4034  packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/> ).  packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/>).
4035  </para>  </para>
4036  </listitem>  </listitem>
4037  </itemizedlist>  </itemizedlist>
# Line 3867  This is why you see your package for oth Line 4079  This is why you see your package for oth
4079  </para>  </para>
4080  <para>  <para>
4081  Although packages listed in the <literal>Build-Depends-indep</literal> field  Although packages listed in the <literal>Build-Depends-indep</literal> field
4082  are required to be installed for the normal packaging by us (see <xref linkend="completebuild"/> ), they are not required to be installed for the  are required to be installed for the normal packaging by us (see <xref linkend="completebuild"/>), they are not required to be installed for the
4083  autobuilder system since it build only architecture dependent binary packages.  autobuilder system since it build only architecture dependent binary packages.
4084  <footnote><para> Unlike under the <systemitem role="package">pbuilder</systemitem> package, the <command>chroot</command>  <footnote><para> Unlike under the <systemitem role="package">pbuilder</systemitem> package, the <command>chroot</command>
4085  environment under the <systemitem role="package">sbuild</systemitem> package  environment under the <systemitem role="package">sbuild</systemitem> package
# Line 3876  many packages installed.  </para> </foot Line 4088  many packages installed.  </para> </foot
4088  packaging and autobuilder situation dictates whether you record such required  packaging and autobuilder situation dictates whether you record such required
4089  packages in the <literal>Build-Depends</literal> or  packages in the <literal>Build-Depends</literal> or
4090  <literal>Build-Depends-indep</literal> fields of the  <literal>Build-Depends-indep</literal> fields of the
4091  <filename>debian/control</filename> file (see <xref linkend="control"/> ).  <filename>debian/control</filename> file (see <xref linkend="control"/>).
4092  </para>  </para>
4093  </section>  </section>
4094  <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>  <section id="option-sa"><title>Including <filename>orig.tar.gz</filename> for upload</title>
# Line 3940  For a clean room (<command>chroot</comma Line 4152  For a clean room (<command>chroot</comma
4152  build dependencies, the <systemitem role="package">pbuilder</systemitem>  build dependencies, the <systemitem role="package">pbuilder</systemitem>
4153  package is very useful.  <footnote><para> Since the <systemitem role="package">pbuilder</systemitem> package is still evolving, you have to  package is very useful.  <footnote><para> Since the <systemitem role="package">pbuilder</systemitem> package is still evolving, you have to
4154  check the actual configuration situation by consulting the latest official  check the actual configuration situation by consulting the latest official
4155  documentation.  </para> </footnote> This ensures a clean build from the source  documentation.</para> </footnote> This ensures a clean build from the source
4156  under the <literal>sid</literal> auto-builder for different architectures and  under the <literal>sid</literal> auto-builder for different architectures and
4157  avoids the severity serious FTBFS (Fails To Build From Source) bug which is  avoids the severity serious FTBFS (Fails To Build From Source) bug which is
4158  always in the RC (release critical) category.  See <ulink url="&buildd-do;"/> for more on the Debian  always in the RC (release critical) category.
4159  package <systemitem role="package">auto-builder</systemitem>.  <footnote><para>See <ulink url="&buildd-do;"/> for more on the
4160    auto-builder of the Debian package.</para></footnote>
4161  </para>  </para>
4162  <para>  <para>
4163  Let's customize the <systemitem role="package">pbuilder</systemitem> package by  Let's customize the <systemitem role="package">pbuilder</systemitem> package by
# Line 4085  See <ulink url="&pbuilder;"/>, Line 4298  See <ulink url="&pbuilder;"/>,
4298  </section>  </section>
4299  <section id="git-buildpackage"><title><command>git-buildpackage</command> command and similars</title>  <section id="git-buildpackage"><title><command>git-buildpackage</command> command and similars</title>
4300  <para>  <para>
4301  If your upstream uses the source code management system (<ulink url="&debref-vcs;">VCS</ulink>)  If your upstream uses the source code management system (VCS)
4302    <footnote><para>See <ulink url="&debref-vcs;">Version control systems</ulink> for more.</para></footnote>
4303  to maintain their code, you should consider to use them.  That makes merging  to maintain their code, you should consider to use them.  That makes merging
4304  and cherry-picking upstream patches much easier.  There are several specialized  and cherry-picking upstream patches much easier.  There are several specialized
4305  wrapper script packages for the Debian package building for each VCS.  wrapper script packages for the Debian package building for each VCS.
# Line 4099  Debian packages in Git repositories. Line 4313  Debian packages in Git repositories.
4313  </listitem>  </listitem>
4314  <listitem>  <listitem>
4315  <para>  <para>
 <systemitem role="package">topgit</systemitem>: a Git patch queue manager  
 </para>  
 </listitem>  
 <listitem>  
 <para>  
4316  <systemitem role="package">svn-buildpackage</systemitem>: helper programs to  <systemitem role="package">svn-buildpackage</systemitem>: helper programs to
4317  maintain Debian packages with Subversion.  maintain Debian packages with Subversion.
4318  </para>  </para>
# Line 4116  package scripts for CVS source trees. Line 4325  package scripts for CVS source trees.
4325  </listitem>  </listitem>
4326  </itemizedlist>  </itemizedlist>
4327  <para>  <para>
4328  These packages offer more elegant working environment than manual use of the  There are packages which <emphasis>automate</emphasis> building of packages
4329  <command>quilt</command> commands for advanced audiences to  under VCS managed source tree for advanced audiences.  I will not explain them
4330  <emphasis>automate</emphasis> building of packages.  I will not explain them in  in this tutorial.
 this tutorial.  
4331  <footnote><para> Here are few web resources available for advanced audiences.  </para>  <footnote><para> Here are few web resources available for advanced audiences.  </para>
4332  <itemizedlist>  <itemizedlist>
4333  <listitem> <para> <ulink url="&git-buildpackage-doc;">Building Debian Packages with git-buildpackage</ulink> </para> </listitem>  <listitem> <para> <ulink url="&git-buildpackage-doc;">Building Debian Packages with git-buildpackage</ulink> </para> </listitem>
4334  <listitem> <para> <ulink url="&debian-packages-git;">debian packages in git</ulink> </para> </listitem>  <listitem> <para> <ulink url="&debian-packages-git;">debian packages in git</ulink> </para> </listitem>
4335  <listitem> <para> <ulink url="&git-debian-packaging;">Using Git for Debian Packaging</ulink> </para> </listitem>  <listitem> <para> <ulink url="&git-debian-packaging;">Using Git for Debian Packaging</ulink> </para> </listitem>
4336    <listitem> <para> <ulink url="&git-dpm;">git-dpm: Debian packages in Git manager</ulink> </para> </listitem>
4337  <listitem> <para> <ulink url="&topgit;">Using TopGit to generate quilt series for Debian packaging</ulink> </para> </listitem>  <listitem> <para> <ulink url="&topgit;">Using TopGit to generate quilt series for Debian packaging</ulink> </para> </listitem>
4338  <listitem> <para> <ulink url="&git-dpm;">git-dpm: Debian packages in Git manager</ulink> </para> </listitem> </itemizedlist>  </itemizedlist>
4339  </footnote>  </footnote>
4340  </para>  </para>
4341  </section>  </section>
# Line 4194  All <emphasis>maintainer scripts</emphas Line 4403  All <emphasis>maintainer scripts</emphas
4403  <filename>preinst</filename>, <filename>prerm</filename>,  <filename>preinst</filename>, <filename>prerm</filename>,
4404  <filename>postinst</filename>, and <filename>postrm</filename> files, are  <filename>postinst</filename>, and <filename>postrm</filename> files, are
4405  non-trivial unless they are auto-generated by the <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are  non-trivial unless they are auto-generated by the <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are
4406  a novice maintainer (see <xref linkend="maintscripts"/> ).  a novice maintainer (see <xref linkend="maintscripts"/>).
4407  </para>  </para>
4408  <para>  <para>
4409  If the package makes use of these non-trivial <emphasis>maintainer  If the package makes use of these non-trivial <emphasis>maintainer
# Line 4275  file.  The <command>lintian</command> co Line 4484  file.  The <command>lintian</command> co
4484  for many common packaging errors.  <footnote><para> You do not need to provide  for many common packaging errors.  <footnote><para> You do not need to provide
4485  the <command>lintian</command> option <literal>-i -I --show-overrides</literal>  the <command>lintian</command> option <literal>-i -I --show-overrides</literal>
4486  if you customized <filename>/etc/devscripts.conf</filename> or  if you customized <filename>/etc/devscripts.conf</filename> or
4487  <filename>~/.devscripts</filename> as described in <xref linkend="debuild"/> .  <filename>~/.devscripts</filename> as described in <xref linkend="debuild"/>.
4488  </para> </footnote>  </para> </footnote>
4489  </para>  </para>
4490  <screen>  <screen>
# Line 4319  error. Line 4528  error.
4528  <para>  <para>
4529  For warnings, tune the package to avoid them or verify that the warnings are  For warnings, tune the package to avoid them or verify that the warnings are
4530  spurious.  If spurious, set the <filename>lintian-overrides</filename> files as  spurious.  If spurious, set the <filename>lintian-overrides</filename> files as
4531  described in <xref linkend="lintian"/> .  described in <xref linkend="lintian"/>.
4532  </para>  </para>
4533  <para>  <para>
4534  Note that you can build the package with <command>dpkg-buildpackage</command>  Note that you can build the package with <command>dpkg-buildpackage</command>
# Line 4397  your <filename>rules</filename> file to Line 4606  your <filename>rules</filename> file to
4606  </chapter>  </chapter>
4607  <chapter id="upload"><title>Uploading the package</title>  <chapter id="upload"><title>Uploading the package</title>
4608  <para>  <para>
4609  Now that you have tested your new package thoroughly, you will be technically  Now that you have tested your new package thoroughly, you want to release it to
4610  ready to start the Debian new maintainer application process, as described at  a public archive to share it.
 <ulink url="&nm-join;"/>  
4611  </para>  </para>
4612  <section id="upload-debian"><title>Uploading to the Debian archive</title>  <section id="upload-debian"><title>Uploading to the Debian archive</title>
4613  <para>  <para>
4614  Once you become an official developer, you'll need to upload the package to the  Once you become an official developer,
4615  Debian archive.  You can do this manually, but it's easier to use the provided  <footnote><para>
4616    See <xref linkend="socialdynamism"/>.
4617    </para></footnote>
4618    you can upload the package to the Debian archive.
4619    <footnote><para>
4620    There are publicly accessible archives such as <ulink url="&mentors-dn;"/>
4621    which work almost the same way as Debian archive and provide upload area for
4622    the non-DD.  You can set up an equivalent archive by yourself using tools
4623    listed at <ulink url="&deb-archive;"/>.  So this section is useful for the
4624    non-DD, too.
4625    </para></footnote>
4626    You can do this manually, but it's easier to use the existing
4627  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>  automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle>
4628  <manvolnum>1</manvolnum> </citerefentry> or <citerefentry>  <manvolnum>1</manvolnum> </citerefentry> or <citerefentry>
4629  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
# Line 4470  Z4jxNrgh7Bc= Line 4689  Z4jxNrgh7Bc=
4689  =pH94  =pH94
4690  -----END PGP SIGNATURE-----  -----END PGP SIGNATURE-----
4691  </screen>  </screen>
 <para>  
 See <ulink url="&mentors-dn;"/> for  
 publically accessible upload area for non-DD.  
 </para>  
 <para>  
 See <ulink url="&debref-archive;">Debian  
 Reference, 2.7.12.  'Small public package archive'</ulink> for an example for  
 creating a small public package archive compatible with the modern secure APT  
 system.  
 </para>  
4692  </section>  </section>
4693  <section id="skipped-uploads"><title>Skipped uploads</title>  <section id="skipped-uploads"><title>Skipped uploads</title>
4694  <para>  <para>
# Line 4512  If this is to be recorded as a new patch Line 4721  If this is to be recorded as a new patch
4721  <itemizedlist>  <itemizedlist>
4722  <listitem>  <listitem>
4723  <para>  <para>
4724  <literal>quilt new <replaceable>bugname.patch</replaceable></literal> to set  <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set
4725  patch name;  patch name;
4726  </para>  </para>
4727  </listitem>  </listitem>
4728  <listitem>  <listitem>
4729  <para>  <para>
4730  <literal>quilt add <replaceable>buggy-file</replaceable></literal> to declare  <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare
4731  file to be modified;  file to be modified;
4732  </para>  </para>
4733  </listitem>  </listitem>
# Line 4529  Correct the problem in the package sourc Line 4738  Correct the problem in the package sourc
4738  </listitem>  </listitem>
4739  <listitem>  <listitem>
4740  <para>  <para>
4741  <literal>quilt refresh</literal> to record to  <literal>dquilt refresh</literal> to record to
4742  <filename><replaceable>bugname.patch</replaceable></filename>;  <filename><replaceable>bugname.patch</replaceable></filename>;
4743  </para>  </para>
4744  </listitem>  </listitem>
4745  <listitem>  <listitem>
4746  <para>  <para>
4747  <literal>quilt header -e</literal> to add its description;  <literal>dquilt header -e</literal> to add its description;
4748  </para>  </para>
4749  </listitem>  </listitem>
4750  </itemizedlist>  </itemizedlist>
# Line 4547  If this is to update an existing patch, Line 4756  If this is to update an existing patch,
4756  <itemizedlist>  <itemizedlist>
4757  <listitem>  <listitem>
4758  <para>  <para>
4759  <literal>quilt pop <replaceable>foo.patch</replaceable></literal> to recall  <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall
4760  existing <filename><replaceable>foo.patch</replaceable></filename>;  existing <filename><replaceable>foo.patch</replaceable></filename>;
4761  </para>  </para>
4762  </listitem>  </listitem>
# Line 4559  Correct the problem in the old Line 4768  Correct the problem in the old
4768  </listitem>  </listitem>
4769  <listitem>  <listitem>
4770  <para>  <para>
4771  <literal>quilt refresh</literal> to update  <literal>dquilt refresh</literal> to update
4772  <filename><replaceable>foo.patch</replaceable></filename>;  <filename><replaceable>foo.patch</replaceable></filename>;
4773  </para>  </para>
4774  </listitem>  </listitem>
4775  <listitem>  <listitem>
4776  <para>  <para>
4777  <literal>quilt header -e</literal> to update its description;  <literal>dquilt header -e</literal> to update its description;
4778  </para>  </para>
4779  </listitem>  </listitem>
4780  <listitem>  <listitem>
4781  <para>  <para>
4782  <literal>while quilt push; do quilt refresh; done</literal> to apply all  <literal>while dquilt push; do dquilt refresh; done</literal> to apply all
4783  patches while removing <emphasis>fuzz</emphasis>;  patches while removing <emphasis>fuzz</emphasis>;
4784  </para>  </para>
4785  </listitem>  </listitem>
# Line 4603  Repeat what you did in the above to fix Line 4812  Repeat what you did in the above to fix
4812  </listitem>  </listitem>
4813  <listitem>  <listitem>
4814  <para>  <para>
4815  Repeat what you did in <xref linkend="completebuild"/> , <xref linkend="checkit"/> , and <xref linkend="upload"/> .  The difference is that  Repeat what you did in <xref linkend="completebuild"/>, <xref linkend="checkit"/>, and <xref linkend="upload"/>.  The difference is that
4816  this time, the original source archive won't be included, as it hasn't been  this time, the original source archive won't be included, as it hasn't been
4817  changed and it already exists in the Debian archive.  changed and it already exists in the Debian archive.
4818  </para>  </para>
# Line 4667  Update the Debian <filename>changelog</f Line 4876  Update the Debian <filename>changelog</f
4876  <itemizedlist>  <itemizedlist>
4877  <listitem>  <listitem>
4878  <para>  <para>
4879  Add an entry with "<literal>New upstream release</literal>".  Add an entry with <literal>New upstream release</literal>.
4880  </para>  </para>
4881  </listitem>  </listitem>
4882  <listitem>  <listitem>
4883  <para>  <para>
4884  Describe concisely the changes <emphasis>in the new upstream release</emphasis>  Describe concisely the changes <emphasis>in the new upstream release</emphasis>
4885  that fix reported bugs and close those bugs by adding "<literal>Closes: #<replaceable>bug_number</replaceable></literal>".  that fix reported bugs and close those bugs by adding <literal>Closes: #<replaceable>bug_number</replaceable></literal>.
4886  </para>  </para>
4887  </listitem>  </listitem>
4888  <listitem>  <listitem>
4889  <para>  <para>
4890  Describe concisely the changes <emphasis>to the new upstream release</emphasis>  Describe concisely the changes <emphasis>to the new upstream release</emphasis>
4891  by the maintainer that fix reported bugs and close those bugs by adding "<literal>Closes: #<replaceable>bug_number</replaceable></literal>".  by the maintainer that fix reported bugs and close those bugs by adding <literal>Closes: #<replaceable>bug_number</replaceable></literal>.
4892  </para>  </para>
4893  </listitem>  </listitem>
4894  </itemizedlist>  </itemizedlist>
4895  </listitem>  </listitem>
4896  <listitem>  <listitem>
4897  <para>  <para>
4898  <literal>while quilt push; do quilt refresh; done</literal> to apply all  <literal>while dquilt push; do dquilt refresh; done</literal> to apply all
4899  patches while removing <emphasis>fuzz</emphasis>.  patches while removing <emphasis>fuzz</emphasis>.
4900  </para>  </para>
4901  </listitem>  </listitem>
# Line 4703  If a patch you applied to the source was Line 4912  If a patch you applied to the source was
4912  <itemizedlist>  <itemizedlist>
4913  <listitem>  <listitem>
4914  <para>  <para>
4915  <literal>quilt delete</literal> to remove it.  <literal>dquilt delete</literal> to remove it.
4916  </para>  </para>
4917  </listitem>  </listitem>
4918  </itemizedlist>  </itemizedlist>
# Line 4716  upstream source, Line 4925  upstream source,
4925  <itemizedlist>  <itemizedlist>
4926  <listitem>  <listitem>
4927  <para>  <para>
4928  <literal>quilt push -f</literal> to apply old patches while forcing rejects as  <literal>dquilt push -f</literal> to apply old patches while forcing rejects as
4929  <filename><replaceable>baz</replaceable>.rej</filename>.  <filename><replaceable>baz</replaceable>.rej</filename>.
4930  </para>  </para>
4931  </listitem>  </listitem>
# Line 4729  realize intended effect of Line 4938  realize intended effect of
4938  </listitem>  </listitem>
4939  <listitem>  <listitem>
4940  <para>  <para>
4941  <literal>quilt refresh</literal> to update the patch.  <literal>dquilt refresh</literal> to update the patch.
4942  </para>  </para>
4943  </listitem>  </listitem>
4944  </itemizedlist>  </itemizedlist>
4945  </listitem>  </listitem>
4946  <listitem>  <listitem>
4947  <para>  <para>
4948  Continue back to <literal>while quilt push; do quilt refresh; done</literal>.  Continue back to <literal>while dquilt push; do dquilt refresh; done</literal>.
4949  </para>  </para>
4950  </listitem>  </listitem>
4951  </itemizedlist>  </itemizedlist>
# Line 4760  $ wget http://example.org/<replaceable>f Line 4969  $ wget http://example.org/<replaceable>f
4969  $ cd <replaceable>foo</replaceable>-<replaceable>oldversion</replaceable>  $ cd <replaceable>foo</replaceable>-<replaceable>oldversion</replaceable>
4970  $ uupdate -v <replaceable>newversion</replaceable> ../<replaceable>foo</replaceable>-<replaceable>newversion</replaceable>.tar.gz  $ uupdate -v <replaceable>newversion</replaceable> ../<replaceable>foo</replaceable>-<replaceable>newversion</replaceable>.tar.gz
4971  $ cd ../<replaceable>foo</replaceable>-<replaceable>newversion</replaceable>  $ cd ../<replaceable>foo</replaceable>-<replaceable>newversion</replaceable>
4972  $ while quilt push; do quilt refresh; done  $ while dquilt push; do dquilt refresh; done
4973  $ dch  $ dch
4974  ... document changes made  ... document changes made
4975  </screen>  </screen>
4976  <para>  <para>
4977  If you set up a <filename>debian/watch</filename> file as described in <xref linkend="watch"/> , you can skip the <command>wget</command> command.  You  If you set up a <filename>debian/watch</filename> file as described in <xref linkend="watch"/>, you can skip the <command>wget</command> command.  You
4978  simply run <citerefentry> <refentrytitle>uscan</refentrytitle>  simply run <citerefentry> <refentrytitle>uscan</refentrytitle>
4979  <manvolnum>1</manvolnum> </citerefentry> in the  <manvolnum>1</manvolnum> </citerefentry> in the
4980  <filename><replaceable>foo</replaceable>-<replaceable>oldversion</replaceable></filename>  <filename><replaceable>foo</replaceable>-<replaceable>oldversion</replaceable></filename>
# Line 4778  run the <command>uupdate</command> comma Line 4987  run the <command>uupdate</command> comma
4987  uupdate</literal> at the end of the URL.  </para> </footnote>  uupdate</literal> at the end of the URL.  </para> </footnote>
4988  </para>  </para>
4989  <para>  <para>
4990  You can release this updated source by repeating what you did in <xref linkend="completebuild"/> , <xref linkend="checkit"/> , and <xref linkend="upload"/> .  You can release this updated source by repeating what you did in <xref linkend="completebuild"/>, <xref linkend="checkit"/>, and <xref linkend="upload"/>.
4991  </para>  </para>
4992  </section>  </section>
4993  <section id="packagestyle"><title>Updating the packaging style</title>  <section id="packagestyle"><title>Updating the packaging style</title>
# Line 4811  If you want to update the <filename>rule Line 5020  If you want to update the <filename>rule
5020  <filename>Makefile</filename> inclusion mechanism of the Common Debian Build  <filename>Makefile</filename> inclusion mechanism of the Common Debian Build
5021  System (<systemitem role="package">cdbs</systemitem>) to the  System (<systemitem role="package">cdbs</systemitem>) to the
5022  <command>dh</command> syntax, see  <command>dh</command> syntax, see
5023  <ulink url="">cdbs-doc.pdf.gz</ulink> and understand its  <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its
5024  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the  <literal>DEB_*</literal> configuration variables.  <footnote><para> In the
5025  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some  <systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some
5026  negative descriptions of the <filename>rules</filename> file created by the  negative descriptions of the <filename>rules</filename> file created by the
# Line 4863  commands, remove such things and make it Line 5072  commands, remove such things and make it
5072  </listitem>  </listitem>
5073  </itemizedlist>  </itemizedlist>
5074  <para>  <para>
5075  You need to do other tasks described in <xref linkend="newupstream"/> , too.  You need to do other tasks described in <xref linkend="newupstream"/>, too.
5076  </para>  </para>
5077  </section>  </section>
5078  <section id="reminders"><title>Reminders for updating packages</title>  <section id="reminders"><title>Reminders for updating packages</title>

Legend:
Removed from v.8640  
changed lines
  Added in v.8718

  ViewVC Help
Powered by ViewVC 1.1.5