Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: debian/0.58
Fetching contributors…

Cannot retrieve contributors at this time

file 258 lines (249 sloc) 8.997 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258
.TH DH_MAKE 8 2011-01-08 "Debian Project"
dh_make \- prepare Debian packaging for an original source archive
.B dh_make
[\-nlsmiadhr] [\-c license] [\-e address] [\-f file] [\-t directory]
[\-o directory] [\-p name] [\-\-copyright license]
[\-\-email address] [\-\-native] [\-\-file file]
[\-\-library] [\-\-single] [\-\-indep] [\-\-multi] [\-\-kmod] [\-\-kpatch]
[\-\-templates directory] [\-\-defaultless] [\-\-overlay directory]
[\-\-packagename name]
[\-\-rulesformat format]
[\-\-help] [\-\-version]
.B dh_make
is a tool to convert a regular source code package into one formatted
according to the requirements of the Debian Policy.
.B dh_make
must be invoked within a directory containing the source code, which must
be named <packagename>\-<version>. The <packagename> must be all lowercase,
digits and dashes. If the directory name does not conform to this scheme,
you must rename it before using
.B dh_make.
Alternatively, you may be able to use the \fB\-\-packagename\fR option to force
the package name.
.B Single binary (s)
The package will generate a single binary .deb package. It is the standard
case, so if you don't know what to do, choose this.
.B Arch-Independent (i)
The package will generate a single package that is arch-indpendent.
.B Multiple binary (m)
The package will generate multiple binary .deb packages from one source
package. Choose this for larger packages that need to be split.
.B Library (l)
The package will generate at least two binaries. One library package
containing just the lib in \fI/usr/lib\fR and another *\-dev_*.deb package
containing documentation and C headers.
.B Kernel module (k)
The package will generate a binary\-all kernel module \-source package for
use with the
.BR make\-kpkg (1)
command. It also generates a binary package for
additional utilities, daemons, etc. that may come with the source.
.B Kernel patch
The package will generate a package that can be used for kernel patches.
Unless \fB\-\-native\fR was given,
.B 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 \fB\-f\fR is copied in place.
If no \fB\-f\fR is supplied either but \fB\-\-createorig\fR is, the current
directory is created into a news archive
.I ../<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.
.B 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.

.B dh_make
makes several attempts to obtain the username. It first checks for the
environment variables \fB$DEBFULLNAME\fR, \fB$LOGNAME\fR is used to
find a name in the \fI/etc/passwd\fR file, and through NIS, YP
and LDAP.

The e-mail address can either be specified with the -fB\-\-email\fR option
.B dh_make
will attempt to find it. It will first check the environment variables
\fB$DEBEMAIL\fR and then \fB$EMAIL. If they are not set then
.B dh_make
will search an available LDAP directory using
.BR ldapsearch (1)
using \fB$LOGNAME\fR as the uid to search under. Finally it will use
\fB$LOGNAME\fR and \fI/etc/mailname\fR to generate an email address.

.B 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 \fB\-\-templates\fR or \fB\-o\fR (\fB\-\-overlay\fR) option is used
.B dh_make
will apply a customizing template to the "debian" directory. See the
templates described in the FILES section of this manpage for samples.
.BR \-c ", " \-\-copyright\ \fIlicense\fR
Use \fIlicense\fR type in copyright file. \fIlicense\fR can be gpl, gpl2,
gpl3, lgpl, lgpl2 lgpl3, artistic, apache, bsd or x11.
If this field is not specified the copyright file has a space to
fill in which sort of license is used. The field is case-insensitive so
\-c GPL works as well as \-c gpl. gpl and lgpl will give you version 3
of the corresponding license, apache implies Apache v2.0. If you need a
different version, change the
license file afterwards or use the gpl2 and lgpl2 options.
.BR \-e ", " \-\-email\ \fIaddress\fR
Use \fIaddress\fR as the e\-mail address in the Maintainer: field of
debian/control file.
.BR \-n ", " \-\-native
Create a native Debian packages, i.e. do not generate a .orig archive,
since it will be generated when building with dpkg-buildpackage.
The version number will not have a Debian revision number (e.g. \-1)
appended to it.
.BR \-f ", " \-\-file\ \fIfile\fR
Use \fIfile\fR as the original source archive, and skip the copying of the
current program tree to program.orig.
.BR \-l ", " \-\-library
Automatically set the package class to Library, skipping the question.
.BR \-s ", " \-\-single
Automatically set the package class to Single binary, skipping the question.
.BR \-i ", " \-\-indep
Automatically set the package class to arch-independent binary, skipping the question.
.BR \-m ", " \-\-multi
Automatically set the package class to Multiple binary, skipping the question.
.BR \-k ", " \-\-kmod
Automatically set the package class to Kernel module, skipping the question.
.B \-\-kpatch
Automatically set package class to kpatch, skipping the question.
.BR \-a ", " \-\-addmissing
Adds missing example and control files on an existing debian source directory.
.BR \-t ", " \-\-templates\ \fIdirectory\fR
Applies the customizing templates in \fIdirectory\fR to the debian directory.
.BR \-o ", " \-\-overlay\ \fIdirectory\fR
Applies a customization template to an existing debian directory.
.BR \-p ", " \-\-packagename\ \fIname\fR
Force the package name to be \fIname\fR, good for packages with hyphens in their
name or other strangeness. You can also make the parameter
.IR name \_ version
which will set both the package name and version and bypass and directory
.BR \-d ", " \-\-defaultless
Skips applying the default templates to the target debian directory.
.BR \-h ", " \-\-help
Display the name, version, available options and authors, and exit
.BR \-r ", " \-\-rulesformat\ \fIformat\fR
Set the format for the debian/rules file to \fIformat\fR. The options are
the default Debhelper v7 minimal rules (dh7), the old rules format (old)
or CDBS format (cdbs).
.BR \-v ", " \-\-version
Show the program name and version, and exit successfully.
The following environment settings are used by \fBdh\_make\fR:
Email address to use in control and changelog entries.
You full name, eg "John Doe" which will appear in the control and changelog
Email address to use in control and changelog entries, only used if \fBDEBEMAIL\fR is no set.
Default username used for looking up email and full name in other directories.
.I /usr/share/debhelper/dh_make
Directory that contains all the template files, separated in six
.I debian/
with files for all package classes,
.I debians/
with files specific to the Single binary class,
.I debianm/
with files specific to the Multiple binary class,
.I debianl/
with files specific to the Library class, and finally,
.I native/
with files specific to the native Debian packages.
.I licenses/
template files for the more common licenses used in Debian packages
To get \fBdh\_make\fR to use the defaults and ask you various questions
about the package
.in +4n


Create your single class package using the with the GPL license:
.in +4n

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:
.in +4n

dh_make \-\-email \-\-copyright=bsd \\
\ \-\-file ../foo.tar.gz

.B dh_make
may not detect your username and email address correctly when using sudo.
.BR dpkg (1), dpkg\-buildpackage (1), debhelper (1), make\-kpkg (1), debhelper (7)
You may also want to read the Debian Policy (in
\fI/usr/share/doc/debian\-policy \fR) and the New Maintainers' Guide (in
Something went wrong with that request. Please try again.