debhelper

debhelper

debhelper is a suite of programs originally written by Joey Hess that help a Debian packager write rules files. A rules file is a makefile that contains instructions for building and creating a Debian package.

Contents

Overview

There are many tasks that need to be performed over and over again in the rules files. Instead of cutting and pasting code to do these tasks, debhelper allows a packager to simply call one of its 58 programs[1] to do the task for them.

debhelper can greatly simplify things. Debian includes packages of GNU hello made both with and without debhelper as examples for packagers. The rules file that does not use debhelper is 2,174 characters. In contrast, the version that uses debhelper is 783 characters.

Version 7 of debhelper introduced the dh helper, which can significantly simplify rules files for common cases. A debhelper 7 powered rules file can be as short as 3 lines, or 29 characters[2]:

#!/usr/bin/make -f
%:
        dh $@

dh_make

Related to debhelper, there is also a tool called dh_make. dh_make copies templates of all of the files needed to build a debian package to the source directory of a program. These templates are customized slightly based on information that the user gives and on a cursory examination of how the source code is built. After running dh_make, a developer still has to edit most of the template files to be able to build the package.

Although closely related to it, dh_make is not part of debhelper; it was separately developed by Craig Small.

See also

References

  1. ^ http://git.debian.org/?p=debhelper/debhelper.git;a=tree;h=refs/heads/master;hb=master
  2. ^ http://kitenet.net/~joey/blog/entry/cdbs_killer___40__design_phase__41__/

External links