Download Debian New Maintainers` Guide

Transcript
26 / 58
Debian New Maintainers’ Guide
The functions of dh_* commands are largely self-evident from their names. 19 There are a few notable ones that are worth giving
(over)simplified explanations here assuming a typical build environment based on a Makefile: 20
• dh_auto_clean usually executes the following if a Makefile exists with the distclean target.
21
make distclean
• dh_auto_configure usually executes the following if ./configure exists (arguments abbreviated for readability).
./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var ...
• dh_auto_build usually executes the following to execute the first target of Makefile if it exists.
make
• dh_auto_test usually executes the following if a Makefile exists with the test target.
22
make test
• dh_auto_install usually executes the following if a Makefile exists with the install target (line folded for readability).
make install \
DESTDIR=/path/to/package_version-revision/debian/package
All targets which require the fakeroot command will contain dh_testroot, which exits with an error if you are not using this
command to pretend to be root.
The important part to know about the rules file created by dh_make is that it is just a suggestion. It will work for most packages
but for more complicated ones, don’t be afraid to customize it to fit your needs.
Although install is not a required target, it is supported. fakeroot dh install behaves like fakeroot dh binary
but stops after dh_fixperms.
4.4.3
Customization of rules file
There are many ways to customize the rules file created with the new dh command.
The dh $@ command can be customized as follows:
23
• Add support for the dh_python2 command. (The best choice for Python.)
24
– Include the python package in Build-Depends.
– Use dh $@--with python2.
– This handles Python modules using the python framework.
• Add support for the dh_pysupport command. (deprecated)
– Include the python-support package in Build-Depends.
– Use dh $@--with pysupport.
19 For complete information on what all these dh_* scripts do exactly, and what their other options are, please read their respective manual pages and the
debhelper documentation.
20 These commands support other build environments such as setup.py which can be listed by executing dh_auto_build --list in a package source
directory.
21 It actually looks for the first available target in the Makefile out of distclean, realclean, or clean, and executes that.
22
It actually looks for the first available target in the Makefile out of test or check, and executes that.
If a package installs the /usr/share/perl5/Debian/Debhelper/Sequence/custom_name.pm file, you should activate its customization
function by dh $@--with custom-name.
24 Use of the dh_python2 command is preferred over use of dh_pysupport or dh_pycentral commands. Do not use the dh_python command.
23