DH_MAKE(1) | General Commands Manual | DH_MAKE(1) |
dh_make - prepare upstream source for Debian packaging
dh_make [option]...
dh_make is a tool that adds necessary files for making
Debian source package from upstream source according to the requirements of
the Debian Policy. dh_make must be invoked within a directory
containing the source code, which must be named
<packagename>-<version>. The <packagename> must be all
lowercase, The <packagename> and <version> must be all
lowercase, digits and dashes. The <version> can also contain digits,
and the symbols plus, dot, tilde. The <version> must start with a
digit. If the directory name does not conform to this scheme, you must
rename it before using dh_make. Alternatively, you may be able to use
the --packagename option to force the package name.
Classes can be set with the single direct options (such as --s for single) or with the -C,--packageclass option (-C=s for single).
Unless --native was given, dh_make makes sure a original source archive (<packagename>_<version>.orig.tar.gz) exists. The archive can either end with .gz or one of the other supported compression extensions such as bz2 or lzma. If no such file exists, the file specified with -f is copied in place. If no -f is supplied either but --createorig is, the current directory is created into a new archive ../<packagename>-<version>.orig.tar.gz The original archive is needed for other Debian tools to generate the diffs to the original sources required by the Debian packaging format. Unless there are reasons against it, this file should be the pristine upstream archive.
Then dh_make proceeds to generate a "debian" subdirectory and the necessary control files in the program source directory. Those control files are customized with the packagename and version extracted from the directory name.
dh_make makes several attempts to obtain the username. It first checks for the environment variables $DEBFULLNAME, $LOGNAME is used to find a name in the /etc/passwd file, and through NIS, YP and LDAP.
The e-mail address can either be specified with the -fB--email option or dh_make will attempt to find it. It will first check the environment variables $DEBEMAIL and then $EMAIL. If they are not set then dh_make will search an available LDAP directory using ldapsearch(1) using $LOGNAME as the uid to search under. Finally it will use $LOGNAME and /etc/mailname to generate an email address.
dh_make will also generate example files that are also customized for the package generated. You can remove all files with *.ex if you wish. You can also delete the README.Debian file if you don't have anything to put in it. Renaming the example files to their name without the .ex at the end (and editing them if necessary) will activate that feature of debhelper.
If the --templates or -o (--overlay) option is used dh_make will apply a customizing template to the "debian" directory. See the templates described in the FILES section of this manpage for samples.
The following environment settings are used by dh_make:
To get dh_make to use the defaults and ask you various
questions about the package
dh_make
Create your single class package using the with the GPL license:
dh_make -s -c gpl
A more involved example where you set your name in the
environment, contact email and license in the options and specify the
upstream file:
DEBFULLNAME="John Doe"
dh_make --email contact@example.com --copyright=bsd \
--file ../foo.tar.gz
dh_make may not detect your username and email address correctly when using sudo.
dpkg(1), dpkg-buildpackage(1), dh(1), make-kpkg(1), debhelper(7).
You may also want to read the Debian Policy (in /usr/share/doc/debian-policy) and the New Maintainers' Guide (in /usr/share/doc/maint-guide).
2021-09-21 | Debian Project |