內容目錄
debmake [-h] [-n] [-p package] [-u version] [-r revision] [-z extension] [-b "binarypackage[:type], …]" [-D value] [-e foo@example.org] [-f "firstname lastname"] [-i [debuild|sbuild|dgit sbuild|gbp buildpackage|dpkg-buildpackage| …]] [-m] [-q] [-v] [-V] [-w "addon, …"] [-x [01234]] [-y] [-B] [URL]
debmake helps to build the Debian package from the upstream source.
Normally, this is done as follows:
The upstream source is obtained as a tarball from a remote web site or a cloned work tree using “git clone”.
debmake is typically invoked in the source directory without any argument.
Also, debmake can be invoked with an argument. This argument can be URL for a tarball hosted on a remote web site or for a source code accessed by “git clone”; or local PATH to the tarball or the source code.
Arguments to -b, -f, and -w options need to be quoted to protect them from the shell.
Other tools also offer ways to obtain the upstream tarball and creating required symlink to build a Debian package depending on your workflow. For example, origtargz, mk-origtargz, git-deborig, and pristine-tar.
-n, --native make a native source package without .orig.tar.xz
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:
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:
Generating an executable (python3) binary package python3-foo:
Generating a data package foo:
Generating a executable binary package foo and a documentation one foo-doc:
Generating a executable binary package foo, a library package libfoo1, and a library development package libfoo-dev:
如果原始碼樹的內容和型別的設定不一致,debmake 命令會發出警告。
set e-mail address
預設值為環境變數 $DEBEMAIL 的值。
set the fullname
預設值為環境變數 $DEBFULLNAME 的值。
set additional “dh --with” option arguments in debian/rules
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.
generate extra configuration files as templates (default: 2)
Please note debian/changelog, debian/control, debian/copyright, debian/rules, and debian/source/format are required configuration files to build a modern Debian binary package.
The number determines which configuration templates are generated.
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.
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 installing into 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.
For a typical C program source tree packaged with autoconf/automake:
For a typical Python (version 3) module source tree:
For a typical Python (version 3) module in the package-version.tar.xz archive:
For a typical Perl module in the package-version.tar.xz archive:
打包工作也許需要額外安裝一些專用的幫助套件。
Although debmake is meant to provide template files for the package maintainer to work on, actual packaging activities are often performed without using debmake while referencing only existing similar packages and “Debian Policy Manual”. All template files generated by debmake are required to be modified manually.
There are some points for debmake:
組成 Debian 套件名稱的字元選取存在一定的限制。最明顯的限制應當是套件名稱中禁止出現大寫字母。這裡給出正則表示式形式的規則總結:
[-+.a-z0-9]{2,}
[-+.a-z0-9]{2,}
[0-9][-+.:~a-z0-9A-Z]*
[0-9][+.~a-z0-9A-Z]*
See the exact definition in “Chapter 5 - Control files and their fields” in the “Debian Policy Manual”.
debmake assumes relatively simple packaging cases. So all programs related to the interpreter are assumed to be “Architecture: all”. This is not always true.
請使用 reportbug 命令報告 debmake 套件的問題與錯誤。
環境變數 $DEBUG 中設定的字元用來確定日誌輸出等級。
Use this feature as:
[base_dir] $ export DEBUG=spd; debmake ...
or
[base_dir] $ debmake -D spd ...
See README.md in the source for more.
Copyright © 2014-2026 Osamu Aoki <osamu@debian.org>
The debmake-doc package provides the “Guide for Debian Maintainers” in plain text, HTML and PDF formats under the /usr/share/doc/debmake-doc/ directory.
See also licensecheck(1), lrc(1), dpkg-source(1), deb-control(5), debhelper(7), dh(1), dpkg-buildpackage(1), debuild(1), quilt(1), dpkg-depcheck(1), sbuild(1), gbp-buildpackage(1), and gbp-pq(1) manpages.