Chapter 3. Basic Packaging

Table of Contents

Packaging From Scratch
changelog
control
copyright
rules
postinst and prerm
Building the Source Package
Packaging with Debhelper
Building the Source Package
Packaging With CDBS
Using CDBS in packages
More information on CDBS
Updating Packages
Common Mistakes
dh_make Example Files
Changing the Original Tarball
Copyright Information

Two of the problems that many novice packagers face are that there are multiple ways of packaging, and there is more than one tool to do the job. We will go through three examples with the common build systems. First, we will use no build helper. This approach is usually the most difficult and is not often used in practice but gives the most straightforward look at the packaging process. Second, we will use debhelper, the most common build system in Debian. It helps the packager by automating repetitive tasks. Third, we will briefly cover the Common Debian Build System (CDBS), a more streamlined build system that uses debhelper.

[Tip]

Package development often requires installing many packages (especially -dev packages containing headers and other common development files) that are not part of a normal desktop Ubuntu installation. If you want to avoid installing extra packages or would like to develop for a different Ubuntu release (the development one, for instance) from what you currently have, the use of a chroot environment is highly recommended. A guide to setting up a chroot can be found in the Appendix.