[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ next ]

Debian New Maintainers' Guide
Chapter 6 - Building the package

We should now be ready to build the package.

6.1 Complete rebuild

Enter the program's main directory and then issue this command:

       dpkg-buildpackage -rfakeroot

This will do everything for you. It will:

The only input that will be required of you is your GPG key secret pass phrase, twice.

After all this is done, you will see the following files in the directory above (~/gentoo/):

The long strings of numbers in the .dsc and .changes files are MD5 checksums for the files mentioned. A person downloading your files can test them with md5sum(1) and if the numbers don't match, they'll know the file is corrupt or has been tampered with.

6.2 Quick rebuild

With a large package, you may not want to rebuild from scratch every time while you tune a detail in debian/rules. For testing purposes, you can make a .deb file without rebuilding the upstream sources like this:

       fakeroot debian/rules binary

Once you are finished with your tuning, remember to rebuild following the above, proper procedure. You may not be able to upload correctly if you try to upload .deb files built this way.

6.3 The debuild command

You can automate package build process further with debuild command. See debuild(1).

Customization of the debuild command can be done through /etc/devscripts.conf or ~/.devscripts. I would suggest at least following items:


With these, you can build package always with your GPG key and avoid including undesired components. (This is good for sponsoring too.) For example, cleaning source and rebuilding package from a user account is as simple as:

       debuild clean

6.4 The dpatch and quilt systems

The simple use of dh_make and dpkg-buildpackage commands will create a single large diff.gz file which contains package maintenance files in debian/ and patch files to the source. Such a package is a bit cumbersome to inspect and understand for each source tree modification later. This is not so nice. [1]

Several methods for the patch set maintenance have been proposed and are in use with Debian packages. The dpatch and quilt systems are two of the simplest of such patch maintenance systems proposed. Other ones are dbs, cdbs, etc.

A package which is packaged properly with the dpatch or quilt systems has modifications to the source clearly documented as a set of -p1 patch files with header in debian/patches/ and the source tree is untouched outside of debian/ directory. If you are asking a sponsor to upload your package, this kind of clear separation and documentation of your changes are very important to expedite the package review by your sponsor. The usage method of dpatch and quilt is explained in dpatch(1), dpatch-edit-patch(1) and quilt(1). Both programs provide convenience files to include in debian/rules: /usr/share/dpatch/dpatch.make and /usr/share/quilt/quilt.make.

When someone (including yourself) provides you with a patch to the source later, then the package modification is quite simple:

Also, dpatch has a capability to make patches architecture dependent using CPP macro.

6.5 Including orig.tar.gz for upload

When you first upload the package to the archive, you need to include the original orig.tar.gz source. If package version is not at -0 or -1 Debian revision, you must provide dpkg-buildpackage command with the "-sa" option. On the other hand, the "-sd" option will force to exclude the original orig.tar.gz source.

[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ 10 ] [ A ] [ next ]

Debian New Maintainers' Guide

version 1.2.11, 12 January 2007.

Josip Rodin [email protected]