debmake helps to build a Debian package from the upstream source. Normally, this is done as follows:
• The upstream tarball is downloaded as the package-version.tar.gz file.
• It is untarred to create many files under the package-version/ directory.
• debmake is invoked in the package-version/ directory, possibly without any arguments.
• Files in the package-version/debian/ directory are manually adjusted.
• dpkg-buildpackage (usually from its wrapper debuild or sbuild) is invoked in the package-version/
directory to make Debian packages.
Make sure to protect the arguments of the -b, -f, -l, and -w options from shell interference by quoting
them properly.
optionalarguments:-h, --help
show this help message and exit.
-c, --copyright
scan source for copyright+license text and exit.
• -c: simple output style
• -cc: normal output style (similar to the debian/copyright file)
• -ccc: debug output style
-k, --kludge
compare the debian/copyright file with the source and exit.
The debian/copyright file must be organized to list the generic file patterns before the specific
exceptions.
• -k: basic output style
• -kk: verbose output style
-n, --native
make a native Debian source package without .orig.tar.gz. This makes a “3.0(native)” format package.
If you are thinking of packaging a Debian-specific source tree with debian/ in it into a native
Debian package, please think otherwise. You can use the “debmake-d-idebuild” or “debmake-t-idebuild” commands to make a “3.0(quilt)” format non-native Debian package. The only difference is
that the debian/changelog file must use the non-native version scheme: version-revision. The
non-native package is more friendly to downstream distributions.
-apackage-version.tar.gz, --archivepackage-version.tar.gz
use the upstream source tarball directly. (-p, -u, -z: overridden)
The upstream tarball may be specified as package_version.orig.tar.gz and tar.gz. For other cases, it
may be tar.bz2, or tar.xz.
If the specified upstream tarball name contains uppercase letters, the Debian package name is
generated by converting them to lowercase letters.
If the specified argument is the URL (http://, https://, or ftp://) to the upstream tarball, the
upstream tarball is downloaded from the URL using wget or curl.
-d, --dist
run the “makedist” command equivalents first to generate the upstream tarball and use it.
The “debmake-d” command is designed to run in the package/ directory hosting the upstream VCS with
the build system supporting the “makedist” command equivalents. (automake/autoconf, ...)
-t, --tar
run the “tar” command to generate the upstream tarball and use it.
The “debmake-t” command is designed to run in the package/ directory hosting the upstream VCS.
Unless you provide the upstream version with the -u option or with the debian/changelog file, a
snapshot upstream version is generated in the 0\~%y%m%d%H%M format, e.g., 0~1403012359, from the UTC
date and time. The generated tarball excludes the debian/ directory found in the upstream VCS. (It
also excludes typical VCS directories: .git/, .hg/, .svn/, .CVS/.)
-ppackage, --packagepackage
set the Debian package name.
-uversion, --upstreamversionversion
set the upstream package version.
-rrevision, --revisionrevision
set the Debian package revision.
-zextension, --targzextension
set the tarball type, extension=(tar.gz|tar.bz2|tar.xz). (alias: z, b, x)
-b "binarypackage[:type],...", --binaryspec "binarypackage[:type],..."
set the binary package specs by a comma separated list of binarypackage:type pairs. Here,
binarypackage is the binary package name, and the optional type is chosen from the following type
values:
• bin: C/C++ compiled ELF binary code package (any, foreign) (default, alias: "", i.e.,
null-string)
• data: Data (fonts, graphics, ...) package (all, foreign) (alias: da)
• dev: Library development package (any, same) (alias: de)
• doc: Documentation package (all, foreign) (alias: do)
• lib: Library package (any, same) (alias: l)
• perl: Perl script package (all, foreign) (alias: pl)
• python3: Python (version 3) script package (all, foreign) (alias: py3, python, py)
• ruby: Ruby script package (all, foreign) (alias: rb)
• nodejs: Node.js based JavaScript package (all, foreign) (alias: js)
• script: Shell and other interpretted language script package (all, foreign) (alias: sh)
The pair values in the parentheses, such as (any, foreign), are the Architecture and Multi-Arch
stanza values set in the debian/control file. In many cases, the debmake command makes good guesses
for type from binarypackage. If type is not obvious, type is set to bin.
Here are examples for typical binary package split scenarios where the upstream Debian source package
name is foo:
• Generating an executable binary package foo:
• “-b’foo:bin'”, or its short form `-b'-'`", or no -b option
• Generating an executable (python3) binary package python3-foo:
• “-b’python3-foo:py'”, or its short form “-b’python3-foo'”
• Generating a data package foo:
• “-b’foo:data'”, or its short form “-b'-:data'”
• Generating a executable binary package foo and a documentation one foo-doc:
• “-b’foo:bin,foo-doc:doc'”, or its short form “-b'-:-doc'”
• Generating a executable binary package foo, a library package libfoo1, and a library development
package libfoo-dev:
• “-b’foo:bin,libfoo1:lib,libfoo-dev:dev'” or its short form “-b'-,libfoo1,libfoo-dev'”
If the source tree contents do not match settings for type, the debmake command warns you.
-efoo@example.org, --emailfoo@example.org
set e-mail address.
The default is taken from the value of the environment variable $DEBEMAIL.
-f "firstnamelastname", --fullname "firstnamelastname"
set the fullname.
The default is taken from the value of the environment variable $DEBFULLNAME.
-i "buildtool", --invoke "buildtool"
invoke "buildtool" at the end of execution. buildtool may be “dpkg-buildpackage”, “debuild”,
“sbuild”, etc.
The default is not to execute any program.
Setting this option automatically sets the --local option.
-j, --judge
run dpkg-depcheck to judge build dependencies and identify file paths. Log files are in the parent
directory.
• package.build-dep.log: Log file for dpkg-depcheck.
• package.install.log: Log file recording files in the debian/tmp directory.
-l "license_file,...", --license "license_file,..."
add formatted license text to the end of the debian/copyright file holding license scan results.
The default is to add COPYING and LICENSE, and license_file needs to list only the additional file
names all separated by “,”.
-m, --monoarch
force packages to be non-multiarch.
-ofile, --optionfile
read optional parameters from file. (This is not for everyday use.)
The content of file is sourced as the Python code at the end of para.py. For example, the package
description can be specified by the following file.
para['desc'] = 'program short description'
para['desc_long'] = '''\
program long description which you wish to include.
.
Empty line is space + .
You keep going on ...
'''
-q, --quitearly
quit early before creating files in the debian/ directory.
-s, --spec
use upstream spec (pyproject.py for Python, etc.) for the package description.
-v, --version
show version information.
-w "addon,...", --with "addon,..."
add extra arguments to the --with option of the dh(1) command as addon in debian/rules.
The addon values are listed all separated by “,”, e.g., “-w"python3,autoreconf"”.
For Autotools based packages, autoreconf as addon to run “autoreconf-i-v-f” for every package
building is default behavior of the dh(1) command.
For Autotools based packages, if they install Python (version 3) programs, setting python3 as addon
to the debmake command argument is needed since this is non-obvious. But for pyproject.toml based
Python packages, setting python3 as addon to the debmake command argument is not needed since this is
obvious and the debmake command automatically set it to the dh(1) command.
-xn, --extran
generate configuration files as templates. (Please note debian/changelog, debian/control,
debian/copyright, and debian/rules are bare minimum configuration files to build a Debian binary
package.)
The number n determines which configuration templates are generated.
• -x0: all required configuration template files. (selected option if any of these files already
exist)
• -x1: all -x0 files + desirable configuration template files with binary package type supports.
• -x2: all -x1 files + normal configuration template files with maintainer script supports.
• -x3: all -x2 files + optional configuration template files. (default optuin)
• -x4: all -x3 files + deprecated configuration template files.
Some configuration template files are generated with the extra .ex suffix to ease their removal. To
activate these, rename their file names to the ones without the .ex suffix and edit their contents.
Existing configuration files are never overwritten. If you wish to update some of the existing
configuration files, please rename them before running the debmake command and manually merge the
generated configuration files with the old renamed ones.
-y, --yes
“force yes” for all prompts. (without option: “ask [Y/n]”; doubled option: “force no”)
-L, --local
generate configuration files for the local package to fool lintian(1) checks.
-P, --pedantic
pedantically check auto-generated files.
-T, --tutorial
output tutorial comment lines in template files. default when -x3 or -x4 is set.