debmake [-h] [-c | -k] [-n | -a package-version.orig.tar.gz | -d | -t ] [-p package] [-u version] [-r revision] [-z extension] [-b "binarypackage, …]" [-e foo@example.org] [-f "firstname lastname"] [-i "buildtool" | -j] [-l license_file] [-m] [-o file] [-q] [-s] [-v] [-w "addon, …"] [-x [01234]] [-y] [-L] [-P] [-T]
debmake helps to build the Debian package from the upstream source. Normally, this is done as follows:
请确保将 -b、-f、-l 和 -w 选项的参数使用引号合适地保护起来,以避免 shell 环境的干扰。
scan source for copyright+license text and exit.
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.
make a native Debian source package without .orig.tar.gz. This makes the “3.0 (native)” format package.
If you are thinking to package a Debian specific source tree with debian/* in it into a native Debian package, please think otherwise. You can use the “debmake -d -i debuild” or “debmake -t -i debuild” commands to make the “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 the downstream distributions.
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 all cases 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.
run the “make dist” 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 “make dist” command equivalents. (automake/autoconf, Python distutils, …)
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/)
set the binary package specs by the comma separated list of binarypackage:type pairs, e.g., in the full form “foo:bin,foo-doc:doc,libfoo1:lib,libfoo1-dbg:dbg,libfoo-dev:dev” or in the short form “,-doc,libfoo1,libfoo1-dbg, libfoo-dev”.
Here, binarypackage is the binary package name; and the optional type is chosen from the following type values:
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. For example, libfoo sets type to lib, and font-bar sets type to data, …
If the source tree contents do not match settings for type, the debmake command warns you.
set e-mail address.
The default is taken from the value of the environment variable $DEBEMAIL.
set the fullname.
The default is taken from the value of the environment variable $DEBFULLNAME.
invoke "buildtool" at the end of execution. buildtool may be “dpkg-buildpackage”, “debuild”, “pdebuild”, “pdebuild --pbuilder cowbuilder”, etc..
The default is not to execute any program.
Setting this option automatically sets the --local option.
run dpkg-depcheck to judge build dependencies and identify file paths. Log files are in the parent directory.
add formatted license text to the end of the debian/copyright file holding license scan results
The default is add COPYING and LICENSE and license_file needs to list only the additional file names all separated by “,”.
read optional parameters from the file. (This is not for everyday use.)
The file is sourced as the Python3 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 ... '''
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 "python2,autoreconf"”.
For Autotools based packages, setting autoreconf as addon forces to run “autoreconf -i -v -f” for every package building. Otherwise, autotools-dev as addon is used as default.
For Autotools based packages, if they install Python programs, python2 as addon is needed for packages with “compat < 9” since this is non-obvious. But for setup.py based packages, python2 as addon is not needed since this is obvious and it is automatically set for the dh(1) command by the debmake command when it is required.
generate extra configuration files as templates.
The number n changes which configuration templates are generated.
For a well behaving source, you can build a good-for-local-use installable single Debian binary package easily with one command. Test install of such a package generated in this way offers a good alternative to the traditional “make install” command to the /usr/local directory since the Debian package can be removed cleanly by the “dpkg -P …” command. Here are some examples of how to build such test packages. (These should work in most cases. If the -d option does not work, try the -t option instead.)
For a typical C program source tree packaged with autoconf/automake:
For a typical python module source tree:
For a typical python module in the package-version.tar.gz archive:
For a typical perl module in the Package-version.tar.gz archive:
Packaging may require installation of some additional specialty helper packages.
debmake 的目的是为软件包维护者提供开始工作的模板文件。注释行以 # 开始,其中包含一些教程性文字。您在将软件包上传至 Debian 仓库之前必须删除或者修改这样的注释行。
许可证信息的提取和指派过程应用了大量启发式操作,因此在某些情况下可能不会正常工作。强烈建议您搭配使用其它工具,例如来自 devscripts 软件包的 licensecheck 工具,以配合 debmake 的使用。
组成 Debian 软件包名称的字符选取存在一定的限制。最明显的限制应当是软件包名称中禁止出现大写字母。下面给出正则表达式形式的规则总结。
请在“Debian 政策手册”的 第 5 章 - Control 文件及其字段 一节中查看其精确定义。
debmake 所假设的打包情景是相对简单的。因此,所有与解释器相关的程序都会默认为“Architecture: all”的情况。当然,这个假设并非总是成立。
Please report bugs to the debmake package using the reportbug command.
The character set in the environment variable $DEBUG determines the logging output level.
Use this as:
$ DEBUG=pdfbmeclak debmake ...
See README.developer in the source for more.
Copyright © 2014-2015 Osamu Aoki <osamu@debian.org>
The debmake-doc package provides the “Guide for Debian Maintainers” in the plain text, HTML and PDF formats under the /usr/share/doc/debmake-doc/ directory.
Also, please read the original Debian New Maintainers’ Guide provided by the the maint-guide package.
See also dpkg-source(1), deb-control(5), debhelper(7), dh(1), dpkg-buildpackage(1), debuild(1), quilt(1), dpkg-depcheck(1), pdebuild(1), pbuilder(8), cowbuilder(8), gbp-buildpackage(1), gbp-pq(1), and git-pbuilder(1) manpages.