| 491 |
<systemitem role="package">maint-guide</systemitem> package using |
<systemitem role="package">maint-guide</systemitem> package using |
| 492 |
<command>reportbug</command>. |
<command>reportbug</command>. |
| 493 |
</para> |
</para> |
| 494 |
|
<para> |
| 495 |
|
The following is an alternative tutorial documentation which you may |
| 496 |
|
read along with this document: |
| 497 |
|
</para> |
| 498 |
|
<itemizedlist> |
| 499 |
|
<listitem><para><ulink url="&debpkg-tutorial0;">Debian Packaging Tutorial</ulink></para></listitem> |
| 500 |
|
<listitem><para><ulink url="&debpkg-tutorial1;">Practical session 1: Modifying the grep package</ulink></para></listitem> |
| 501 |
|
<listitem><para><ulink url="&debpkg-tutorial2;">Practical session 2: Packaging GNUjump</ulink></para></listitem> |
| 502 |
|
<listitem><para><ulink url="&debpkg-tutorial3;">Practical session 3: Packaging a Java library</ulink></para></listitem> |
| 503 |
|
</itemizedlist> |
| 504 |
</section> |
</section> |
| 505 |
<section id="helpme"><title>Where to ask for help</title> |
<section id="helpme"><title>Where to ask for help</title> |
| 506 |
<para> |
<para> |
| 1091 |
<para> |
<para> |
| 1092 |
You can change many things in the <filename>Makefile</filename>; for |
You can change many things in the <filename>Makefile</filename>; for |
| 1093 |
instance you can change the default location for file installation |
instance you can change the default location for file installation |
| 1094 |
using the option <command>./configure --prefix=/usr</command>. |
using the option <literal>./configure --prefix=/usr</literal>. |
| 1095 |
</para> |
</para> |
| 1096 |
<para> |
<para> |
| 1097 |
Although it is not required, updating the <filename>configure</filename> and |
Although it is not required, updating the <filename>configure</filename> and |
| 1185 |
<para> |
<para> |
| 1186 |
If upstream does not use a normal versioning scheme such as |
If upstream does not use a normal versioning scheme such as |
| 1187 |
<literal>2.30.32</literal> but uses some kind of date such as |
<literal>2.30.32</literal> but uses some kind of date such as |
| 1188 |
<literal>09Oct23</literal>, a random codename string, or a VCS hash value as part |
<literal>11Apr29</literal>, a random codename string, or a VCS hash value as part |
| 1189 |
of the version, make sure to remove them from the |
of the version, make sure to remove them from the |
| 1190 |
<emphasis role="strong">upstream version</emphasis>. Such information can be |
<emphasis role="strong">upstream version</emphasis>. Such information can be |
| 1191 |
recorded in the <filename>debian/changelog</filename> file. If you need to |
recorded in the <filename>debian/changelog</filename> file. If you need to |
| 1192 |
invent a version string, use the <literal>YYYYMMDD</literal> format such as |
invent a version string, use the <literal>YYYYMMDD</literal> format such as |
| 1193 |
<literal>20110429</literal> as upstream version. This ensures that |
<literal>20110429</literal> as upstream version. This ensures that |
| 1194 |
<command>dpkg</command> interprets later versions correctly as upgrades. |
<command>dpkg</command> interprets later versions correctly as upgrades. |
| 1195 |
|
If you need to ensure smooth transition to the normal version scheme such as |
| 1196 |
|
<literal>0.1</literal> in future, use the <literal>0~YYMMDD</literal> format |
| 1197 |
|
such as <literal>0~110429</literal> as upstream version, instead. |
| 1198 |
</para> |
</para> |
| 1199 |
<para> |
<para> |
| 1200 |
Version strings <footnote><para>Version strings may be |
Version strings <footnote><para>Version strings may be |
| 1258 |
</para> |
</para> |
| 1259 |
<screen> |
<screen> |
| 1260 |
$ cat >>~/.bashrc <<EOF |
$ cat >>~/.bashrc <<EOF |
| 1261 |
DEBEMAIL=your.email.address@example.org |
DEBEMAIL="your.email.address@example.org" |
| 1262 |
DEBFULLNAME=Firstname Lastname |
DEBFULLNAME="Firstname Lastname" |
| 1263 |
export DEBEMAIL DEBFULLNAME |
export DEBEMAIL DEBFULLNAME |
| 1264 |
EOF |
EOF |
| 1265 |
$ . ~/.bashrc |
$ . ~/.bashrc |
| 1405 |
line to <filename>~/.bashrc</filename>. |
line to <filename>~/.bashrc</filename>. |
| 1406 |
</para> |
</para> |
| 1407 |
<screen> |
<screen> |
| 1408 |
alias dquilt="quilt --quiltrc=~/.quiltrc-dpkg" |
alias dquilt="quilt --quiltrc=${HOME}/.quiltrc-dpkg" |
| 1409 |
</screen> |
</screen> |
| 1410 |
<para> |
<para> |
| 1411 |
Then let's create <filename>~/.quiltrc-dpkg</filename> as follows. |
Then let's create <filename>~/.quiltrc-dpkg</filename> as follows. |
| 1712 |
</listitem> |
</listitem> |
| 1713 |
</orderedlist> |
</orderedlist> |
| 1714 |
<para> |
<para> |
| 1715 |
Whenever you make changes that are not specifically related to Debian package |
Whenever you make changes that are not specific to the Debian package |
| 1716 |
such as <filename>debian/patches/fix-gentoo-target.patch</filename>, be sure to |
such as <filename>debian/patches/fix-gentoo-target.patch</filename>, be sure to |
| 1717 |
send them to the upstream maintainer so they can be included in the next |
send them to the upstream maintainer so they can be included in the next |
| 1718 |
revision of the program and be useful to everyone else. Also remember |
version of the program and be useful to everyone else. Also remember |
| 1719 |
to avoid making your fixes specific to Debian or Linux - or even Unix! |
to avoid making your fixes specific to Debian or Linux - or even Unix! |
| 1720 |
Make them portable. This will make your fixes much easier to apply. |
Make them portable. This will make your fixes much easier to apply. |
| 1721 |
</para> |
</para> |
| 2132 |
</para> |
</para> |
| 2133 |
<para> |
<para> |
| 2134 |
The fields may restrict their applicability to particular versions of each |
The fields may restrict their applicability to particular versions of each |
| 2135 |
named package. These versions are listed in parentheses after each individual |
named package. The restriction of each individual package is listed in |
| 2136 |
package name, and should contain a relation from the list below followed |
parentheses after its name, and should contain a relation from the list below |
| 2137 |
by the version number. The relations allowed are: <literal><<</literal>, |
followed by a version number value. |
| 2138 |
|
The relations allowed are: <literal><<</literal>, |
| 2139 |
<literal><=</literal>, <literal>=</literal>, <literal>>=</literal>, and |
<literal><=</literal>, <literal>=</literal>, <literal>>=</literal>, and |
| 2140 |
<literal>>></literal> for strictly lower, lower or equal, exactly equal, |
<literal>>></literal> for strictly lower, lower or equal, exactly equal, |
| 2141 |
greater or equal, and strictly greater, respectively. For example, |
greater or equal, and strictly greater, respectively. For example, |
| 2401 |
<section id="targets"><title>Targets of the <filename>rules</filename> file</title> |
<section id="targets"><title>Targets of the <filename>rules</filename> file</title> |
| 2402 |
<para> |
<para> |
| 2403 |
Every <filename>rules</filename> file, like any other |
Every <filename>rules</filename> file, like any other |
| 2404 |
<filename>Makefile</filename>, consists of several targets and their rules. |
<filename>Makefile</filename>, consists of several rules, each of |
| 2405 |
|
which defines a target and how it is carried out. |
| 2406 |
<footnote><para>You can start learning how to write <filename>Makefile</filename> from |
<footnote><para>You can start learning how to write <filename>Makefile</filename> from |
| 2407 |
<ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>. |
<ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>. |
| 2408 |
The full documentation is available as |
The full documentation is available as |
| 2410 |
<systemitem role="package">make-doc</systemitem> package in the <literal>non-free</literal> archive area. |
<systemitem role="package">make-doc</systemitem> package in the <literal>non-free</literal> archive area. |
| 2411 |
</para></footnote> |
</para></footnote> |
| 2412 |
A new rule begins with its target declaration in the first column. The |
A new rule begins with its target declaration in the first column. The |
| 2413 |
following lines beginning with the TAB code (ASCII 9) specify its rules. |
following lines beginning with the TAB code (ASCII 9) specify the recipe for |
| 2414 |
|
carrying out that target. |
| 2415 |
Empty lines and lines beginning with <literal>#</literal> (hash) are treated as |
Empty lines and lines beginning with <literal>#</literal> (hash) are treated as |
| 2416 |
comments and ignored. |
comments and ignored. |
| 2417 |
<footnote><para><ulink url="&policy-debianrules;">Debian |
<footnote><para><ulink url="&policy-debianrules;">Debian |
| 2575 |
<listitem> |
<listitem> |
| 2576 |
<para> |
<para> |
| 2577 |
<literal>fakeroot debian/rules binary</literal> runs <literal>fakeroot dh |
<literal>fakeroot debian/rules binary</literal> runs <literal>fakeroot dh |
| 2578 |
binary</literal>; which in turn runs the following<footnote><para> This assumes |
binary</literal>; which in turn runs the following<footnote><para>The following |
| 2579 |
that the <systemitem role="package">python-support</systemitem> package is |
example assumes your <filename>debian/compat</filename> has a value equal or |
| 2580 |
installed on the system. </para> </footnote>: |
more than 9 to avoid invoking any python support commands automatically. |
| 2581 |
|
</para> |
| 2582 |
|
</footnote>: |
| 2583 |
</para> |
</para> |
| 2584 |
<screen> |
<screen> |
| 2585 |
dh_testroot |
dh_testroot |
| 2597 |
dh_installemacsen |
dh_installemacsen |
| 2598 |
dh_installifupdown |
dh_installifupdown |
| 2599 |
dh_installinfo |
dh_installinfo |
|
dh_pysupport |
|
| 2600 |
dh_installinit |
dh_installinit |
| 2601 |
dh_installmenu |
dh_installmenu |
| 2602 |
dh_installmime |
dh_installmime |
| 2697 |
<filename>Makefile</filename> exists with the <literal>test</literal> target. |
<filename>Makefile</filename> exists with the <literal>test</literal> target. |
| 2698 |
<footnote><para> It actually looks for the first available target in |
<footnote><para> It actually looks for the first available target in |
| 2699 |
the <filename>Makefile</filename> out of <literal>test</literal> or |
the <filename>Makefile</filename> out of <literal>test</literal> or |
| 2700 |
<literal>check</literal>, and executes that. </para> </footnote> |
<literal>check</literal>, and executes that.</para> </footnote> |
| 2701 |
</para> |
</para> |
| 2702 |
<screen> |
<screen> |
| 2703 |
make test |
make test |
| 2724 |
The important part to know about the <filename>rules</filename> file created by |
The important part to know about the <filename>rules</filename> file created by |
| 2725 |
<command>dh_make</command> is that it is just a suggestion. It will work for |
<command>dh_make</command> is that it is just a suggestion. It will work for |
| 2726 |
most packages but for more complicated ones, don't be afraid to customize it to |
most packages but for more complicated ones, don't be afraid to customize it to |
| 2727 |
fit your needs. The only things that you must not change are the names of the |
fit your needs. |
|
rules, because all the tools use these names, as mandated by the Debian Policy. |
|
| 2728 |
</para> |
</para> |
| 2729 |
<para> |
<para> |
| 2730 |
Although <literal>install</literal> is not a required target, it is supported. |
Although <literal>install</literal> is not a required target, it is supported. |
| 2741 |
The <literal>dh $@</literal> command can be customized as follows. |
The <literal>dh $@</literal> command can be customized as follows. |
| 2742 |
<footnote><para> If a package installs the |
<footnote><para> If a package installs the |
| 2743 |
<filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename> |
<filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename> |
| 2744 |
file, you should activate its customization function by <literal>dh --with |
file, you should activate its customization function by <literal>dh $@ --with |
| 2745 |
<replaceable>custom-name</replaceable> $@</literal>. </para> </footnote> |
<replaceable>custom-name</replaceable></literal>. </para> </footnote> |
| 2746 |
|
</para> |
| 2747 |
|
<itemizedlist> |
| 2748 |
|
<listitem> |
| 2749 |
|
<para> |
| 2750 |
|
Add support for the <command>dh_python2</command> command. (The best choice |
| 2751 |
|
for Python.) <footnote><para> Use of the <command>dh_python2</command> command |
| 2752 |
|
is preferred over use of <command>dh_pysupport</command> or |
| 2753 |
|
<command>dh_pycentral</command> commands. Do not use the |
| 2754 |
|
<command>dh_python</command> command. </para> </footnote> |
| 2755 |
</para> |
</para> |
| 2756 |
<itemizedlist> |
<itemizedlist> |
| 2757 |
<listitem> |
<listitem> |
| 2758 |
<para> |
<para> |
| 2759 |
Add support for the <command>dh_pysupport</command> command. (The best choice |
Include the <systemitem role="package">python</systemitem> package in |
| 2760 |
for Python.) <footnote><para> Use of the <command>dh_pysupport</command> |
<literal>Build-Depends</literal>. |
| 2761 |
command is preferred over use of the <command>dh_pycentral</command> command. |
</para> |
| 2762 |
Do not use the <command>dh_python</command> command. </para> </footnote> |
</listitem> |
| 2763 |
|
<listitem> |
| 2764 |
|
<para> |
| 2765 |
|
Use <literal>dh $@ --with python2</literal>. |
| 2766 |
|
</para> |
| 2767 |
|
</listitem> |
| 2768 |
|
<listitem> |
| 2769 |
|
<para> |
| 2770 |
|
This handles Python modules using the <systemitem role="package">python</systemitem> framework. |
| 2771 |
|
</para> |
| 2772 |
|
</listitem> |
| 2773 |
|
</itemizedlist> |
| 2774 |
|
</listitem> |
| 2775 |
|
<listitem> |
| 2776 |
|
<para> |
| 2777 |
|
Add support for the <command>dh_pysupport</command> command. (deprecated) |
| 2778 |
</para> |
</para> |
| 2779 |
<itemizedlist> |
<itemizedlist> |
| 2780 |
<listitem> |
<listitem> |
| 2785 |
</listitem> |
</listitem> |
| 2786 |
<listitem> |
<listitem> |
| 2787 |
<para> |
<para> |
| 2788 |
Use <literal>dh $@</literal> as usual. (Use of <command>dh_pysupport</command> is the default) |
Use <literal>dh $@ --with pysupport</literal>. |
| 2789 |
</para> |
</para> |
| 2790 |
</listitem> |
</listitem> |
| 2791 |
<listitem> |
<listitem> |
| 2797 |
</listitem> |
</listitem> |
| 2798 |
<listitem> |
<listitem> |
| 2799 |
<para> |
<para> |
| 2800 |
Add support for the <command>dh_pycentral</command> command. |
Add support for the <command>dh_pycentral</command> command. (deprecated) |
| 2801 |
</para> |
</para> |
| 2802 |
<itemizedlist> |
<itemizedlist> |
| 2803 |
<listitem> |
<listitem> |
| 2808 |
</listitem> |
</listitem> |
| 2809 |
<listitem> |
<listitem> |
| 2810 |
<para> |
<para> |
| 2811 |
Use <literal>dh --with python-central $@</literal> instead. |
Use <literal>dh $@ --with python-central</literal> instead. |
| 2812 |
</para> |
</para> |
| 2813 |
</listitem> |
</listitem> |
| 2814 |
<listitem> |
<listitem> |
| 2836 |
</listitem> |
</listitem> |
| 2837 |
<listitem> |
<listitem> |
| 2838 |
<para> |
<para> |
| 2839 |
Use <literal>dh --with tex $@</literal> instead. |
Use <literal>dh $@ --with tex</literal> instead. |
| 2840 |
</para> |
</para> |
| 2841 |
</listitem> |
</listitem> |
| 2842 |
<listitem> |
<listitem> |
| 2860 |
</listitem> |
</listitem> |
| 2861 |
<listitem> |
<listitem> |
| 2862 |
<para> |
<para> |
| 2863 |
Use <literal>dh --with quilt $@</literal> instead. |
Use <literal>dh $@ --with quilt</literal> instead. |
| 2864 |
</para> |
</para> |
| 2865 |
</listitem> |
</listitem> |
| 2866 |
<listitem> |
<listitem> |
| 2890 |
</listitem> |
</listitem> |
| 2891 |
<listitem> |
<listitem> |
| 2892 |
<para> |
<para> |
| 2893 |
Use <literal>dh --with dkms $@</literal> instead. |
Use <literal>dh $@ --with dkms</literal> instead. |
| 2894 |
</para> |
</para> |
| 2895 |
</listitem> |
</listitem> |
| 2896 |
<listitem> |
<listitem> |
| 2914 |
</listitem> |
</listitem> |
| 2915 |
<listitem> |
<listitem> |
| 2916 |
<para> |
<para> |
| 2917 |
Use <literal>dh --with autotools-dev $@</literal> instead. |
Use <literal>dh $@ --with autotools-dev</literal> instead. |
| 2918 |
</para> |
</para> |
| 2919 |
</listitem> |
</listitem> |
| 2920 |
<listitem> |
<listitem> |
| 2939 |
</listitem> |
</listitem> |
| 2940 |
<listitem> |
<listitem> |
| 2941 |
<para> |
<para> |
| 2942 |
Use <literal>dh --with autoreconf $@</literal> instead. |
Use <literal>dh $@ --with autoreconf</literal> instead. |
| 2943 |
</para> |
</para> |
| 2944 |
</listitem> |
</listitem> |
| 2945 |
<listitem> |
<listitem> |
| 2962 |
</listitem> |
</listitem> |
| 2963 |
<listitem> |
<listitem> |
| 2964 |
<para> |
<para> |
| 2965 |
Use <literal>dh --with bash-completion $@</literal> instead. |
Use <literal>dh $@ --with bash-completion</literal> instead. |
| 2966 |
</para> |
</para> |
| 2967 |
</listitem> |
</listitem> |
| 2968 |
<listitem> |
<listitem> |
| 3034 |
dh_auto_build -- build |
dh_auto_build -- build |
| 3035 |
</screen> |
</screen> |
| 3036 |
<para> |
<para> |
| 3037 |
This ensures $(MAKE) is run with all the default arguments given by the |
This ensures <literal>$(MAKE)</literal> is run with all the default arguments given by the |
| 3038 |
<command>dh_auto_build</command> command plus the <literal>build</literal> argument. |
<command>dh_auto_build</command> command plus the <literal>build</literal> argument. |
| 3039 |
</para> |
</para> |
| 3040 |
<para> |
<para> |
| 4601 |
sure that there are no filenames conflicting with other existing packages, |
sure that there are no filenames conflicting with other existing packages, |
| 4602 |
using the |
using the |
| 4603 |
<filename>Contents-<replaceable>i386</replaceable></filename> file downloaded |
<filename>Contents-<replaceable>i386</replaceable></filename> file downloaded |
| 4604 |
from the Debian archive, |
from the Debian archive. |
| 4605 |
The <command>apt-file</command> command may be handy for this task. If there |
The <command>apt-file</command> command may be handy for this task. If there |
| 4606 |
are collisions, please take action to avoid this real problem, whether by |
are collisions, please take action to avoid this real problem, whether by |
| 4607 |
renaming the file, moving a common file to a separate package that |
renaming the file, moving a common file to a separate package that |
| 5296 |
If you want to update the <filename>rules</filename> file created with the |
If you want to update the <filename>rules</filename> file created with the |
| 5297 |
<filename>Makefile</filename> inclusion mechanism of the Common Debian Build |
<filename>Makefile</filename> inclusion mechanism of the Common Debian Build |
| 5298 |
System (<systemitem role="package">cdbs</systemitem>) to the |
System (<systemitem role="package">cdbs</systemitem>) to the |
| 5299 |
<command>dh</command> syntax, see |
<command>dh</command> syntax, see the following to understand its |
| 5300 |
<ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink> and understand its |
<literal>DEB_*</literal> configuration variables. |
| 5301 |
<literal>DEB_*</literal> configuration variables. |
</para> |
| 5302 |
|
<itemizedlist> |
| 5303 |
|
<listitem><para>local copy of <ulink url="&cdbs-doc;">cdbs-doc.pdf.gz</ulink></para></listitem> |
| 5304 |
|
<listitem><para><ulink url="&cdbs-tutorial;">The Common Debian Build System (CDBS), FOSDEM 2009</ulink></para></listitem> |
| 5305 |
|
</itemizedlist> |
| 5306 |
<!-- |
<!-- |
| 5307 |
<footnote><para> In the |
<footnote><para> In the |
| 5308 |
<systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some |
<systemitem role="package">cdbs</systemitem> (0.4.74) package, there are some |
| 5311 |
only for <literal>lenny</literal> which created explicit targets with long lists |
only for <literal>lenny</literal> which created explicit targets with long lists |
| 5312 |
of <command>dh_*</command> commands. </para> </footnote> |
of <command>dh_*</command> commands. </para> </footnote> |
| 5313 |
--> |
--> |
|
</para> |
|
| 5314 |
</listitem> |
</listitem> |
| 5315 |
<listitem> |
<listitem> |
| 5316 |
<para> |
<para> |