| 121 |
I have also intentionally skipped some corner cases and provided only pointers |
I have also intentionally skipped some corner cases and provided only pointers |
| 122 |
to keep this document simple. |
to keep this document simple. |
| 123 |
</para> |
</para> |
| 124 |
<section id="socialdynamism"><title>Social dynamics of Debian</title> |
<section id="socialdynamics"><title>Social dynamics of Debian</title> |
| 125 |
<para> |
<para> |
| 126 |
Here are some observations of Debian's social dynamics, presented in the hope |
Here are some observations of Debian's social dynamics, presented in the hope |
| 127 |
that it will prepare you for interactions with Debian. |
that it will prepare you for interactions with Debian. |
| 222 |
<listitem><para><ulink url="&debianorghelp;">How can you help Debian?</ulink> (official) </para> </listitem> |
<listitem><para><ulink url="&debianorghelp;">How can you help Debian?</ulink> (official) </para> </listitem> |
| 223 |
<listitem><para><ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - "Contributing to the Debian Project"</ulink> (semi-official) </para> </listitem> |
<listitem><para><ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - "Contributing to the Debian Project"</ulink> (semi-official) </para> </listitem> |
| 224 |
<listitem><para><ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental) </para> </listitem> |
<listitem><para><ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental) </para> </listitem> |
| 225 |
<listitem><para><ulink url="&nm-do;">Debian New Maintainer site</ulink> (official) </para> </listitem> |
<listitem><para><ulink url="&nm-do;">Debian New Member site</ulink> (official) </para> </listitem> |
| 226 |
<listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem> |
<listitem><para><ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental) </para> </listitem> |
| 227 |
</itemizedlist> |
</itemizedlist> |
| 228 |
</section> |
</section> |
| 229 |
<section id="needprogs"><title>Programs you need for development</title> |
<section id="needprogs"><title>Programs needed for development</title> |
| 230 |
<para> |
<para> |
| 231 |
Before you start anything, you should make sure that you have properly |
Before you start anything, you should make sure that you have properly |
| 232 |
installed some additional packages needed for development. Note that the list |
installed some additional packages needed for development. Note that the list |
| 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> |
| 595 |
Let's start by creating a package of your own (or, even better, |
Let's start by creating a package of your own (or, even better, |
| 596 |
adopting an existing one). |
adopting an existing one). |
| 597 |
</para> |
</para> |
| 598 |
<section id="workflow"><title>Workflow of the Debian package building</title> |
<section id="workflow"><title>Debian package building workflow</title> |
| 599 |
<para> |
<para> |
| 600 |
If you are making a Debian package with an upstream program, |
If you are making a Debian package with an upstream program, the |
| 601 |
typical workflow of the Debian package building involves generating several |
typical workflow of Debian package building involves generating several |
| 602 |
specifically named files for each step as the following. |
specifically named files for each step as follows. |
| 603 |
</para> |
</para> |
| 604 |
<itemizedlist> |
<itemizedlist> |
| 605 |
<listitem> |
<listitem> |
| 606 |
<para>We obtain an upstream program file usually in a compressed tar format.</para> |
<para>Get a copy of the upstream software, usually in a compressed tar format.</para> |
| 607 |
<itemizedlist> |
<itemizedlist> |
| 608 |
<listitem><literal><replaceable>package</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>-<replaceable>version</replaceable>.tar.gz</literal></listitem> |
| 609 |
</itemizedlist> |
</itemizedlist> |
| 610 |
</listitem> |
</listitem> |
| 611 |
<listitem> |
<listitem> |
| 612 |
<para> |
<para> |
| 613 |
We create a non-native Debian source package in the <literal>3.0 (quilt)</literal> format, which refers to the set of input files for |
Add Debian-specific packaging modifications to the upstream program under the |
| 614 |
the Debian package building, by adding Debian package modifications to the upstream program under the <filename>debian</filename> directory. |
<filename>debian</filename> directory, and create a non-native source package |
| 615 |
|
(that is, the set of input files used for Debian package building) in |
| 616 |
|
<literal>3.0 (quilt)</literal> format. |
| 617 |
</para> |
</para> |
| 618 |
<itemizedlist> |
<itemizedlist> |
| 619 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.orig.tar.gz</literal></listitem> |
| 620 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.debian.tar.gz</literal> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.debian.tar.gz</literal> |
| 621 |
<footnote><para>For the older non-native Debian source package in the <literal>1.0</literal> format, |
<footnote><para>For the older style of non-native Debian source packages in <literal>1.0</literal> format, |
| 622 |
<literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal> |
<literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal> |
| 623 |
is used instead. </para></footnote></listitem> |
is used instead. </para></footnote></listitem> |
| 624 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.dsc</literal></listitem> |
| 626 |
</listitem> |
</listitem> |
| 627 |
<listitem> |
<listitem> |
| 628 |
<para> |
<para> |
| 629 |
We build Debian binary packages, which are ordinary installable package files in <literal>.deb</literal> format (or <literal>.udeb</literal> format, used by the Debian Installer), from the Debian source package. |
Build Debian binary packages, which are ordinary installable package files in <literal>.deb</literal> format (or <literal>.udeb</literal> format, used by the Debian Installer) from the Debian source package. |
| 630 |
</para> |
</para> |
| 631 |
<itemizedlist> |
<itemizedlist> |
| 632 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem> |
| 637 |
Please note that the character separating |
Please note that the character separating |
| 638 |
<literal><replaceable>package</replaceable></literal> and |
<literal><replaceable>package</replaceable></literal> and |
| 639 |
<literal><replaceable>version</replaceable></literal> was changed from |
<literal><replaceable>version</replaceable></literal> was changed from |
| 640 |
<literal>-</literal> (hyphen) to <literal>_</literal> (underscore). |
<literal>-</literal> (hyphen) in the tarball name to |
| 641 |
|
<literal>_</literal> (underscore) in the Debian package filenames. |
| 642 |
</para> |
</para> |
| 643 |
<para> |
<para> |
| 644 |
Here, |
In the file names above, replace |
| 645 |
<literal><replaceable>package</replaceable></literal> part of the file name is substituted by the |
the <literal><replaceable>package</replaceable></literal> part with the <emphasis role="strong">package name</emphasis>, |
| 646 |
<emphasis role="strong">package name</emphasis>, |
the <literal><replaceable>version</replaceable></literal> part with the <emphasis role="strong">upstream version</emphasis>, |
| 647 |
<literal><replaceable>version</replaceable></literal> part of it is substituted by the |
the <literal><replaceable>revision</replaceable></literal> part with the <emphasis role="strong">Debian revision</emphasis>, |
| 648 |
<emphasis role="strong">upstream version</emphasis>, |
and the <literal><replaceable>arch</replaceable></literal> part with the <emphasis role="strong">package architecture</emphasis>, |
| 649 |
<literal><replaceable>revision</replaceable></literal> part of it is substituted by the |
as defined in the Debian Policy Manual. |
| 650 |
<emphasis role="strong">Debian revision</emphasis>, |
<footnote> <para> See |
|
<literal><replaceable>arch</replaceable></literal> part of it is substituted by the |
|
|
<emphasis role="strong">package architecture</emphasis>. |
|
|
<footnote><para> |
|
|
The <emphasis role="strong">package name</emphasis>, <emphasis |
|
|
role="strong">upstream version</emphasis>, and <emphasis role="strong">Debian |
|
|
revision</emphasis> must be adjusted to comply with the Debian Policy Manual: |
|
| 651 |
<ulink url="&policy-source;">5.6.1 Source</ulink>, |
<ulink url="&policy-source;">5.6.1 Source</ulink>, |
| 652 |
<ulink url="&policy-package;">5.6.7 Package</ulink>, and |
<ulink url="&policy-package;">5.6.7 Package</ulink>, and |
| 653 |
<ulink url="&policy-version;">5.6.12 Version</ulink>. |
<ulink url="&policy-version;">5.6.12 Version</ulink>. |
| 656 |
and is automatically assigned by the package build process.</para></footnote> |
and is automatically assigned by the package build process.</para></footnote> |
| 657 |
</para> |
</para> |
| 658 |
<para> |
<para> |
| 659 |
If you are making a Debian specific package without an upstream program instead, |
If instead you are making a Debian-specific package with no upstream, the |
| 660 |
typical workflow of the Debian package building is simpler. |
typical workflow of Debian package building is simpler. |
| 661 |
</para> |
</para> |
| 662 |
<itemizedlist> |
<itemizedlist> |
| 663 |
<listitem> |
<listitem> |
| 664 |
<para> |
<para> |
| 665 |
We create a native Debian source package in the <literal>3.0 (quilt)</literal> format using a compressed tar format in which required files under the <filename>debian</filename> directory are also included. |
Create a native Debian source package in the <literal>3.0 (native)</literal> |
| 666 |
|
format using a single compressed tar file in which all files are included. |
| 667 |
</para> |
</para> |
| 668 |
<itemizedlist> |
<itemizedlist> |
| 669 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>.tar.gz</literal></listitem> |
| 672 |
</listitem> |
</listitem> |
| 673 |
<listitem> |
<listitem> |
| 674 |
<para> |
<para> |
| 675 |
We build Debian binary packages from the native Debian source package. |
Build Debian binary packages from the native Debian source package. |
| 676 |
</para> |
</para> |
| 677 |
<itemizedlist> |
<itemizedlist> |
| 678 |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem> |
<listitem><literal><replaceable>package</replaceable>_<replaceable>version</replaceable>_<replaceable>arch</replaceable>.deb</literal></listitem> |
| 680 |
</listitem> |
</listitem> |
| 681 |
</itemizedlist> |
</itemizedlist> |
| 682 |
<para> |
<para> |
| 683 |
In the following, each step of this is explained with detailed examples. |
Each step of this outline is explained with detailed examples in later sections. |
| 684 |
</para> |
</para> |
| 685 |
</section> |
</section> |
| 686 |
<section id="choose"><title>Choose your program</title> |
<section id="choose"><title>Choose your program</title> |
| 825 |
</para> |
</para> |
| 826 |
</listitem> |
</listitem> |
| 827 |
</itemizedlist> |
</itemizedlist> |
| 828 |
|
</listitem> |
| 829 |
<listitem> |
<listitem> |
| 830 |
<para> |
<para> |
| 831 |
The program should <emphasis role="strong">not</emphasis> introduce security |
The program should <emphasis role="strong">not</emphasis> introduce security |
| 832 |
and maintenance concerns to the Debian system. |
and maintenance concerns to the Debian system. |
| 833 |
</para> |
</para> |
|
</listitem> |
|
| 834 |
<itemizedlist> |
<itemizedlist> |
| 835 |
<listitem> |
<listitem> |
| 836 |
<para> |
<para> |
| 872 |
</para> |
</para> |
| 873 |
<itemizedlist> |
<itemizedlist> |
| 874 |
<listitem><para>Simple packages</para> |
<listitem><para>Simple packages</para> |
| 875 |
<itemizedlist> |
<itemizedlist> |
| 876 |
<listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem> |
<listitem><para>single binary package, arch = all (collection of data such as wallpaper graphics)</para></listitem> |
| 877 |
<listitem><para>single binary package, arch = all (executables written in the POSIX shell language)</para></listitem> |
<listitem><para>single binary package, arch = all (executables written in an interpreted language such as POSIX shell)</para></listitem> |
| 878 |
<listitem><para>single binary package, arch = all (executables written in interpreter languages)</para></listitem> |
</itemizedlist> |
|
</itemizedlist> |
|
| 879 |
</listitem> |
</listitem> |
| 880 |
<listitem><para>Intermediate complexity packages</para> |
<listitem><para>Intermediate complexity packages</para> |
| 881 |
<itemizedlist> |
<itemizedlist> |
| 882 |
<listitem><para>single binary package, arch = any (executables written in compiler languages such as C and C++)</para></listitem> |
<listitem><para>single binary package, arch = any (ELF binary executables compiled from languages such as C and C++)</para></listitem> |
| 883 |
<listitem><para>multiple binary packages, arch = any + all (packages for executables + documentation)</para></listitem> |
<listitem><para>multiple binary packages, arch = any + all (packages for ELF binary executables + documentation)</para></listitem> |
| 884 |
<listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem> |
<listitem><para>upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename></para></listitem> |
| 885 |
<listitem><para>upstream source containing undistributable contents</para></listitem> |
<listitem><para>upstream source containing undistributable contents</para></listitem> |
| 886 |
</itemizedlist> |
</itemizedlist> |
| 887 |
</listitem> |
</listitem> |
| 888 |
<listitem><para>High complexity packages</para> |
<listitem><para>High complexity packages</para> |
| 889 |
<itemizedlist> |
<itemizedlist> |
| 890 |
<listitem><para>interpreter module package used by other packages</para></listitem> |
<listitem><para>interpreter module package used by other packages</para></listitem> |
| 891 |
<listitem><para>generic library package used by other packages</para></listitem> |
<listitem><para>generic ELF library package used by other packages</para></listitem> |
| 892 |
<listitem><para>multiple binary packages containing a library package</para></listitem> |
<listitem><para>multiple binary packages including an ELF library package</para></listitem> |
| 893 |
<listitem><para>source package with multiple upstream sources</para></listitem> |
<listitem><para>source package with multiple upstream sources</para></listitem> |
| 894 |
<listitem><para>kernel module packages</para></listitem> |
<listitem><para>kernel module packages</para></listitem> |
| 895 |
<listitem><para>kernel patch packages</para></listitem> |
<listitem><para>kernel patch packages</para></listitem> |
| 896 |
<listitem><para>any package with non-trivial maintainer scripts</para></listitem> |
<listitem><para>any package with non-trivial maintainer scripts</para></listitem> |
| 897 |
</itemizedlist> |
</itemizedlist> |
| 898 |
</listitem> |
</listitem> |
| 899 |
</itemizedlist> |
</itemizedlist> |
| 900 |
<para> |
<para> |
| 901 |
Packaging high complexity packages is not too hard, but it requires a bit more |
Packaging high complexity packages is not too hard, but it requires a bit more |
| 902 |
knowledge. You should seek specific guidances for every complexity. For example, some interpreter languages have their policy. |
knowledge. You should seek specific guidance for every complex feature. For |
| 903 |
|
example, some languages have their own sub-policy documents: |
| 904 |
</para> |
</para> |
| 905 |
<itemizedlist> |
<itemizedlist> |
| 906 |
<listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem> |
<listitem><para><ulink url="&policy-perl;">Perl policy</ulink></para></listitem> |
| 907 |
<listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem> |
<listitem><para><ulink url="&policy-python;">Python policy</ulink></para></listitem> |
| 908 |
<listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem> |
<listitem><para><ulink url="&policy-java;">Java policy</ulink></para></listitem> |
| 909 |
</itemizedlist> |
</itemizedlist> |
| 910 |
|
<para> |
| 911 |
|
There is another old Latin saying: <emphasis>fabricando fit faber</emphasis> |
| 912 |
|
(practice makes perfect). It is <emphasis>highly</emphasis> recommended to |
| 913 |
|
practice and experiment with all the steps of Debian packaging with simple packages |
| 914 |
|
while reading this tutorial. A trivial upstream tarball |
| 915 |
|
<filename>hello-sh-1.0.tar.gz</filename> created as followings may offer |
| 916 |
|
a good starting point.<footnote><para>Do not worry about the missing |
| 917 |
|
<filename>Makefile</filename>. You can install the <command>hello</command> |
| 918 |
|
command by simply using <command>debhelper</command> as in |
| 919 |
|
<xref linkend="install"/>, or by modifying the upstream source to add a new |
| 920 |
|
<filename>Makefile</filename> with the <literal>install</literal> target as in |
| 921 |
|
<xref linkend="modify"/>.</para></footnote> |
| 922 |
|
</para> |
| 923 |
|
<screen> |
| 924 |
|
$ mkdir -p hello-sh/hello-sh-1.0; cd hello-sh/hello-sh-1.0 |
| 925 |
|
$ cat > hello <<EOF |
| 926 |
|
#!/bin/sh |
| 927 |
|
# (C) 2011 Foo Bar, GPL2+ |
| 928 |
|
echo "Hello!" |
| 929 |
|
EOF |
| 930 |
|
$ chmod 755 hello |
| 931 |
|
$ cd .. |
| 932 |
|
$ tar -cvzf hello-sh-1.0.tar.gz hello-sh-1.0 |
| 933 |
|
</screen> |
| 934 |
</section> |
</section> |
| 935 |
<section id="getit"><title>Get the program, and try it out</title> |
<section id="getit"><title>Get the program, and try it out</title> |
| 936 |
<para> |
<para> |
| 962 |
appropriate tools and repack it. |
appropriate tools and repack it. |
| 963 |
</para> |
</para> |
| 964 |
<para> |
<para> |
| 965 |
|
If your program's source comes with some contents which do not comply with |
| 966 |
|
DFSG, you should also unpack it to remove such contents and repack it with a |
| 967 |
|
modified upstream version containing <literal>dfsg</literal>. |
| 968 |
|
</para> |
| 969 |
|
<para> |
| 970 |
As an example, I'll use a program called <command>gentoo</command>, a GTK+ |
As an example, I'll use a program called <command>gentoo</command>, a GTK+ |
| 971 |
file manager. |
file manager. |
| 972 |
<footnote><para> This program is already packaged. The |
<footnote><para> This program is already packaged. The |
| 1011 |
</section> |
</section> |
| 1012 |
<section id="simplemake"><title>Simple build systems</title> |
<section id="simplemake"><title>Simple build systems</title> |
| 1013 |
<para> |
<para> |
| 1014 |
Simple programs come with a <filename>Makefile</filename> and can |
Simple programs usually come with a <filename>Makefile</filename> and can |
| 1015 |
be compiled just by invoking <literal>make</literal>.<footnote><para> |
be compiled just by invoking <literal>make</literal>.<footnote><para> |
| 1016 |
Many modern programs come with a script <filename>configure</filename> which |
Many modern programs come with a script <filename>configure</filename> which |
| 1017 |
when executed creates a <filename>Makefile</filename> customized for |
when executed creates a <filename>Makefile</filename> customized for |
| 1077 |
<para> |
<para> |
| 1078 |
The second step of the Autotools workflow is usually that the user obtains this |
The second step of the Autotools workflow is usually that the user obtains this |
| 1079 |
distributed source and runs <literal>./configure && make</literal> in |
distributed source and runs <literal>./configure && make</literal> in |
| 1080 |
the source directory to compile the program into a |
the source directory to compile the program into an executable command |
| 1081 |
<command><replaceable>binary</replaceable></command> executable. |
<command><replaceable>binary</replaceable></command>. |
| 1082 |
</para> |
</para> |
| 1083 |
<screen> |
<screen> |
| 1084 |
Makefile.in -----+ +-> Makefile -----+-> make -> <replaceable>binary</replaceable> |
Makefile.in -----+ +-> Makefile -----+-> make -> <replaceable>binary</replaceable> |
| 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 |
| 1110 |
<section id="namever"><title>Package name and version</title> |
<section id="namever"><title>Package name and version</title> |
| 1111 |
<para> |
<para> |
| 1112 |
If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can |
If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can |
| 1113 |
consider |
take <literal>gentoo</literal> as the (source) <emphasis role="strong">package name</emphasis> |
| 1114 |
<emphasis role="strong">package name</emphasis> to be <literal>gentoo</literal> and |
and <literal>0.9.12</literal> as the <emphasis role="strong">upstream version</emphasis>. |
|
<emphasis role="strong">upstream version</emphasis> to be <literal>0.9.12</literal>. |
|
| 1115 |
These are used in the <filename>debian/changelog</filename> file described later in |
These are used in the <filename>debian/changelog</filename> file described later in |
| 1116 |
<xref linkend="changelog"/>, too. |
<xref linkend="changelog"/>, too. |
| 1117 |
</para> |
</para> |
| 1119 |
Although this simple approach works most of the times, you may need to adjust |
Although this simple approach works most of the times, you may need to adjust |
| 1120 |
<emphasis role="strong">package name</emphasis> and |
<emphasis role="strong">package name</emphasis> and |
| 1121 |
<emphasis role="strong">upstream version</emphasis> by renaming the upstream |
<emphasis role="strong">upstream version</emphasis> by renaming the upstream |
| 1122 |
source to follow the Debian Policy and the existing convention. |
source to follow Debian Policy and existing convention. |
| 1123 |
</para> |
</para> |
| 1124 |
<para> |
<para> |
| 1125 |
You must choose the <emphasis role="strong">package name</emphasis> |
You must choose the <emphasis role="strong">package name</emphasis> |
| 1128 |
(<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be |
(<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be |
| 1129 |
at least two characters long, must start with an alphanumeric character, and |
at least two characters long, must start with an alphanumeric character, and |
| 1130 |
must not be the same as existing ones. |
must not be the same as existing ones. |
| 1131 |
It is good idea to keep its length within 30 characters. |
It is a good idea to keep its length within 30 characters. |
| 1132 |
<footnote><para>The default package name field length of <command>aptitude</command> is 30. For more than 90% of packages, the package name is less than 24 characters.</para></footnote> |
<footnote><para>The default package name field length of <command>aptitude</command> is 30. For more than 90% of packages, the package name is less than 24 characters.</para></footnote> |
| 1133 |
</para> |
</para> |
| 1134 |
<!-- |
<!-- |
| 1144 |
Default aptitude setting display up to 30 chars (98.3%). |
Default aptitude setting display up to 30 chars (98.3%). |
| 1145 |
--> |
--> |
| 1146 |
<para> |
<para> |
| 1147 |
If upstream source uses generic words such as <literal>test-suite</literal> as |
If upstream uses some generic term such as <literal>test-suite</literal> for |
| 1148 |
its name, it is good idea to rename it not to contaminate name space for the |
its name, it is a good idea to rename it to identify its contents explicitly and avoid namespace pollution. |
|
package name and to identify its contents explicitly. |
|
| 1149 |
<footnote><para>If you follow the |
<footnote><para>If you follow the |
| 1150 |
<ulink url="&devref-newpackage;">Debian Developer's Reference 5.1. "New packages"</ulink>, |
<ulink url="&devref-newpackage;">Debian Developer's Reference 5.1. "New packages"</ulink>, |
| 1151 |
the ITP process will usually catch this kind of issues.</para></footnote> |
the ITP process will usually catch this kind of issues.</para></footnote> |
| 1158 |
start with a digit (<literal>0-9</literal>). <footnote><para>This stricter |
start with a digit (<literal>0-9</literal>). <footnote><para>This stricter |
| 1159 |
rule should help you avoid confusing file names.</para></footnote> |
rule should help you avoid confusing file names.</para></footnote> |
| 1160 |
It is good idea to keep its length within 8 characters if possible. |
It is good idea to keep its length within 8 characters if possible. |
| 1161 |
<footnote><para>The default version field length of <command>aptitude</command> is 10. The Debian revision with preceding hyphen usually consumes 2. For more than 80% of packages, the upstream version is less than 8 charactes and the Debian revision is less than 2 characters. For more than 90% of packages, the upstream version is less than 10 charactes and the Debian revision is less than 3 characters.</para></footnote> |
<footnote><para>The default version field length of <command>aptitude</command> is 10. The Debian revision with preceding hyphen usually consumes 2. For more than 80% of packages, the upstream version is less than 8 characters and the Debian revision is less than 2 characters. For more than 90% of packages, the upstream version is less than 10 characters and the Debian revision is less than 3 characters.</para></footnote> |
| 1162 |
</para> |
</para> |
| 1163 |
<!-- |
<!-- |
| 1164 |
Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64): |
Osamu's archive stat (2011-04-23, sid, kfreebsd-amd64): |
| 1183 |
90chars as max for file name of binary debs (package+up+deb+arch+.deb) |
90chars as max for file name of binary debs (package+up+deb+arch+.deb) |
| 1184 |
--> |
--> |
| 1185 |
<para> |
<para> |
| 1186 |
If the upstream software does not use normal version system like |
If upstream does not use a normal versioning scheme such as |
| 1187 |
<literal>2.30.32</literal> but uses some kind of date such as |
<literal>2.30.32</literal> but uses some kind of date such as |
| 1188 |
<literal>09Oct23</literal>, a random codename string or a VCS hash value as a part |
<literal>11Apr29</literal>, a random codename string, or a VCS hash value as part |
| 1189 |
of version, make sure to remove them from the |
of the version, make sure to remove them from the |
| 1190 |
<emphasis role="strong">upstream version</emphasis>. Such information can be |
<emphasis role="strong">upstream version</emphasis>. Such information can be |
| 1191 |
recorded in the <filename>debian/changelog</filename> file. If you need to |
recorded in the <filename>debian/changelog</filename> file. If you need to |
| 1192 |
invent a version string, use the <literal>YYYYMMDD</literal> format such as |
invent a version string, use the <literal>YYYYMMDD</literal> format such as |
| 1193 |
<literal>20110429</literal> as upstream version. This ensures that |
<literal>20110429</literal> as upstream version. This ensures that |
| 1194 |
<command>dpkg</command> properly sees later versions as upgrades. |
<command>dpkg</command> interprets later versions correctly as upgrades. |
| 1195 |
|
If you need to ensure smooth transition to the normal version scheme such as |
| 1196 |
|
<literal>0.1</literal> in future, use the <literal>0~YYMMDD</literal> format |
| 1197 |
|
such as <literal>0~110429</literal> as upstream version, instead. |
| 1198 |
</para> |
</para> |
| 1199 |
<para> |
<para> |
| 1200 |
Version strings <footnote><para>Version strings may be |
Version strings <footnote><para>Version strings may be |
| 1207 |
See <xref linkend="newrevision"/> for how the |
See <xref linkend="newrevision"/> for how the |
| 1208 |
<emphasis role="strong">Debian revision</emphasis> is incremented. |
<emphasis role="strong">Debian revision</emphasis> is incremented. |
| 1209 |
</para></footnote> |
</para></footnote> |
| 1210 |
can be compared with <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as the following. |
can be compared using <citerefentry> |
| 1211 |
|
<refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as follows. |
| 1212 |
</para> |
</para> |
| 1213 |
<screen> |
<screen> |
| 1214 |
$ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable> |
$ dpkg --compare-versions <replaceable>ver1</replaceable> <replaceable>op</replaceable> <replaceable>ver2</replaceable> |
| 1215 |
</screen> |
</screen> |
| 1216 |
<para> |
<para> |
| 1217 |
The version comparison rule can be summarized as the following. |
The version comparison rule can be summarized as: |
| 1218 |
</para> |
</para> |
| 1219 |
<itemizedlist> |
<itemizedlist> |
| 1220 |
<listitem><para>The strings are compared from the head to the tail.</para></listitem> |
<listitem><para>Strings are compared from the head to the tail.</para></listitem> |
| 1221 |
<listitem><para>Alphabets are larger than numbers.</para></listitem> |
<listitem><para>Letters are larger than digits.</para></listitem> |
| 1222 |
<listitem><para>Numbers are compared as the integer.</para></listitem> |
<listitem><para>Numbers are compared as integers.</para></listitem> |
| 1223 |
<listitem><para>Alphabets are compared in the ASCII code order.</para></listitem> |
<listitem><para>Letters are compared in ASCII code order.</para></listitem> |
| 1224 |
<listitem><para>There are some special rules for periods (<literal>.</literal>), plus (<literal>+</literal>) and tildes (<literal>~</literal>) as the followings.</para> |
<listitem><para>There are special rules for period |
| 1225 |
|
(<literal>.</literal>), plus (<literal>+</literal>), and tilde |
| 1226 |
|
(<literal>~</literal>) characters, as follows.</para> |
| 1227 |
<para> |
<para> |
| 1228 |
<literal>0.0</literal> < |
<literal>0.0</literal> < |
| 1229 |
<literal>0.5</literal> < |
<literal>0.5</literal> < |
| 1240 |
</listitem> |
</listitem> |
| 1241 |
</itemizedlist> |
</itemizedlist> |
| 1242 |
<para> |
<para> |
| 1243 |
One of the tricky case happens when the upstream releases |
One tricky case occurs when upstream releases |
| 1244 |
<filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the |
<filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the |
| 1245 |
pre-release of <filename>gentoo-0.9.12.tar.gz</filename>. You need to make |
pre-release of <filename>gentoo-0.9.12.tar.gz</filename>. You need to make |
| 1246 |
sure that the upgrade works properly by renaming the upstream source to |
sure that the upgrade works properly by renaming the upstream source to |
| 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 |
| 1363 |
<para> |
<para> |
| 1364 |
Please note that the source file does not need to contain any build system |
Please note that the source file does not need to contain any build system |
| 1365 |
discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>. It |
discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>. It |
| 1366 |
could be just a collection of graphics data etc. Installation of files may be |
could be just a collection of graphical data etc. Installation of files may be |
| 1367 |
enabled by <systemitem role="package">debhelper</systemitem> configuration |
carried out using only <systemitem role="package">debhelper</systemitem> configuration |
| 1368 |
files such as <filename>debian/install</filename> (see |
files such as <filename>debian/install</filename> (see |
| 1369 |
<xref linkend="install"/>) only. |
<xref linkend="install"/>). |
| 1370 |
</para> |
</para> |
| 1371 |
</section> |
</section> |
| 1372 |
<section id="native-dh-make"><title>Initial native Debian package</title> |
<section id="native-dh-make"><title>Initial native Debian package</title> |
| 1373 |
<para> |
<para> |
| 1374 |
Debian native packages are simpler to manage if they contain source files you |
If a package contains source files you are only maintaining for Debian, |
| 1375 |
manage only for Debian, possibly only for local uses. If you have source |
possibly only for local use, it may be simpler to create it as a Debian |
| 1376 |
|
native package. If you have source |
| 1377 |
files in <filename>~/mypackage-1.0</filename>, you can create an initial native |
files in <filename>~/mypackage-1.0</filename>, you can create an initial native |
| 1378 |
Debian package for it by issuing the <command>dh_make</command> command as |
Debian package for it by issuing the <command>dh_make</command> command as |
| 1379 |
follows. |
follows. |
| 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. |
| 1531 |
<literal>$(DESTDIR)</literal> to the temporary directory. |
<literal>$(DESTDIR)</literal> to the temporary directory. |
| 1532 |
</para> |
</para> |
| 1533 |
<para> |
<para> |
| 1534 |
For packages of the single binary type, the temporary directory used |
For a source package generating a single binary package, the temporary directory used |
| 1535 |
by the <command>dh_auto_install</command> command will be set to |
by the <command>dh_auto_install</command> command will be set to |
| 1536 |
<filename>debian/<replaceable>package</replaceable></filename>. |
<filename>debian/<replaceable>package</replaceable></filename>. |
| 1537 |
<footnote><para> For packages of the multiple binary type, the |
<footnote><para> For a source package generating multiple binary packages, the |
| 1538 |
<command>dh_auto_install</command> command uses <filename>debian/tmp</filename> |
<command>dh_auto_install</command> command uses <filename>debian/tmp</filename> |
| 1539 |
as the temporary directory while the <command>dh_install</command> command with |
as the temporary directory while the <command>dh_install</command> command with |
| 1540 |
the help of |
the help of |
| 1573 |
options including <literal>--prefix=/usr</literal>. </para> </footnote>: |
options including <literal>--prefix=/usr</literal>. </para> </footnote>: |
| 1574 |
</para> |
</para> |
| 1575 |
<screen> |
<screen> |
| 1576 |
# Where to put binary executables on 'make install'? |
# Where to put executable commands on 'make install'? |
| 1577 |
BIN = /usr/local/bin |
BIN = /usr/local/bin |
| 1578 |
# Where to put icons on 'make install'? |
# Where to put icons on 'make install'? |
| 1579 |
ICONS = /usr/local/share/gentoo |
ICONS = /usr/local/share/gentoo |
| 1584 |
Debian, so change those paths to: |
Debian, so change those paths to: |
| 1585 |
</para> |
</para> |
| 1586 |
<screen> |
<screen> |
| 1587 |
# Where to put binary executables on 'make install'? |
# Where to put executable commands on 'make install'? |
| 1588 |
BIN = $(DESTDIR)/usr/bin |
BIN = $(DESTDIR)/usr/bin |
| 1589 |
# Where to put icons on 'make install'? |
# Where to put icons on 'make install'? |
| 1590 |
ICONS = $(DESTDIR)/usr/share/gentoo |
ICONS = $(DESTDIR)/usr/share/gentoo |
| 1596 |
your package. |
your package. |
| 1597 |
</para> |
</para> |
| 1598 |
<para> |
<para> |
| 1599 |
So, we should install binary executables in <filename>/usr/bin</filename> instead of |
So, we should install executable commands in <filename>/usr/bin</filename> instead of |
| 1600 |
<filename>/usr/local/bin</filename>, the manual page in |
<filename>/usr/local/bin</filename>, the manual page in |
| 1601 |
<filename>/usr/share/man/man1</filename> instead of |
<filename>/usr/share/man/man1</filename> instead of |
| 1602 |
<filename>/usr/local/man/man1</filename>, and so on. Notice how there's no manual |
<filename>/usr/local/man/man1</filename>, and so on. Notice how there's no manual |
| 1642 |
</para> |
</para> |
| 1643 |
<para> |
<para> |
| 1644 |
Originally, <systemitem role="package">gentoo</systemitem>'s |
Originally, <systemitem role="package">gentoo</systemitem>'s |
| 1645 |
install target said: |
<literal>install</literal> target said: |
| 1646 |
</para> |
</para> |
| 1647 |
<screen> |
<screen> |
| 1648 |
install: gentoo-target |
install: gentoo-target |
| 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> |
| 1761 |
</chapter> |
</chapter> |
| 1762 |
<chapter id="dreq"><title>Required files under the <filename>debian</filename> directory</title> |
<chapter id="dreq"><title>Required files under the <filename>debian</filename> directory</title> |
| 1763 |
<para> |
<para> |
| 1764 |
There is a new subdirectory under the program's source directory, it's called |
There is a new subdirectory under the program's source directory, called |
| 1765 |
<filename>debian</filename>. There are a number of files in this directory |
<filename>debian</filename>. There are a number of files in this directory |
| 1766 |
that we should edit in order to customize the behavior of the package. The |
that we should edit in order to customize the behavior of the package. The |
| 1767 |
most important of them are <filename>control</filename>, |
most important of them are <filename>control</filename>, |
| 1768 |
<filename>changelog</filename>, <filename>copyright</filename> and |
<filename>changelog</filename>, <filename>copyright</filename>, and |
| 1769 |
<filename>rules</filename>, which are required for all packages. |
<filename>rules</filename>, which are required for all packages. |
| 1770 |
<footnote><para> |
<footnote><para> |
| 1771 |
In this chapter, files in the <filename>debian</filename> directory are |
In this chapter, files in the <filename>debian</filename> directory are |
| 1772 |
referred without preceding <filename>debian/</filename> for simplicity whenever |
referred to without the leading <filename>debian/</filename> for simplicity whenever |
| 1773 |
they are obvious. |
the meaning is obvious. |
| 1774 |
</para></footnote> |
</para></footnote> |
| 1775 |
</para> |
</para> |
| 1776 |
<section id="control"><title><filename>control</filename> file</title> |
<section id="control"><title><filename>control</filename></title> |
| 1777 |
<para> |
<para> |
| 1778 |
This file contains various values which <command>dpkg</command>, |
This file contains various values which <command>dpkg</command>, |
| 1779 |
<command>dselect</command>, <command>apt-get</command>, |
<command>dselect</command>, <command>apt-get</command>, |
| 1780 |
<command>apt-cache</command>, <command>aptitude</command>, and other package |
<command>apt-cache</command>, <command>aptitude</command>, and other package |
| 1781 |
management tools will use to manage the package. It is defined by the |
management tools will use to manage the package. It is defined by the |
| 1782 |
<ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>. |
<ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>. |
| 1783 |
</para> |
</para> |
| 1784 |
<para> |
<para> |
| 1814 |
Line 2 is the section of the distribution the source package goes into. |
Line 2 is the section of the distribution the source package goes into. |
| 1815 |
</para> |
</para> |
| 1816 |
<para> |
<para> |
| 1817 |
As you may have noticed, Debian archive is divided in sections: |
As you may have noticed, the Debian archive is divided into multiple areas: |
| 1818 |
<literal>main</literal> (the free software), <literal>non-free</literal> (the |
<literal>main</literal> (the free software), <literal>non-free</literal> (the |
| 1819 |
not really free software) and <literal>contrib</literal> (free software that |
not really free software) and <literal>contrib</literal> (free software that |
| 1820 |
depends on non-free software). Under those, there are logical subsections that |
depends on non-free software). Each of these is divided into sections that |
| 1821 |
describe in short what packages are in. So we have <literal>admin</literal> |
classify packages into rough categories. So we have <literal>admin</literal> |
| 1822 |
for administrator-only programs, <literal>base</literal> for the basic tools, |
for administrator-only programs, |
| 1823 |
<literal>devel</literal> for programmer tools, <literal>doc</literal> for |
<literal>devel</literal> for programmer tools, <literal>doc</literal> for |
| 1824 |
documentation, <literal>libs</literal> for libraries, <literal>mail</literal> |
documentation, <literal>libs</literal> for libraries, <literal>mail</literal> |
| 1825 |
for e-mail readers and daemons, <literal>net</literal> for network apps and |
for email readers and daemons, <literal>net</literal> for network apps and |
| 1826 |
daemons, <literal>x11</literal> for X11 programs that don't fit anywhere else, |
daemons, <literal>x11</literal> for X11 programs that don't fit anywhere else, |
| 1827 |
and many more. |
and many more. |
| 1828 |
<footnote> <para>See |
<footnote> <para>See |
| 1845 |
<listitem> |
<listitem> |
| 1846 |
<para> |
<para> |
| 1847 |
The <literal>optional</literal> priority will usually work for new packages |
The <literal>optional</literal> priority will usually work for new packages |
| 1848 |
that do not conflict with others with <literal>required</literal>, |
that do not conflict with others claiming <literal>required</literal>, |
| 1849 |
<literal>important</literal> or <literal>standard</literal> priorities. |
<literal>important</literal>, or <literal>standard</literal> priority. |
| 1850 |
</para> |
</para> |
| 1851 |
</listitem> |
</listitem> |
| 1852 |
<listitem> |
<listitem> |
| 1857 |
</listitem> |
</listitem> |
| 1858 |
</itemizedlist> |
</itemizedlist> |
| 1859 |
<para> |
<para> |
| 1860 |
Section and priority are used by the frontends like <command>aptitude</command> |
Section and priority are used by front-ends like <command>aptitude</command> |
| 1861 |
when they sort packages and select defaults. Once you upload the package to |
when they sort packages and select defaults. Once you upload the package to |
| 1862 |
Debian, the value of these two fields can be overridden by the archive |
Debian, the value of these two fields can be overridden by the archive |
| 1863 |
maintainers, in which case you will be notified by email. |
maintainers, in which case you will be notified by email. |
| 1868 |
</para> |
</para> |
| 1869 |
<para> |
<para> |
| 1870 |
Line 4 is the name and email address of the maintainer. Make sure that this |
Line 4 is the name and email address of the maintainer. Make sure that this |
| 1871 |
field includes a valid <literal>To</literal> header for an email, because after |
field includes a valid <literal>To</literal> header for email, because after |
| 1872 |
you upload it, the bug tracking system will use it to deliver bug emails to |
you upload it, the bug tracking system will use it to deliver bug emails to |
| 1873 |
you. Avoid using commas, ampersands and parenthesis. |
you. Avoid using commas, ampersands, or parentheses. |
| 1874 |
</para> |
</para> |
| 1875 |
<para> |
<para> |
| 1876 |
The 5th line includes the list of packages required to build your package as |
Line 5 includes the list of packages required to build your package as |
| 1877 |
the <literal>Build-Depends</literal> field. You can also have the |
the <literal>Build-Depends</literal> field. You can also have the |
| 1878 |
<literal>Build-Depends-Indep</literal> field as an additional line, here. |
<literal>Build-Depends-Indep</literal> field as an additional line, here. |
| 1879 |
<footnote><para>See |
<footnote><para>See |
| 1897 |
</listitem> |
</listitem> |
| 1898 |
<listitem> |
<listitem> |
| 1899 |
<para> |
<para> |
| 1900 |
For source packages which have some binary packages with <literal>Architecture: |
Source packages which have binary packages with <literal>Architecture: |
| 1901 |
any</literal>, they are rebuild by the autobuilder. Since this autobuilder |
any</literal> are rebuilt by the autobuilder. Since this autobuilder |
| 1902 |
procedure runs <literal>debian/rules build</literal> in it while installing |
procedure installs only the packages listed in the |
| 1903 |
only packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="autobuilder"/>), the <literal>Build-Depends</literal> field needs to |
<literal>Build-Depends</literal> field before running |
| 1904 |
list practically all the required packages and the |
<literal>debian/rules build</literal> (see <xref |
| 1905 |
<literal>Build-Depends-indep</literal> is rarely used. |
linkend="autobuilder"/>), the <literal>Build-Depends</literal> field |
| 1906 |
|
needs to list practically all the required packages and |
| 1907 |
|
<literal>Build-Depends-Indep</literal> is rarely used. |
| 1908 |
</para> |
</para> |
| 1909 |
</listitem> |
</listitem> |
| 1910 |
<listitem> |
<listitem> |
| 1911 |
<para> |
<para> |
| 1912 |
For source packages which have binary packages only with <literal>Architecture: |
For source packages with binary packages all of which are <literal>Architecture: |
| 1913 |
all</literal>, the <literal>Build-Depends-Indep</literal> field may list all |
all</literal>, the <literal>Build-Depends-Indep</literal> field may list all |
| 1914 |
the required packages unless they are already listed in the |
the required packages unless they are already listed in the |
| 1915 |
<literal>Build-Depends</literal> field to satisfy the Debian Policy requirement |
<literal>Build-Depends</literal> field to satisfy the Debian Policy requirement |
| 1922 |
<literal>Build-Depends</literal> field to be on the safe side. |
<literal>Build-Depends</literal> field to be on the safe side. |
| 1923 |
<footnote><para> This somewhat strange situation is a feature well documented |
<footnote><para> This somewhat strange situation is a feature well documented |
| 1924 |
in the <ulink url="&policy-build-depends-indep;">Debian Policy |
in the <ulink url="&policy-build-depends-indep;">Debian Policy |
| 1925 |
Manual, Footnotes 48</ulink>. This is not due to the use of the |
Manual, Footnotes 55</ulink>. This is not due to the use of the |
| 1926 |
<command>dh</command> command in the <filename>debian/rules</filename> file but |
<command>dh</command> command in the <filename>debian/rules</filename> file but |
| 1927 |
due to how the <command>dpkg-buildpackage</command> works. The same situation |
due to how the <command>dpkg-buildpackage</command> works. The same situation |
| 1928 |
applies to the <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">auto build system |
applies to the <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">auto build system |
| 1935 |
$ dpkg-depcheck -d ./configure |
$ dpkg-depcheck -d ./configure |
| 1936 |
</screen> |
</screen> |
| 1937 |
<para> |
<para> |
| 1938 |
To manually find exact build dependency for |
To manually find exact build dependencies for |
| 1939 |
<command><replaceable>/usr/bin/foo</replaceable></command>, you execute |
<command><replaceable>/usr/bin/foo</replaceable></command>, execute |
| 1940 |
</para> |
</para> |
| 1941 |
<screen> |
<screen> |
| 1942 |
$ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED |
$ objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED |
| 1948 |
$ dpkg -S libfoo.so.6 |
$ dpkg -S libfoo.so.6 |
| 1949 |
</screen> |
</screen> |
| 1950 |
<para> |
<para> |
| 1951 |
Then you just take <literal>-dev</literal> version of every package as |
Then just take the <literal>-dev</literal> version of every package as a |
| 1952 |
<literal>Build-Depends</literal> entry. If you use <command>ldd</command> for |
<literal>Build-Depends</literal> entry. If you use <command>ldd</command> for |
| 1953 |
this purpose, it will report indirect lib dependencies as well, resulting in |
this purpose, it will report indirect lib dependencies as well, resulting in |
| 1954 |
the problem of excessive build dependencies. |
the problem of excessive build dependencies. |
| 1964 |
your package. |
your package. |
| 1965 |
</para> |
</para> |
| 1966 |
<para> |
<para> |
| 1967 |
On line 7 you can put the URL of the homepage for the upstream program. |
On line 7 you can put the URL of the software's upstream homepage. |
| 1968 |
</para> |
</para> |
| 1969 |
<para> |
<para> |
| 1970 |
Line 9 is the name of the binary package. This is usually the same as the name |
Line 9 is the name of the binary package. This is usually the same as the name |
| 1971 |
of the source package, but it doesn't necessarily have to be that way. |
of the source package, but it doesn't necessarily have to be that way. |
| 1972 |
</para> |
</para> |
| 1973 |
<para> |
<para> |
| 1974 |
Line 10 describes the CPU architecture the binary package can be compiled for. |
Line 10 describes the architectures the binary package can be compiled for. |
| 1975 |
We'll leave this as <literal>any</literal> because <citerefentry> |
This value is usually one of the following depending |
| 1976 |
<refentrytitle>dpkg-gencontrol</refentrytitle> <manvolnum>1</manvolnum> |
on the type of the binary package. |
| 1977 |
</citerefentry> will fill in the appropriate value for any machine this package |
<footnote><para>See |
| 1978 |
gets compiled on. |
<ulink url="&policy-architecture;">Debian Policy Manual 5.6.8 "Architecture"</ulink> |
| 1979 |
|
for exact details. |
| 1980 |
|
</para></footnote> |
| 1981 |
|
</para> |
| 1982 |
|
<itemizedlist> |
| 1983 |
|
<listitem><para><literal>Architecture: any</literal></para> |
| 1984 |
|
<itemizedlist> |
| 1985 |
|
<listitem><para>The generated binary package is an architecture dependent one |
| 1986 |
|
usually in a compiled language.</para></listitem> |
| 1987 |
|
</itemizedlist> |
| 1988 |
|
</listitem> |
| 1989 |
|
<listitem><para><literal>Architecture: all</literal></para> |
| 1990 |
|
<itemizedlist> |
| 1991 |
|
<listitem><para>The generated binary package is an architecture independent |
| 1992 |
|
one usually consisting of text, images, or scripts in an interpreted |
| 1993 |
|
language.</para></listitem> |
| 1994 |
|
</itemizedlist> |
| 1995 |
|
</listitem> |
| 1996 |
|
</itemizedlist> |
| 1997 |
|
<para> |
| 1998 |
|
We leave line 10 as is since this is written in C. |
| 1999 |
|
<citerefentry><refentrytitle>dpkg-gencontrol</refentrytitle><manvolnum>1</manvolnum></citerefentry> |
| 2000 |
|
will fill in the appropriate architecture value for any machine this source |
| 2001 |
|
package gets compiled on. |
| 2002 |
</para> |
</para> |
| 2003 |
<para> |
<para> |
| 2004 |
If your package is architecture independent (for example, a shell or Perl |
If your package is architecture independent (for example, a shell or Perl |
| 2017 |
</para> |
</para> |
| 2018 |
<para> |
<para> |
| 2019 |
The package management tools usually behave the same way when dealing with |
The package management tools usually behave the same way when dealing with |
| 2020 |
these relations; if not, it will be explained. (see <citerefentry> |
these relations; if not, it will be explained. (See <citerefentry> |
| 2021 |
<refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, |
<refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, |
| 2022 |
<citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum> |
<citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum> |
| 2023 |
</citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle> |
</citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle> |
| 2024 |
<manvolnum>8</manvolnum> </citerefentry>, <citerefentry> |
<manvolnum>8</manvolnum> </citerefentry>, <citerefentry> |
| 2025 |
<refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum> |
<refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum> |
| 2026 |
</citerefentry> etc.) |
</citerefentry>, etc.) |
| 2027 |
</para> |
</para> |
| 2028 |
<para> |
<para> |
| 2029 |
Here is a simplified description of package relationships. |
Here is a simplified description of package relationships. |
| 2048 |
</para> |
</para> |
| 2049 |
<para> |
<para> |
| 2050 |
Use this for packages that are not strictly necessary but are typically used |
Use this for packages that are not strictly necessary but are typically used |
| 2051 |
with your program. When a user installs your program, all frontends will |
with your program. When a user installs your program, all front-ends will |
| 2052 |
likely prompt them to install the recommended packages. |
probably prompt them to install the recommended packages. |
| 2053 |
<command>aptitude</command> and <command>apt-get</command> install recommended |
<command>aptitude</command> and <command>apt-get</command> install recommended |
| 2054 |
packages along with your package (but the user can disable this default |
packages along with your package by default (but the user can disable this |
| 2055 |
behaviour). <command>dpkg</command> will ignore this field. |
behavior). <command>dpkg</command> will ignore this field. |
| 2056 |
</para> |
</para> |
| 2057 |
</listitem> |
</listitem> |
| 2058 |
<listitem> |
<listitem> |
| 2061 |
</para> |
</para> |
| 2062 |
<para> |
<para> |
| 2063 |
Use this for packages which will work nicely with your program but are not at |
Use this for packages which will work nicely with your program but are not at |
| 2064 |
all necessary. When a user installs your program, all frontends will likely |
all necessary. When a user installs your program, they will probably not be |
| 2065 |
prompt them to install the suggested packages. <command>aptitude</command> can |
prompted to install suggested packages. <command>aptitude</command> can |
| 2066 |
be configured to install suggested packages along with your package but this is |
be configured to install suggested packages along with your package but this is |
| 2067 |
not its default. <command>dpkg</command> and <command>apt-get</command> will |
not its default. <command>dpkg</command> and <command>apt-get</command> will |
| 2068 |
ignore this field. |
ignore this field. |
| 2095 |
<literal>Breaks</literal> |
<literal>Breaks</literal> |
| 2096 |
</para> |
</para> |
| 2097 |
<para> |
<para> |
| 2098 |
The package will be installed while all the listed packages will be broken. |
When installed the package will break all the listed packages. |
| 2099 |
Normally a <literal>Breaks</literal> entry has an earlier than version clause. |
Normally a <literal>Breaks</literal> entry specifies that it applies to versions earlier than a certain value. |
| 2100 |
The resolution is generally to upgrade the listed packages by the higher-level |
The resolution is generally to use higher-level package management tools to upgrade the listed packages. |
|
package management tools. |
|
| 2101 |
</para> |
</para> |
| 2102 |
</listitem> |
</listitem> |
| 2103 |
<listitem> |
<listitem> |
| 2132 |
</para> |
</para> |
| 2133 |
<para> |
<para> |
| 2134 |
The fields may restrict their applicability to particular versions of each |
The fields may restrict their applicability to particular versions of each |
| 2135 |
named package. These versions are listed in parentheses after each individual |
named package. The restriction of each individual package is listed in |
| 2136 |
package name, and they should contain a relation from the list below followed |
parentheses after its name, and should contain a relation from the list below |
| 2137 |
by the version number. The relations allowed are: <literal><<</literal>, |
followed by a version number value. |
| 2138 |
<literal><=</literal>, <literal>=</literal>, <literal>>=</literal> and |
The relations allowed are: <literal><<</literal>, |
| 2139 |
|
<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, |
| 2142 |
</para> |
</para> |
| 2143 |
<screen> |
<screen> |
| 2144 |
Depends: foo (>= 1.2), libbar1 (= 1.3.4) |
Depends: foo (>= 1.2), libbar1 (= 1.3.4) |
| 2155 |
<para> |
<para> |
| 2156 |
<citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle> |
<citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle> |
| 2157 |
<manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies |
<manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies |
| 2158 |
for binary packages. It generates a list of ELF executables and shared |
for binary packages. It generates a list of <ulink url="&elf;">ELF</ulink> executables and shared |
| 2159 |
libraries it has found for each binary package. Such list is used for |
libraries it has found for each binary package. This list is used for |
| 2160 |
substituting <literal>${shlibs:Depends}</literal>. |
substituting <literal>${shlibs:Depends}</literal>. |
| 2161 |
</para> |
</para> |
| 2162 |
<para> |
<para> |
| 2163 |
<citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum> |
<citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum> |
| 2164 |
</citerefentry> calculates Perl dependencies. It generates a list of a |
</citerefentry> calculates Perl dependencies. It generates a list of a |
| 2165 |
dependency on <literal>perl</literal> or <literal>perlapi</literal> for each binary package. Such list is used for |
dependencies on <literal>perl</literal> or <literal>perlapi</literal> for each binary package. This list is used for |
| 2166 |
substituting <literal>${perl:Depends}</literal>. |
substituting <literal>${perl:Depends}</literal>. |
| 2167 |
</para> |
</para> |
| 2168 |
<para> |
<para> |
| 2169 |
Some <systemitem role="package">debhelper</systemitem> commands may make the |
Some <systemitem role="package">debhelper</systemitem> commands may cause the |
| 2170 |
generated package need to depend on some other packages. All such commands |
generated package to depend on some additional packages. All such commands |
| 2171 |
generate a list of required packages for each binary package. |
generate a list of required packages for each binary package. |
| 2172 |
Such list is used for substituting <literal>${misc:Depends}</literal>. |
This list is used for substituting <literal>${misc:Depends}</literal>. |
| 2173 |
</para> |
</para> |
| 2174 |
<para> |
<para> |
| 2175 |
<citerefentry> <refentrytitle>dh_gencontrol</refentrytitle> |
<citerefentry> <refentrytitle>dh_gencontrol</refentrytitle> |
| 2182 |
Having said all that, we can leave the <literal>Depends</literal> field exactly |
Having said all that, we can leave the <literal>Depends</literal> field exactly |
| 2183 |
as it is now, and insert another line after it saying <literal>Suggests: |
as it is now, and insert another line after it saying <literal>Suggests: |
| 2184 |
file</literal>, because <systemitem role="package">gentoo</systemitem> can use |
file</literal>, because <systemitem role="package">gentoo</systemitem> can use |
| 2185 |
some features provided by that <systemitem role="package">file</systemitem> |
some features provided by the <systemitem role="package">file</systemitem> |
| 2186 |
package. |
package. |
| 2187 |
</para> |
</para> |
| 2188 |
<para> Line 9 is the Homepage URL. Let's assume this to be at |
<para> Line 9 is the Homepage URL. Let's assume this to be at |
| 2189 |
<ulink url="&gentoo;"/>. |
<ulink url="&gentoo;"/>. |
| 2190 |
</para> |
</para> |
| 2191 |
<para> |
<para> |
| 2192 |
Line 12 is the short description. Most people screens are 80 columns wide so |
Line 12 is the short description. Terminals are conventionally 80 columns wide so |
| 2193 |
this shouldn't be longer than about 60 characters. I'll change it to |
this shouldn't be longer than about 60 characters. I'll change it to |
| 2194 |
<literal>fully GUI-configurable, two-pane X file manager</literal>. |
<literal>fully GUI-configurable, two-pane X file manager</literal>. |
| 2195 |
</para> |
</para> |
| 2203 |
<ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote> |
<ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.</para></footnote> |
| 2204 |
</para> |
</para> |
| 2205 |
<para> |
<para> |
| 2206 |
Let's insert <literal>Vcs-*</literal> fields to document the Version Control |
We can insert <literal>Vcs-*</literal> fields to document the Version Control |
| 2207 |
System (VCS) location between line 6 and 7. |
System (VCS) location between lines 6 and 7. |
| 2208 |
<footnote><para>See |
<footnote><para>See |
| 2209 |
<ulink url="&devref-bpp-vcs;">Debian Developer's Reference, 6.2.5. "Version Control System location"</ulink>. |
<ulink url="&devref-bpp-vcs;">Debian Developer's Reference, 6.2.5. "Version Control System location"</ulink>. |
| 2210 |
</para></footnote> |
</para></footnote> |
| 2211 |
Let's assume that the <systemitem role="package">gentoo</systemitem> |
Let's assume that the <systemitem role="package">gentoo</systemitem> |
| 2212 |
package has its VCS located in Debian Alioth Git Service at |
package has its VCS located in the Debian Alioth Git Service at |
| 2213 |
<literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>. |
<literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>. |
| 2214 |
</para> |
</para> |
| 2215 |
<para> |
<para> |
| 2237 |
19 they're fairly easy to work with since they are written in an XML format. |
19 they're fairly easy to work with since they are written in an XML format. |
| 2238 |
20 . |
20 . |
| 2239 |
21 gentoo features a fairly complex and powerful file identification system, |
21 gentoo features a fairly complex and powerful file identification system, |
| 2240 |
22 coupled to a object-oriented style system, which together give you a lot |
22 coupled to an object-oriented style system, which together give you a lot |
| 2241 |
23 of control over how files of different types are displayed and acted upon. |
23 of control over how files of different types are displayed and acted upon. |
| 2242 |
24 Additionally, over a hundred pixmap images are available for use in file |
24 Additionally, over a hundred pixmap images are available for use in file |
| 2243 |
25 type descriptions. |
25 type descriptions. |
| 2244 |
26 . |
26 . |
| 2245 |
29 gentoo was written from scratch in ANSI C, and it utilises the GTK+ toolkit |
29 gentoo was written from scratch in ANSI C, and it utilizes the GTK+ toolkit |
| 2246 |
30 for its interface. |
30 for its interface. |
| 2247 |
</screen> |
</screen> |
| 2248 |
<para> |
<para> |
| 2249 |
(I've added the line numbers.) |
(I've added the line numbers.) |
| 2250 |
</para> |
</para> |
| 2251 |
</section> |
</section> |
| 2252 |
<section id="copyright"><title><filename>copyright</filename> file</title> |
<section id="copyright"><title><filename>copyright</filename></title> |
| 2253 |
<para> |
<para> |
| 2254 |
This file contains the information about package upstream resources, copyright |
This file contains information about the copyright and license of the upstream sources. |
| 2255 |
and license information. |
<ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink> |
| 2256 |
<ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink> |
dictates its content and |
| 2257 |
dictates its content and |
<ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink> |
|
<ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink> |
|
| 2258 |
provides guidelines for its format. |
provides guidelines for its format. |
| 2259 |
</para> |
</para> |
| 2260 |
<para> |
<para> |
| 2263 |
gpl2</literal> option here to get a template file for the <systemitem role="package">gentoo</systemitem> package released under GPL-2. |
gpl2</literal> option here to get a template file for the <systemitem role="package">gentoo</systemitem> package released under GPL-2. |
| 2264 |
</para> |
</para> |
| 2265 |
<para> |
<para> |
| 2266 |
You must fill in missing information such as the place you got the package |
You must fill in missing information to complete this file, such as the place you got the package |
| 2267 |
from, the actual copyright notice and their license to complete this file. For |
from, the actual copyright notice, and the license. For certain |
| 2268 |
the common free software licenses such as GNU GPL-1, GNU GPL-2, GNU GPL-3, |
common free software licenses (GNU GPL-1, GNU GPL-2, GNU GPL-3, |
| 2269 |
LGPL-2, LGPL-2.1, LGPL-3, GNU FDL-1.2, GNU FDL-1.3, Apache-2.0 or the Artistic |
LGPL-2, LGPL-2.1, LGPL-3, GNU FDL-1.2, GNU FDL-1.3, Apache-2.0, or the Artistic |
| 2270 |
license, you can just refer to the appropriate file in |
license), you can just refer to the appropriate file in the |
| 2271 |
<filename>/usr/share/common-licenses/</filename> directory that exists on every |
<filename>/usr/share/common-licenses/</filename> directory that exists on every |
| 2272 |
Debian system. Otherwise, you must include the complete license. |
Debian system. Otherwise, you must include the complete license. |
| 2273 |
</para> |
</para> |
| 2274 |
<para> |
<para> |
| 2275 |
In short, here's how <systemitem role="package">gentoo</systemitem>'s |
In short, here's what <systemitem role="package">gentoo</systemitem>'s |
| 2276 |
<filename>copyright</filename> file should look like: |
<filename>copyright</filename> file should look like: |
| 2277 |
</para> |
</para> |
| 2278 |
<screen> |
<screen> |
| 2302 |
24 but WITHOUT ANY WARRANTY; without even the implied warranty of |
24 but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 2303 |
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
25 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 2304 |
26 GNU General Public License for more details. |
26 GNU General Public License for more details. |
| 2305 |
27 . |
27 . |
| 2306 |
28 You should have received a copy of the GNU General Public License along |
28 You should have received a copy of the GNU General Public License along |
| 2307 |
29 with this program; if not, write to the Free Software Foundation, Inc., |
29 with this program; if not, write to the Free Software Foundation, Inc., |
| 2308 |
30 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
30 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 2315 |
(I've added the line numbers.) |
(I've added the line numbers.) |
| 2316 |
</para> |
</para> |
| 2317 |
<para> |
<para> |
| 2318 |
Please follow the HOWTO provided by ftpmasters and sent to |
Please follow the HOWTO provided by the ftpmasters and sent to |
| 2319 |
debian-devel-announce: <ulink url="&howto-copyright;"/>. |
debian-devel-announce: <ulink url="&howto-copyright;"/>. |
| 2320 |
</para> |
</para> |
| 2321 |
</section> |
</section> |
| 2322 |
<section id="changelog"><title><filename>changelog</filename> file</title> |
<section id="changelog"><title><filename>changelog</filename></title> |
| 2323 |
<para> |
<para> |
| 2324 |
This is a required file, which has a special format described in the |
This is a required file, which has a special format described in |
| 2325 |
<ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>. |
<ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>. |
| 2326 |
This format is used by <command>dpkg</command> and other programs to obtain the |
This format is used by <command>dpkg</command> and other programs to obtain the |
| 2327 |
version number, revision, distribution and urgency of your package. |
version number, revision, distribution, and urgency of your package. |
| 2328 |
</para> |
</para> |
| 2329 |
<para> |
<para> |
| 2330 |
For you, it is also important, since it is good to have documented all changes |
For you, it is also important, since it is good to have documented all changes |
| 2334 |
binary package. |
binary package. |
| 2335 |
</para> |
</para> |
| 2336 |
<para> |
<para> |
| 2337 |
<command>dh_make</command> created a default one, and this is how it looks |
<command>dh_make</command> created a default one, and this is what it looks |
| 2338 |
like: |
like: |
| 2339 |
</para> |
</para> |
| 2340 |
<screen> |
<screen> |
| 2350 |
</para> |
</para> |
| 2351 |
<para> |
<para> |
| 2352 |
Line 1 is the package name, version, distribution, and urgency. The name must |
Line 1 is the package name, version, distribution, and urgency. The name must |
| 2353 |
match the source package name, distribution should be either |
match the source package name; distribution should be |
| 2354 |
<literal>unstable</literal> (or even <literal>experimental</literal>) |
<literal>unstable</literal> (or even <literal>experimental</literal>) |
| 2355 |
<footnote><para> Some people use invalid distribution values such as |
<footnote><para> Some people use invalid distribution values such as |
| 2356 |
<literal>UNRELEASED</literal> to prevent a package to be accidentally uploaded |
<literal>UNRELEASED</literal> to prevent a package being accidentally uploaded |
| 2357 |
when updating a package in a shared VCS. </para> </footnote>, and urgency |
when updating a package in a shared VCS. </para> </footnote>, and urgency |
| 2358 |
shouldn't be changed to anything higher than <literal>low</literal>. :-) |
shouldn't be changed to anything higher than <literal>low</literal>. :-) |
| 2359 |
</para> |
</para> |
| 2360 |
<para> |
<para> |
| 2361 |
Lines 3-5 are a log entry, where you document changes made in this package |
Lines 3-5 are a log entry, where you document changes made in this package |
| 2362 |
revision (not the upstream changes - there is special file for that purpose, |
revision (not the upstream changes - there is a special file for that purpose, |
| 2363 |
created by the upstream authors, which you will later install as |
created by the upstream authors, which you will later install as |
| 2364 |
<filename>/usr/share/doc/gentoo/changelog.gz</filename>). Let's assume your |
<filename>/usr/share/doc/gentoo/changelog.gz</filename>). Let's assume your |
| 2365 |
ITP (Intent To Package) bug report number was <literal>12345</literal>. New |
ITP (Intent To Package) bug report number was <literal>12345</literal>. New |
| 2366 |
lines must be inserted just before the uppermost line that begins with |
lines must be inserted just below the uppermost line that begins with |
| 2367 |
<literal>*</literal> (asterisk). You can do it with <citerefentry> |
<literal>*</literal> (asterisk). You can do it with <citerefentry> |
| 2368 |
<refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or |
<refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or |
| 2369 |
manually with a text editor. |
manually with a text editor. |
| 2389 |
in <xref linkend="update"/>. |
in <xref linkend="update"/>. |
| 2390 |
</para> |
</para> |
| 2391 |
</section> |
</section> |
| 2392 |
<section id="rules"><title><filename>rules</filename> file</title> |
<section id="rules"><title><filename>rules</filename></title> |
| 2393 |
<para> |
<para> |
| 2394 |
Now we need to take a look at the exact rules which <citerefentry> |
Now we need to take a look at the exact rules which <citerefentry> |
| 2395 |
<refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum> |
<refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum> |
| 2396 |
</citerefentry> will use to actually create the package. This file is actually |
</citerefentry> will use to actually create the package. This file is in fact |
| 2397 |
another <filename>Makefile</filename>, but different from the one(s) in the |
another <filename>Makefile</filename>, but different from the one(s) in the |
| 2398 |
upstream source. Unlike other files in <filename>debian</filename>, this one |
upstream source. Unlike other files in <filename>debian</filename>, this one |
| 2399 |
is marked as executable. |
is marked as executable. |
| 2400 |
</para> |
</para> |
| 2401 |
<section id="targets"><title>Targets of <filename>rules</filename> file</title> |
<section id="targets"><title>Targets of the <filename>rules</filename> file</title> |
| 2402 |
<para> |
<para> |
| 2403 |
Every <filename>rules</filename> file, as any other |
Every <filename>rules</filename> file, like any other |
| 2404 |
<filename>Makefile</filename>, consists of several targets and their rules |
<filename>Makefile</filename>, consists of several rules, each of |
| 2405 |
specifying how to handle the source. <ulink url="&policy-debianrules;">Debian |
which defines a target and how it is carried out. |
| 2406 |
Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains its |
<footnote><para>You can start learning how to write <filename>Makefile</filename> from |
| 2407 |
details. |
<ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>. |
| 2408 |
|
The full documentation is available as |
| 2409 |
|
<ulink url="&gnu-make;"></ulink> or as the |
| 2410 |
|
<systemitem role="package">make-doc</systemitem> package in the <literal>non-free</literal> archive area. |
| 2411 |
|
</para></footnote> |
| 2412 |
|
A new rule begins with its target declaration in the first column. The |
| 2413 |
|
following lines beginning with the TAB code (ASCII 9) specify the recipe for |
| 2414 |
|
carrying out that target. |
| 2415 |
|
Empty lines and lines beginning with <literal>#</literal> (hash) are treated as |
| 2416 |
|
comments and ignored. |
| 2417 |
|
<footnote><para><ulink url="&policy-debianrules;">Debian |
| 2418 |
|
Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains the |
| 2419 |
|
details.</para></footnote> |
| 2420 |
|
</para> |
| 2421 |
|
<para> |
| 2422 |
|
A rule that you want to execute is invoked by its target name as a command line argument. For |
| 2423 |
|
example, <literal>debian/rules <replaceable>build</replaceable></literal> and |
| 2424 |
|
<literal>fakeroot make -f debian/rules <replaceable>binary</replaceable></literal> |
| 2425 |
|
execute rules for <literal><replaceable>build</replaceable></literal> and |
| 2426 |
|
<literal><replaceable>binary</replaceable></literal> targets respectively. |
| 2427 |
</para> |
</para> |
| 2428 |
<para> |
<para> |
| 2429 |
The simplified explanation of targets are the following. |
Here is a simplified explanation of the targets: |
| 2430 |
</para> |
</para> |
| 2431 |
<itemizedlist> |
<itemizedlist> |
| 2432 |
<listitem> |
<listitem> |
| 2433 |
<para> |
<para> |
| 2434 |
<literal>clean</literal> target: to clean all compiled, generated, and useless |
<literal>clean</literal> target: to clean all compiled, generated, and useless |
| 2435 |
files in the build-tree. (required) |
files in the build-tree. (Required) |
| 2436 |
</para> |
</para> |
| 2437 |
</listitem> |
</listitem> |
| 2438 |
<listitem> |
<listitem> |
| 2439 |
<para> |
<para> |
| 2440 |
<literal>build</literal> target: to build the source into compiled programs and |
<literal>build</literal> target: to build the source into compiled programs and |
| 2441 |
formatted documents in the build-tree. (required) |
formatted documents in the build-tree. (Required) |
| 2442 |
</para> |
</para> |
| 2443 |
</listitem> |
</listitem> |
| 2444 |
<listitem> |
<listitem> |
| 2446 |
<literal>install</literal> target: to install files into a file tree for each |
<literal>install</literal> target: to install files into a file tree for each |
| 2447 |
binary package under the <filename>debian</filename> directory. If defined, |
binary package under the <filename>debian</filename> directory. If defined, |
| 2448 |
<literal>binary*</literal> targets effectively depend on this target. |
<literal>binary*</literal> targets effectively depend on this target. |
| 2449 |
(optional) |
(Optional) |
| 2450 |
</para> |
</para> |
| 2451 |
</listitem> |
</listitem> |
| 2452 |
<listitem> |
<listitem> |
| 2453 |
<para> |
<para> |
| 2454 |
<literal>binary</literal> target: to create all binary packages (effectively |
<literal>binary</literal> target: to create all binary packages (effectively |
| 2455 |
combination of <literal>binary-arch</literal> and |
a combination of <literal>binary-arch</literal> and |
| 2456 |
<literal>binary-indep</literal> targets). (required)<footnote><para> This |
<literal>binary-indep</literal> targets). (Required)<footnote><para> This |
| 2457 |
target is used by <literal>dpkg-buildpackage</literal> as in <xref linkend="completebuild"/>. </para> </footnote> |
target is used by <literal>dpkg-buildpackage</literal> as in <xref linkend="completebuild"/>. </para> </footnote> |
| 2458 |
</para> |
</para> |
| 2459 |
</listitem> |
</listitem> |
| 2461 |
<para> |
<para> |
| 2462 |
<literal>binary-arch</literal> target: to create arch-dependent |
<literal>binary-arch</literal> target: to create arch-dependent |
| 2463 |
(<literal>Architecture: any</literal>) binary packages in the parent directory. |
(<literal>Architecture: any</literal>) binary packages in the parent directory. |
| 2464 |
(required)<footnote><para> This target is used by <literal>dpkg-buildpackage |
(Required)<footnote><para> This target is used by <literal>dpkg-buildpackage |
| 2465 |
-B</literal> as in <xref linkend="autobuilder"/>. </para> </footnote> |
-B</literal> as in <xref linkend="autobuilder"/>. </para> </footnote> |
| 2466 |
</para> |
</para> |
| 2467 |
</listitem> |
</listitem> |
| 2469 |
<para> |
<para> |
| 2470 |
<literal>binary-indep</literal> target: to create arch-independent |
<literal>binary-indep</literal> target: to create arch-independent |
| 2471 |
(<literal>Architecture: all</literal>) binary packages in the parent directory. |
(<literal>Architecture: all</literal>) binary packages in the parent directory. |
| 2472 |
(required)<footnote><para> This target is used by <literal>dpkg-buildpackage |
(Required)<footnote><para> This target is used by <literal>dpkg-buildpackage |
| 2473 |
-A</literal>. </para> </footnote> |
-A</literal>. </para> </footnote> |
| 2474 |
</para> |
</para> |
| 2475 |
</listitem> |
</listitem> |
| 2476 |
<listitem> |
<listitem> |
| 2477 |
<para> |
<para> |
| 2478 |
<literal>get-orig-source</literal> target: to obtain the most recent version of |
<literal>get-orig-source</literal> target: to obtain the most recent version of |
| 2479 |
the original source package from upstream archive site. (optional) |
the original source package from an upstream archive. (Optional) |
| 2480 |
</para> |
</para> |
| 2481 |
</listitem> |
</listitem> |
| 2482 |
</itemizedlist> |
</itemizedlist> |
| 2483 |
<para> |
<para> |
| 2484 |
Rules that you want to execute are invoked as command line arguments (for |
You are probably overwhelmed by now, but things are much simpler upon examination of the |
|
example, <literal>./debian/rules build</literal> or <literal>fakeroot make -f |
|
|
debian/rules binary</literal>). After the target name, you can name the |
|
|
dependency, program or file that the rule depends on. After that, there can be |
|
|
any number of commands, indented with |
|
|
<literal><replaceable>TAB</replaceable></literal>. A new rule begins with the |
|
|
target declaration in the first column. Empty lines and lines beginning with |
|
|
<literal>#</literal> (hash) are treated as comments and ignored. |
|
|
</para> |
|
|
<para> |
|
|
You are probably confused now, but it will all be clear upon examination of the |
|
| 2485 |
<filename>rules</filename> file that <command>dh_make</command> gives us as a |
<filename>rules</filename> file that <command>dh_make</command> gives us as a |
| 2486 |
default. You should also read <literal>info make</literal> for more |
default. |
|
information. |
|
| 2487 |
</para> |
</para> |
| 2488 |
</section> |
</section> |
| 2489 |
<section id="defaultrules"><title>Default <filename>rules</filename> file</title> |
<section id="defaultrules"><title>Default <filename>rules</filename> file</title> |
| 2508 |
</screen> |
</screen> |
| 2509 |
<para> |
<para> |
| 2510 |
(I've added the line numbers. In the actual <filename>rules</filename> file, |
(I've added the line numbers. In the actual <filename>rules</filename> file, |
| 2511 |
the leading white spaces are TAB codes.) |
the leading spaces are a TAB code.) |
| 2512 |
</para> |
</para> |
| 2513 |
<para> |
<para> |
| 2514 |
You are probably familiar with lines like line 1 from shell and Perl scripts. |
You are probably familiar with lines like line 1 from shell and Perl scripts. |
| 2516 |
<filename>/usr/bin/make</filename>. |
<filename>/usr/bin/make</filename>. |
| 2517 |
</para> |
</para> |
| 2518 |
<para> |
<para> |
| 2519 |
Line 11 can be uncommented to set <literal>DH_VERBOSE</literal> variable to 1. |
Line 10 can be uncommented to set the <literal>DH_VERBOSE</literal> variable to 1, |
| 2520 |
Then, the <command>dh</command> command will output which |
so that the <command>dh</command> command outputs which |
| 2521 |
<command>dh_*</command> commands are executed by the <command>dh</command> |
<command>dh_*</command> commands it is executing. |
| 2522 |
command. You can also add <literal>export DH_OPTIONS=-v</literal> line here. |
You can also add a line <literal>export DH_OPTIONS=-v</literal> here, |
| 2523 |
Then each <command>dh_*</command> command will output which commands are |
so that each <command>dh_*</command> command outputs which commands it |
| 2524 |
executed by each <command>dh_*</command> command. This helps you to understand |
is executing. This helps you to understand |
| 2525 |
what exactly is going on behind this simple <filename>rules</filename> file and |
exactly what is going on behind this simple <filename>rules</filename> file and |
| 2526 |
to debug its problems. This new <command>dh</command> is a core part of the |
to debug its problems. This new <command>dh</command> is designed to form a core part of the |
| 2527 |
<systemitem role="package">debhelper</systemitem> tools and does not hide |
<systemitem role="package">debhelper</systemitem> tools, and not to hide |
| 2528 |
anything from you. |
anything from you. |
| 2529 |
</para> |
</para> |
| 2530 |
<para> |
<para> |
| 2531 |
Lines 12 and 13 are where all the work is done. The percent sign means any |
Lines 12 and 13 are where all the work is done with an implicit rule using the pattern rule. The percent sign means "any |
| 2532 |
targets which then call a single program, <command>dh</command> with the target |
targets", which then call a single program, <command>dh</command>, with the target |
| 2533 |
name. <footnote><para> This uses the new <systemitem role="package">debhelper</systemitem> V7 features. Its design concepts are |
name. <footnote><para> This uses the new <systemitem role="package">debhelper</systemitem> v7 features. Its design concepts are |
| 2534 |
explained in <ulink url="&debhelper-slides;">Not Your |
explained in <ulink url="&debhelper-slides;">Not Your |
| 2535 |
Grandpa's Debhelper</ulink> presented at Debconf9 by the <systemitem role="package">debhelper</systemitem> upstream. Under |
Grandpa's Debhelper</ulink> presented at DebConf9 by the <systemitem role="package">debhelper</systemitem> upstream. Under |
| 2536 |
<literal>lenny</literal>, <command>dh_make</command> created a much more |
<literal>lenny</literal>, <command>dh_make</command> created a much more |
| 2537 |
complicated <filename>rules</filename> file with many <command>dh_*</command> |
complicated <filename>rules</filename> file with explicit rules |
| 2538 |
scripts listed for each required explicit targets and frozen them to the state |
and many <command>dh_*</command> scripts listed for each one, most of |
| 2539 |
when it was initially packaged. This new <command>dh</command> command is |
which are now unnecessary (and show the package's age). The new <command>dh</command> command is |
| 2540 |
simpler and frees us from this constrain. You still have full power to |
simpler and frees us from doing the routine work "manually". You still have full power to |
| 2541 |
customize this with <literal>override_dh_*</literal> targets. See <xref linkend="customrules"/>. It is based only on the <systemitem role="package">debhelper</systemitem> package and does not obfuscate the |
customize the process with <literal>override_dh_*</literal> targets. See <xref linkend="customrules"/>. It is based only on the <systemitem role="package">debhelper</systemitem> package and does not obfuscate the |
| 2542 |
package building process like the <systemitem role="package">cdbs</systemitem> |
package building process as the <systemitem role="package">cdbs</systemitem> |
| 2543 |
package. </para> </footnote> The <command>dh</command> command is a wrapper |
package tends to. </para> </footnote> The <command>dh</command> command is a wrapper |
| 2544 |
script which runs appropriate sequences of <command>dh_*</command> programs |
script which runs appropriate sequences of <command>dh_*</command> programs |
| 2545 |
depending on its argument. <footnote><para> You can verify actual sequences of |
depending on its argument. <footnote><para> You can verify the actual sequences of |
| 2546 |
<command>dh_*</command> programs invoked for a given |
<command>dh_*</command> programs invoked for a given |
| 2547 |
<literal><replaceable>target</replaceable></literal> as <literal>dh --no-act |
<literal><replaceable>target</replaceable></literal> without really running them by invoking <literal>dh --no-act |
| 2548 |
<replaceable>target</replaceable></literal> or <literal>debian/rules -- |
<replaceable>target</replaceable></literal> or <literal>debian/rules -- |
| 2549 |
'--no-act <replaceable>target</replaceable>'</literal> without really running |
'--no-act <replaceable>target</replaceable>'</literal>. </para> </footnote> |
|
them. </para> </footnote> |
|
| 2550 |
</para> |
</para> |
| 2551 |
<itemizedlist> |
<itemizedlist> |
| 2552 |
<listitem> |
<listitem> |
| 2553 |
<para> |
<para> |
| 2554 |
<literal>debian/rules clean</literal> runs <literal>dh clean</literal>; which |
<literal>debian/rules clean</literal> runs <literal>dh clean</literal>, which |
| 2555 |
in turn runs the following: |
in turn runs the following: |
| 2556 |
</para> |
</para> |
| 2557 |
<screen> |
<screen> |
| 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 |
| 2646 |
</listitem> |
</listitem> |
| 2647 |
</itemizedlist> |
</itemizedlist> |
| 2648 |
<para> |
<para> |
| 2649 |
The function of <command>dh_*</command> commands are almost self-evident from |
The functions of <command>dh_*</command> commands are largely self-evident from |
| 2650 |
their names. <footnote><para> For complete information on what do all these |
their names. <footnote><para> For complete information on what all these |
| 2651 |
<command>dh_*</command> scripts exactly do, and what their other options are, |
<command>dh_*</command> scripts do exactly, and what their other options are, |
| 2652 |
please read their respective manual pages and the <systemitem role="package">debhelper</systemitem> documentation. </para> </footnote> There |
please read their respective manual pages and the <systemitem role="package">debhelper</systemitem> documentation. </para> </footnote> There |
| 2653 |
are few notable ones worth making (over)simplified explanation here assuming |
are a few notable ones that are worth giving (over)simplified explanations here assuming |
| 2654 |
typical build environment based on <filename>Makefile</filename>. |
a typical build environment based on a <filename>Makefile</filename>. |
| 2655 |
<footnote><para> These commands support other build environments such as |
<footnote><para> These commands support other build environments such as |
| 2656 |
<filename>setup.py</filename> which can be listed by executing |
<filename>setup.py</filename> which can be listed by executing |
| 2657 |
<literal>dh_auto_build --list</literal> in a package source directory. </para> |
<literal>dh_auto_build --list</literal> in a package source directory. </para> |
| 2660 |
<itemizedlist> |
<itemizedlist> |
| 2661 |
<listitem> |
<listitem> |
| 2662 |
<para> |
<para> |
| 2663 |
<command>dh_auto_clean</command> usually executes the following if |
<command>dh_auto_clean</command> usually executes the following if a |
| 2664 |
<filename>Makefile</filename> exists with the <literal>distclean</literal> |
<filename>Makefile</filename> exists with the <literal>distclean</literal> |
| 2665 |
target. <footnote><para> It actually looks for the first available target of |
target. <footnote><para> It actually looks for the first available target |
| 2666 |
<literal>distclean</literal>, <literal>realclean</literal> or |
in the <filename>Makefile</filename> out of |
| 2667 |
<literal>clean</literal> in <filename>Makefile</filename> and execute it. |
<literal>distclean</literal>, <literal>realclean</literal>, or |
| 2668 |
|
<literal>clean</literal>, and executes that. |
| 2669 |
</para> </footnote> |
</para> </footnote> |
| 2670 |
</para> |
</para> |
| 2671 |
<screen> |
<screen> |
| 2693 |
</listitem> |
</listitem> |
| 2694 |
<listitem> |
<listitem> |
| 2695 |
<para> |
<para> |
| 2696 |
<command>dh_auto_test</command> usually executes the following if |
<command>dh_auto_test</command> usually executes the following if a |
| 2697 |
<filename>Makefile</filename> exists with the <literal>test</literal> target. |
<filename>Makefile</filename> exists with the <literal>test</literal> target. |
| 2698 |
<footnote><para> It actually looks for the first available target of |
<footnote><para> It actually looks for the first available target in |
| 2699 |
<literal>test</literal> or <literal>check</literal> in |
the <filename>Makefile</filename> out of <literal>test</literal> or |
| 2700 |
<filename>Makefile</filename> and execute it. </para> </footnote> |
<literal>check</literal>, and executes that.</para> </footnote> |
| 2701 |
</para> |
</para> |
| 2702 |
<screen> |
<screen> |
| 2703 |
make test |
make test |
| 2705 |
</listitem> |
</listitem> |
| 2706 |
<listitem> |
<listitem> |
| 2707 |
<para> |
<para> |
| 2708 |
<command>dh_auto_install</command> usually executes the following if |
<command>dh_auto_install</command> usually executes the following if a |
| 2709 |
<filename>Makefile</filename> exists with the <literal>install</literal> target |
<filename>Makefile</filename> exists with the <literal>install</literal> target |
| 2710 |
(line folded for readability). |
(line folded for readability). |
| 2711 |
</para> |
</para> |
| 2716 |
</listitem> |
</listitem> |
| 2717 |
</itemizedlist> |
</itemizedlist> |
| 2718 |
<para> |
<para> |
| 2719 |
Targets which require the <command>fakeroot</command> command contain |
All targets which require the <command>fakeroot</command> command will contain |
| 2720 |
<command>dh_testroot</command>. If you are not pretending to be root using |
<command>dh_testroot</command>, which exits with an error if you are not |
| 2721 |
this command, it exits with an error. |
using this command to pretend to be root. |
| 2722 |
</para> |
</para> |
| 2723 |
<para> |
<para> |
| 2724 |
The important part to know about the <filename>rules</filename> file created by |
The important part to know about the <filename>rules</filename> file created by |
| 2725 |
<command>dh_make</command>, is that it is just a suggestion. It will work for |
<command>dh_make</command> is that it is just a suggestion. It will work for |
| 2726 |
most packages but for more complicated ones, don't be afraid to customize it to |
most packages but for more complicated ones, don't be afraid to customize it to |
| 2727 |
fit your needs. Only things that you must not change are the names of the |
fit your needs. |
|
rules, because all the tools use these names, as mandated by the Debian Policy. |
|
| 2728 |
</para> |
</para> |
| 2729 |
<para> |
<para> |
| 2730 |
Although <literal>install</literal> is not required target, it is supported. |
Although <literal>install</literal> is not a required target, it is supported. |
| 2731 |
<literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh |
<literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh |
| 2732 |
binary</literal> but stops after <command>dh_fixperms</command>. |
binary</literal> but stops after <command>dh_fixperms</command>. |
| 2733 |
</para> |
</para> |
| 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 of 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> |
| 2781 |
<para> |
<para> |
| 2782 |
Install the <systemitem role="package">python-support</systemitem> package in |
Include the <systemitem role="package">python-support</systemitem> package in |
| 2783 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2784 |
</para> |
</para> |
| 2785 |
</listitem> |
</listitem> |
| 2786 |
<listitem> |
<listitem> |
| 2787 |
<para> |
<para> |
| 2788 |
Use <literal>dh $@</literal> as usual. (This is enabled by 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 of the <command>dh_pycentral</command> command. |
Add support for the <command>dh_pycentral</command> command. (deprecated) |
| 2801 |
</para> |
</para> |
| 2802 |
<itemizedlist> |
<itemizedlist> |
| 2803 |
<listitem> |
<listitem> |
| 2804 |
<para> |
<para> |
| 2805 |
Install the <systemitem role="package">python-central</systemitem> package in |
Include the <systemitem role="package">python-central</systemitem> package in |
| 2806 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2807 |
</para> |
</para> |
| 2808 |
</listitem> |
</listitem> |
| 2809 |
<listitem> |
<listitem> |
| 2810 |
<para> |
<para> |
| 2811 |
Use <literal>dh --with python-central $@</literal> instead. |
Use <literal>dh $@ --with python-central</literal> instead. |
| 2812 |
</para> |
</para> |
| 2813 |
</listitem> |
</listitem> |
| 2814 |
<listitem> |
<listitem> |
| 2825 |
</listitem> |
</listitem> |
| 2826 |
<listitem> |
<listitem> |
| 2827 |
<para> |
<para> |
| 2828 |
Add support of the <command>dh_installtex</command> command. |
Add support for the <command>dh_installtex</command> command. |
| 2829 |
</para> |
</para> |
| 2830 |
<itemizedlist> |
<itemizedlist> |
| 2831 |
<listitem> |
<listitem> |
| 2832 |
<para> |
<para> |
| 2833 |
Install the <systemitem role="package">tex-common</systemitem> package in |
Include the <systemitem role="package">tex-common</systemitem> package in |
| 2834 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2835 |
</para> |
</para> |
| 2836 |
</listitem> |
</listitem> |
| 2837 |
<listitem> |
<listitem> |
| 2838 |
<para> |
<para> |
| 2839 |
Use <literal>dh --with tex $@</literal> instead. |
Use <literal>dh $@ --with tex</literal> instead. |
| 2840 |
</para> |
</para> |
| 2841 |
</listitem> |
</listitem> |
| 2842 |
<listitem> |
<listitem> |
| 2843 |
<para> |
<para> |
| 2844 |
This registers Type 1 fonts, hyphenation patterns, or formats with TeX. |
This registers Type 1 fonts, hyphenation patterns, and formats with TeX. |
| 2845 |
</para> |
</para> |
| 2846 |
</listitem> |
</listitem> |
| 2847 |
</itemizedlist> |
</itemizedlist> |
| 2848 |
</listitem> |
</listitem> |
| 2849 |
<listitem> |
<listitem> |
| 2850 |
<para> |
<para> |
| 2851 |
Add support of the <command>dh_quilt_patch</command> and |
Add support for the <command>dh_quilt_patch</command> and |
| 2852 |
<command>dh_quilt_unpatch</command> commands. |
<command>dh_quilt_unpatch</command> commands. |
| 2853 |
</para> |
</para> |
| 2854 |
<itemizedlist> |
<itemizedlist> |
| 2855 |
<listitem> |
<listitem> |
| 2856 |
<para> |
<para> |
| 2857 |
Install the <systemitem role="package">quilt</systemitem> package in |
Include the <systemitem role="package">quilt</systemitem> package in |
| 2858 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2859 |
</para> |
</para> |
| 2860 |
</listitem> |
</listitem> |
| 2861 |
<listitem> |
<listitem> |
| 2862 |
<para> |
<para> |
| 2863 |
Use <literal>dh --with quilt $@</literal> instead. |
Use <literal>dh $@ --with quilt</literal> instead. |
| 2864 |
</para> |
</para> |
| 2865 |
</listitem> |
</listitem> |
| 2866 |
<listitem> |
<listitem> |
| 2867 |
<para> |
<para> |
| 2868 |
This applies and un-applies patches to the upstream source from files in the |
This applies and un-applies patches to the upstream source from files in the |
| 2869 |
<filename>debian/patches</filename> directory for the <literal>1.0</literal> |
<filename>debian/patches</filename> directory for a source package in the <literal>1.0</literal> format. |
|
source package. |
|
| 2870 |
</para> |
</para> |
| 2871 |
</listitem> |
</listitem> |
| 2872 |
<listitem> |
<listitem> |
| 2873 |
<para> |
<para> |
| 2874 |
This is not needed if you use the new <literal>3.0 (quilt)</literal> source |
This is not needed if you use the new <literal>3.0 (quilt)</literal> source |
| 2875 |
package. |
package format. |
| 2876 |
</para> |
</para> |
| 2877 |
</listitem> |
</listitem> |
| 2878 |
</itemizedlist> |
</itemizedlist> |
| 2879 |
</listitem> |
</listitem> |
| 2880 |
<listitem> |
<listitem> |
| 2881 |
<para> |
<para> |
| 2882 |
Add support of the <command>dh_dkms</command> command. |
Add support for the <command>dh_dkms</command> command. |
| 2883 |
</para> |
</para> |
| 2884 |
<itemizedlist> |
<itemizedlist> |
| 2885 |
<listitem> |
<listitem> |
| 2886 |
<para> |
<para> |
| 2887 |
Install the <systemitem role="package">dkms</systemitem> package in |
Include the <systemitem role="package">dkms</systemitem> package in |
| 2888 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2889 |
</para> |
</para> |
| 2890 |
</listitem> |
</listitem> |
| 2891 |
<listitem> |
<listitem> |
| 2892 |
<para> |
<para> |
| 2893 |
Use <literal>dh --with dkms $@</literal> instead. |
Use <literal>dh $@ --with dkms</literal> instead. |
| 2894 |
</para> |
</para> |
| 2895 |
</listitem> |
</listitem> |
| 2896 |
<listitem> |
<listitem> |
| 2897 |
<para> |
<para> |
| 2898 |
This correctly handles DKMS usage by the kernel module package. |
This correctly handles DKMS usage by kernel module packages. |
| 2899 |
</para> |
</para> |
| 2900 |
</listitem> |
</listitem> |
| 2901 |
</itemizedlist> |
</itemizedlist> |
| 2902 |
</listitem> |
</listitem> |
| 2903 |
<listitem> |
<listitem> |
| 2904 |
<para> |
<para> |
| 2905 |
Add support of the <command>dh_autotools-dev_updateconfig</command> and |
Add support for the <command>dh_autotools-dev_updateconfig</command> and |
| 2906 |
<command>dh_autotools-dev_restoreconfig</command> commands. |
<command>dh_autotools-dev_restoreconfig</command> commands. |
| 2907 |
</para> |
</para> |
| 2908 |
<itemizedlist> |
<itemizedlist> |
| 2909 |
<listitem> |
<listitem> |
| 2910 |
<para> |
<para> |
| 2911 |
Install the <systemitem role="package">autotools-dev</systemitem> package in |
Include the <systemitem role="package">autotools-dev</systemitem> package in |
| 2912 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2913 |
</para> |
</para> |
| 2914 |
</listitem> |
</listitem> |
| 2915 |
<listitem> |
<listitem> |
| 2916 |
<para> |
<para> |
| 2917 |
Use <literal>dh --with autotools-dev $@</literal> instead. |
Use <literal>dh $@ --with autotools-dev</literal> instead. |
| 2918 |
</para> |
</para> |
| 2919 |
</listitem> |
</listitem> |
| 2920 |
<listitem> |
<listitem> |
| 2927 |
</listitem> |
</listitem> |
| 2928 |
<listitem> |
<listitem> |
| 2929 |
<para> |
<para> |
| 2930 |
Add support of the <command>dh_autoreconf</command> and |
Add support for the <command>dh_autoreconf</command> and |
| 2931 |
<command>dh_autoreconf_clean</command> commands. |
<command>dh_autoreconf_clean</command> commands. |
| 2932 |
</para> |
</para> |
| 2933 |
<itemizedlist> |
<itemizedlist> |
| 2934 |
<listitem> |
<listitem> |
| 2935 |
<para> |
<para> |
| 2936 |
Install the <systemitem role="package">dh-autoreconf</systemitem> package in |
Include the <systemitem role="package">dh-autoreconf</systemitem> package in |
| 2937 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2938 |
</para> |
</para> |
| 2939 |
</listitem> |
</listitem> |
| 2940 |
<listitem> |
<listitem> |
| 2941 |
<para> |
<para> |
| 2942 |
Use <literal>dh --with autoreconf $@</literal> instead. |
Use <literal>dh $@ --with autoreconf</literal> instead. |
| 2943 |
</para> |
</para> |
| 2944 |
</listitem> |
</listitem> |
| 2945 |
<listitem> |
<listitem> |
| 2951 |
</listitem> |
</listitem> |
| 2952 |
<listitem> |
<listitem> |
| 2953 |
<para> |
<para> |
| 2954 |
Add support to the <command>bash</command> completion feature. |
Add support for the <command>bash</command> completion feature. |
| 2955 |
</para> |
</para> |
| 2956 |
<itemizedlist> |
<itemizedlist> |
| 2957 |
<listitem> |
<listitem> |
| 2958 |
<para> |
<para> |
| 2959 |
Install the <systemitem role="package">bash-completion</systemitem> package in |
Includes the <systemitem role="package">bash-completion</systemitem> package in |
| 2960 |
<literal>Build-Depends</literal>. |
<literal>Build-Depends</literal>. |
| 2961 |
</para> |
</para> |
| 2962 |
</listitem> |
</listitem> |
| 2963 |
<listitem> |
<listitem> |
| 2964 |
<para> |
<para> |
| 2965 |
Use <literal>dh --with bash-completion $@</literal> instead. |
Use <literal>dh $@ --with bash-completion</literal> instead. |
| 2966 |
</para> |
</para> |
| 2967 |
</listitem> |
</listitem> |
| 2968 |
<listitem> |
<listitem> |
| 2969 |
<para> |
<para> |
| 2970 |
This installs <command>bash</command> completions using configuration file at |
This installs <command>bash</command> completions using a configuration file at |
| 2971 |
<filename>debian/<replaceable>package</replaceable>.bash-completion</filename>. |
<filename>debian/<replaceable>package</replaceable>.bash-completion</filename>. |
| 2972 |
</para> |
</para> |
| 2973 |
</listitem> |
</listitem> |
| 2981 |
manpage of each command for the customization of such features. |
manpage of each command for the customization of such features. |
| 2982 |
</para> |
</para> |
| 2983 |
<para> |
<para> |
| 2984 |
Some <command>dh_*</command> commands invoked by the new <command>dh</command> |
You may need to run <command>dh_*</command> commands invoked via the new <command>dh</command> |
| 2985 |
command may require you to run it with some arguments or to run additional |
with added arguments, or to run additional commands with them, or to skip them. |
| 2986 |
commands with them or to skip them. For such cases, you create an |
For such cases, you create an |
| 2987 |
<literal>override_dh_<replaceable>foo</replaceable></literal> target with its |
<literal>override_dh_<replaceable>foo</replaceable></literal> target with its |
| 2988 |
rule in the <filename>rules</filename> file only for the |
rule in the <filename>rules</filename> file defining an |
| 2989 |
|
<literal>override_dh_<replaceable>foo</replaceable></literal> target for the |
| 2990 |
<command>dh_<replaceable>foo</replaceable></command> command you want to |
<command>dh_<replaceable>foo</replaceable></command> command you want to |
| 2991 |
change. It basically say <emphasis>run me instead</emphasis>. |
change. It basically says <emphasis>run me instead</emphasis>. |
| 2992 |
<footnote><para> Under <literal>lenny</literal>, if you wanted to change the |
<footnote><para> Under <literal>lenny</literal>, if you wanted to change the |
| 2993 |
behavior of a <command>dh_*</command> script you found the relevant line in the |
behavior of a <command>dh_*</command> script you found the relevant line in the |
| 2994 |
<filename>rules</filename> file and adjusted it. </para> </footnote> |
<filename>rules</filename> file and adjusted it. </para> </footnote> |
| 2995 |
</para> |
</para> |
| 2996 |
<para> |
<para> |
| 2997 |
Please note that the <command>dh_auto_*</command> commands tend to do more than |
Please note that the <command>dh_auto_*</command> commands tend to do more than |
| 2998 |
what has been discussed as (over)simplified explanation to take care all the |
what has been discussed in this (over)simplified explanation to take care of all the |
| 2999 |
corner cases. Use of simplified equivalent command instead of these in |
corner cases. It is a bad idea to use <literal>override_dh_*</literal> targets |
| 3000 |
<literal>override_dh_*</literal> targets except the |
to substitute simplified equivalent commands (except for the |
| 3001 |
<literal>override_dh_auto_clean</literal> target is a bad idea since it may |
<literal>override_dh_auto_clean</literal> target) since it may |
| 3002 |
kill such <systemitem role="package">debhelper</systemitem>'s smart features. |
bypass such smart <systemitem role="package">debhelper</systemitem> features. |
| 3003 |
</para> |
</para> |
| 3004 |
<para> |
<para> |
| 3005 |
If you want to store the system configuration data in the |
So, for instance, if you want to store system configuration data in the |
| 3006 |
<filename>/etc/gentoo</filename> directory instead of the usual |
<filename>/etc/gentoo</filename> directory instead of the usual |
| 3007 |
<filename>/etc</filename> directory for the recent |
<filename>/etc</filename> directory for the recent |
| 3008 |
<systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default |
<systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default |
| 3017 |
<para> |
<para> |
| 3018 |
The arguments given after <literal>--</literal> are appended to the default |
The arguments given after <literal>--</literal> are appended to the default |
| 3019 |
arguments of the auto-executed program to override them. Using the |
arguments of the auto-executed program to override them. Using the |
| 3020 |
<command>dh_auto_configure</command> command is better than the |
<command>dh_auto_configure</command> command is better than directly invoking the |
| 3021 |
<command>./configure</command> command here since it will only override the |
<command>./configure</command> command here since it will only override the |
| 3022 |
<literal>--sysconfig</literal> argument and keeps well intended other arguments |
<literal>--sysconfig</literal> argument and retains any other, benign arguments |
| 3023 |
to the <command>./configure</command> command. |
to the <command>./configure</command> command. |
| 3024 |
</para> |
</para> |
| 3025 |
<para> |
<para> |
| 3026 |
If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> requires you to specify |
If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify |
| 3027 |
<literal>build</literal> as its target to build it <footnote><para> |
<literal>build</literal> as its target to build it <footnote><para> |
| 3028 |
<command>dh_auto_build</command> without any arguments will execute the first |
<command>dh_auto_build</command> without any arguments will execute the first |
| 3029 |
target in the <filename>Makefile</filename> file. </para> </footnote>, you |
target in the <filename>Makefile</filename>. </para> </footnote>, you |
| 3030 |
create an <literal>override_dh_auto_build</literal> target to enable it. |
create an <literal>override_dh_auto_build</literal> target to enable this. |
| 3031 |
</para> |
</para> |
| 3032 |
<screen> |
<screen> |
| 3033 |
override_dh_auto_build: |
override_dh_auto_build: |
| 3034 |
dh_auto_build -- build |
dh_auto_build -- build |
| 3035 |
</screen> |
</screen> |
| 3036 |
<para> |
<para> |
| 3037 |
This ensures to run $(MAKE) with all the default arguments given by the |
This ensures <literal>$(MAKE)</literal> is run with all the default arguments given by the |
| 3038 |
<command>dh_auto_build</command> command and <literal>build</literal> argument. |
<command>dh_auto_build</command> command plus the <literal>build</literal> argument. |
| 3039 |
</para> |
</para> |
| 3040 |
<para> |
<para> |
| 3041 |
If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> requires you to specify the |
If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify the |
| 3042 |
<literal>packageclean</literal> target to clean it for Debian package instead |
<literal>packageclean</literal> target to clean it for the Debian package instead |
| 3043 |
of the <literal>distclean</literal> or <literal>clean</literal> targets in the |
of using <literal>distclean</literal> or <literal>clean</literal> targets, |
| 3044 |
<filename>Makefile</filename> file, you create an |
you can create an |
| 3045 |
<literal>override_dh_auto_clean</literal> target to enable it. |
<literal>override_dh_auto_clean</literal> target to enable thit. |
| 3046 |
</para> |
</para> |
| 3047 |
<screen> |
<screen> |
| 3048 |
override_dh_auto_clean: |
override_dh_auto_clean: |
| 3049 |
$(MAKE) packageclean |
$(MAKE) packageclean |
| 3050 |
</screen> |
</screen> |
| 3051 |
<para> |
<para> |
| 3052 |
If <filename>Makefile</filename> of a source for <systemitem role="package">gentoo</systemitem> contains <literal>test</literal> target |
If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> contains a <literal>test</literal> target |
| 3053 |
which you do not want to run for the Debian package building process, you can |
which you do not want to run for the Debian package building process, you can |
| 3054 |
use empty <literal>override_dh_auto_test</literal> target to skip it. |
use an empty <literal>override_dh_auto_test</literal> target to skip it. |
| 3055 |
</para> |
</para> |
| 3056 |
<screen> |
<screen> |
| 3057 |
override_dh_auto_test: |
override_dh_auto_test: |
| 3063 |
The <command>dh_installchangelogs</command> command requires |
The <command>dh_installchangelogs</command> command requires |
| 3064 |
<filename>FIXES</filename> as its argument to install it. <footnote><para> The |
<filename>FIXES</filename> as its argument to install it. <footnote><para> The |
| 3065 |
<filename>debian/changelog</filename> and <filename>debian/NEWS</filename> |
<filename>debian/changelog</filename> and <filename>debian/NEWS</filename> |
| 3066 |
files are always automatically installed. The upstream changelog is searched |
files are always automatically installed. The upstream changelog is found |
| 3067 |
by converting filenames to the lower case and matching them with the |
by converting filenames to lower case and matching them against |
| 3068 |
<filename>changelog</filename>, <filename>changes</filename>, |
<filename>changelog</filename>, <filename>changes</filename>, |
| 3069 |
<filename>changelog.txt</filename>, and <filename>changes.txt</filename>. |
<filename>changelog.txt</filename>, and <filename>changes.txt</filename>. |
| 3070 |
</para> </footnote> |
</para> </footnote> |
| 3075 |
</screen> |
</screen> |
| 3076 |
<para> |
<para> |
| 3077 |
When you use the new <command>dh</command> command, use of explicit targets |
When you use the new <command>dh</command> command, use of explicit targets |
| 3078 |
such as the ones listed in <xref linkend="targets"/> except |
such as the ones listed in <xref linkend="targets"/>, other than the |
| 3079 |
<literal>get-orig-source</literal> target may make it difficult to understand |
<literal>get-orig-source</literal> target, may make it difficult to understand |
| 3080 |
their exact effects. Please limit explicit targets to |
their exact effects. Please limit explicit targets to |
| 3081 |
<literal>override_dh_*</literal> targets and completely independent ones, if |
<literal>override_dh_*</literal> targets and completely independent ones, if |
| 3082 |
possible. |
possible. |
| 3102 |
them. |
them. |
| 3103 |
<footnote><para> |
<footnote><para> |
| 3104 |
In this chapter, files in the <filename>debian</filename> directory are |
In this chapter, files in the <filename>debian</filename> directory are |
| 3105 |
referred to without the preceding <filename>debian/</filename> for simplicity whenever |
referred to without the leading <filename>debian/</filename> for simplicity whenever |
| 3106 |
they are obvious. |
the meaning is obvious. |
| 3107 |
</para></footnote> |
</para></footnote> |
| 3108 |
</para> |
</para> |
| 3109 |
<para> |
<para> |
| 3466 |
src/<replaceable>bar</replaceable> usr/bin |
src/<replaceable>bar</replaceable> usr/bin |
| 3467 |
</screen> |
</screen> |
| 3468 |
<para> |
<para> |
| 3469 |
This means when this package is installed, there will be a binary executable |
This means when this package is installed, there will be an executable command |
| 3470 |
<filename>/usr/bin/<replaceable>bar</replaceable></filename>. |
<filename>/usr/bin/<replaceable>bar</replaceable></filename>. |
| 3471 |
</para> |
</para> |
| 3472 |
<para> |
<para> |
| 3655 |
</itemizedlist> |
</itemizedlist> |
| 3656 |
</section> |
</section> |
| 3657 |
</section> |
</section> |
| 3658 |
<section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename> file</title> |
<section id="manpages"><title><filename><replaceable>package</replaceable>.manpages</filename></title> |
| 3659 |
<para> |
<para> |
| 3660 |
If your package has manual pages, you should install them using <citerefentry> |
If your package has manual pages, you should install them using <citerefentry> |
| 3661 |
<refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum> |
<refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum> |
| 4076 |
<ulink url="&keycreate;">Creating a new GPG key</ulink> and |
<ulink url="&keycreate;">Creating a new GPG key</ulink> and |
| 4077 |
<ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>. |
<ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>. |
| 4078 |
</para></footnote> |
</para></footnote> |
| 4079 |
If you are building Debian packages only for your local use, you can skip |
If you are building Debian packages only for your own local use, you can skip |
| 4080 |
promptings for the GPG signitures on the <filename>.dsc</filename> file and the |
promptings for the GPG signatures on the <filename>.dsc</filename> file and the |
| 4081 |
<filename>.changes</filename> file as: |
<filename>.changes</filename> file like this: |
| 4082 |
</para> |
</para> |
| 4083 |
<screen> |
<screen> |
| 4084 |
$ dpkg-buildpackage -us -uc |
$ dpkg-buildpackage -us -uc |
| 4085 |
</screen> |
</screen> |
| 4086 |
<para> |
<para> |
| 4087 |
For the non-native Debian package, e.g., |
For a non-native Debian package, e.g., |
| 4088 |
<systemitem role="package">gentoo</systemitem>, you will see the following |
<systemitem role="package">gentoo</systemitem>, you will see the following |
| 4089 |
files in the parent directory (<filename>~/gentoo</filename>) after building |
files in the parent directory (<filename>~/gentoo</filename>) after building |
| 4090 |
packages: |
packages: |
| 4172 |
they'll know the file is corrupt or has been tampered with. |
they'll know the file is corrupt or has been tampered with. |
| 4173 |
</para> |
</para> |
| 4174 |
<para> |
<para> |
| 4175 |
For the native Debian package, e.g., |
For a native Debian package, e.g., |
| 4176 |
<systemitem role="package">mypackage</systemitem>, you will see the following |
<systemitem role="package">mypackage</systemitem>, you will see the following |
| 4177 |
files in the parent directory after building packages: |
files in the parent directory after building packages: |
| 4178 |
</para> |
</para> |
| 4182 |
<filename>mypackage_1.0.tar.gz</filename> |
<filename>mypackage_1.0.tar.gz</filename> |
| 4183 |
</para> |
</para> |
| 4184 |
<para> |
<para> |
| 4185 |
This is the source code tarball merely created from the |
This is the source code tarball created from the |
| 4186 |
<filename>mypackage-1.0</filename> directory by the |
<filename>mypackage-1.0</filename> directory by the |
| 4187 |
<command>dpkg-source</command>. (Its suffix is not <filename>orig.tar.gz</filename>.) |
<command>dpkg-source</command> command. (Its suffix is not <filename>orig.tar.gz</filename>.) |
| 4188 |
</para> |
</para> |
| 4189 |
</listitem> |
</listitem> |
| 4190 |
<listitem> |
<listitem> |
| 4330 |
$ debuild |
$ debuild |
| 4331 |
</screen> |
</screen> |
| 4332 |
<para> |
<para> |
| 4333 |
Here, if you are building Debian packages only for your local use, you can skip |
Here, if you are building Debian packages only for your own local use, you can skip |
| 4334 |
promptings for the GPG signitures on the <filename>.dsc</filename> file and the |
promptings for the GPG signatures on the <filename>.dsc</filename> file and the |
| 4335 |
<filename>.changes</filename> file as: |
<filename>.changes</filename> file like this: |
| 4336 |
</para> |
</para> |
| 4337 |
<screen> |
<screen> |
| 4338 |
$ debuild -us -uc |
$ debuild -us -uc |
| 4412 |
$ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc |
$ sudo pbuilder --build <replaceable>foo_version</replaceable>.dsc |
| 4413 |
</screen> |
</screen> |
| 4414 |
<para> |
<para> |
| 4415 |
The newly built packages without the GPG signitures will be located in |
The newly built packages without the GPG signatures will be located in |
| 4416 |
<filename>/var/cache/pbuilder/result/</filename> with non-root ownership. |
<filename>/var/cache/pbuilder/result/</filename> with non-root ownership. |
| 4417 |
</para> |
</para> |
| 4418 |
<para> |
<para> |
| 4419 |
The GPG signitures on the <filename>.dsc</filename> file and the |
The GPG signatures on the <filename>.dsc</filename> file and the |
| 4420 |
<filename>.changes</filename> file can be generated as: |
<filename>.changes</filename> file can be generated as: |
| 4421 |
</para> |
</para> |
| 4422 |
<screen> |
<screen> |
| 4435 |
</screen> |
</screen> |
| 4436 |
<para> |
<para> |
| 4437 |
Here, if you are building Debian packages only for your local use, you can skip |
Here, if you are building Debian packages only for your local use, you can skip |
| 4438 |
promptings for the GPG signitures on the <filename>.dsc</filename> file and the |
promptings for the GPG signatures on the <filename>.dsc</filename> file and the |
| 4439 |
<filename>.changes</filename> file as: |
<filename>.changes</filename> file as: |
| 4440 |
</para> |
</para> |
| 4441 |
<screen> |
<screen> |
| 4484 |
restrictions for such updates of your <literal>stable</literal> package. |
restrictions for such updates of your <literal>stable</literal> package. |
| 4485 |
</para> </footnote> For such occasions, the fact you may be running a <literal>sid</literal> |
</para> </footnote> For such occasions, the fact you may be running a <literal>sid</literal> |
| 4486 |
system is not a good enough excuse for failing to update them promptly. The <systemitem role="package">pbuilder</systemitem> package can help you to access |
system is not a good enough excuse for failing to update them promptly. The <systemitem role="package">pbuilder</systemitem> package can help you to access |
| 4487 |
environments of almost any Debian derivative distribution of the same CPU |
environments of almost any Debian derivative distribution of the same |
| 4488 |
architecture. |
architecture. |
| 4489 |
</para> |
</para> |
| 4490 |
<para> |
<para> |
| 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 |
| 4829 |
<para> |
<para> |
| 4830 |
Once you become an official developer, |
Once you become an official developer, |
| 4831 |
<footnote><para> |
<footnote><para> |
| 4832 |
See <xref linkend="socialdynamism"/>. |
See <xref linkend="socialdynamics"/>. |
| 4833 |
</para></footnote> |
</para></footnote> |
| 4834 |
you can upload the package to the Debian archive. |
you can upload the package to the Debian archive. |
| 4835 |
<footnote><para> |
<footnote><para> |
| 4926 |
$ debuild -sa |
$ debuild -sa |
| 4927 |
</screen> |
</screen> |
| 4928 |
<para> |
<para> |
| 4929 |
For the <command>debuild</command> command: |
For the <command>pdebuild</command> command: |
| 4930 |
</para> |
</para> |
| 4931 |
<screen> |
<screen> |
| 4932 |
$ pdebuild --debbuildopts -sa |
$ pdebuild --debbuildopts -sa |
| 4958 |
$ debuild -v<replaceable>1.2</replaceable> |
$ debuild -v<replaceable>1.2</replaceable> |
| 4959 |
</screen> |
</screen> |
| 4960 |
<para> |
<para> |
| 4961 |
For the <command>debuild</command> command: |
For the <command>pdebuild</command> command: |
| 4962 |
</para> |
</para> |
| 4963 |
<screen> |
<screen> |
| 4964 |
$ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>" |
$ pdebuild --debbuildopts "-v<replaceable>1.2</replaceable>" |
| 5081 |
</listitem> |
</listitem> |
| 5082 |
</itemizedlist> |
</itemizedlist> |
| 5083 |
<para> |
<para> |
| 5084 |
One of the tricky case happens when you make an experimental package before |
One tricky case can occur when you make a local package to experiment with |
| 5085 |
uploading the normal version, e.g., |
the packaging before uploading the normal version to the official archive, |
| 5086 |
|
e.g., |
| 5087 |
<literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>. |
<literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>. |
| 5088 |
For such case, you use a version string in the Debian |
For smoother upgrades, it is a good idea to create a |
| 5089 |
<filename>changelog</filename> file as |
<filename>changelog</filename> entry with a version string as |
| 5090 |
<literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>. See <xref linkend="namever"/> for the order of version strings. |
<literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>. |
| 5091 |
|
You may unclutter <filename>changelog</filename> |
| 5092 |
|
by consolidating such local change entries into a single entry for the official package. |
| 5093 |
|
See <xref linkend="namever"/> for the order of version strings. |
| 5094 |
</para> |
</para> |
| 5095 |
<para> |
<para> |
| 5096 |
</para> |
</para> |
| 5097 |
</section> |
</section> |
| 5098 |
<section id="inspectnewupstream"><title>Inspection of the new upstream release</title> |
<section id="inspectnewupstream"><title>Inspection of the new upstream release</title> |
| 5099 |
<para> |
<para> |
| 5100 |
When preparing packages of the a upstream release for the Debian archive, you |
When preparing packages of a new upstream release for the Debian archive, you |
| 5101 |
must check the new upstream release, first. |
must check the new upstream release, first. |
| 5102 |
</para> |
</para> |
| 5103 |
<para> |
<para> |
| 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> |