Debian policy manual - chapter 4
Source package


4.1 Documentation and the changelog

Document your changes and updates to the source package properly in the debian/changelog file.

A copy of the file which will be installed in /usr/doc/copyright/package should be in debian/copyright.

In non-experimental packages you may only use a format for debian/changelog which is supported by the most recent released version of dpkg. If your format is not supported and there is general support for it you should contact the dpkg maintainer to have the parser script for your format included in the dpkg package.[7]


4.2 Changes to the upstream sources

If you need to edit a Makefile where GNU-style configure scripts are used, you should edit the .in files rather than editing the Makefile directly. This allows the user to reconfigure the package if necessary. You should not configure the package and edit the generated Makefile! This makes it impossible for someone else to later reconfigure the package.

If changes to the source code are made that are generally applicable please try to get them included in the upstream version of the package by supplying the upstream authors with the changes in whatever form they prefer.

If you need to configure the package differently for Debian or for Linux, and the upstream source doesn't provide a way to configure it the way you need to, please add such configuration facilities (for example, a new autoconf test or #define) and send the patch to the upstream authors, with the default set to the way they originally had it. You can then easily override the default in your debian/rules or wherever is appropriate.


4.3 Error trapping in makefiles

When make invokes a command in a makefile (including your package's upstream makefiles and the debian/rules) it does so using sh. This means that sh's usual bad error handling properties apply: if you include a miniature script as one of the commands in your makefile you'll find that if you don't do anything about it then errors are not detected and make will blithely continue after problems.

Every time you put more than one shell command (this includes using a loop) in a makefile command you must make sure that errors are trapped. For simple compound commands, such as changing directory and then running a program, using && rather than semicolon as a command separator is sufficient. For more complex commands including most loops and conditionals you must include a separate set -e command at the start of every makefile command that's actually one of these miniature shellscripts.


Debian policy manual - Copyright ©1996 Ian Jackson.
Contents; abstract; next; back.
version 0.1, 11 August 1996
Ian Jackson ijackson@gnu.ai.mit.edu