章 2. 概覽

The Debian packaging of the package-1.0.tar.gz, containing a simple C source following the GNU Coding Standards” and FHS, can be done with the debmake command as follows.

 $ tar -xvzf package-1.0.tar.gz
 $ cd package-1.0
 $ debmake
   ... Make manual adjustments of generated configuration files
 $ debuild

如果跳過了對生成的配置檔案的手工調整流程,則最終生成的二進位制套件將缺少有意義的套件描述資訊,但是仍然能為 dpkg 命令所使用,在本地部署環境下正常工作。

[注意]注意

The debmake command only provides decent template files. These template files must be manually adjusted to their perfection to comply with the strict quality requirements of the Debian archive, if the generated package is intended for general consumption.

如果您在 Debian 打包方面還是個新手的話,此時不要過多在意細節問題,請先確立一個大致流程的印象。

If you have been exposed to Debian packaging, this looks vgry much like the dh_make command. This is because the debmake command is intended to replace functions offered historically by the dh_make command. [3]

debmake 命令設計提供如下特性與功能:

The debmake command delegates most of the heavy lifting to its back-end packages: debhelper, dpkg-dev, devscripts, sbuild, schroot, etc.

[提示]提示

請確保將 -b-f-l-w 選項的引數使用引號合適地保護起來,以避免 shell 環境的干擾。

[提示]提示

非原生套件是標準的 Debian 套件。

[提示]提示

The detailed log of all the package build examples in this document can be obtained by following the instructions in 節 13.14, “細節”.

[注意]注意

The generation of the debian/copyright file, and the outputs from the -c (see 節 15.3, “debmake -cc) and -k (see 節 15.6, “debmake -k) options involve heuristic operations on the copyright and license information. They may produce some erroneous results.



[3] 歷史上還存在過 deb-make 命令,它在 dh_make 之前曾經流行過。當前的 debmake 套件的版本從 4.0 起始,其目的便是避免和廢棄的 debmake 套件的版本產生重疊。舊有的對應套件提供了 deb-make 命令。