第 2 章 概览

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

[base_dir] $ tar --xz -xvf package-1.0.tar.xz
[base_dir] $ cd package-1.0
[package-1.0] $ debmake
   ... Make manual adjustments of generated configuration files
[package-1.0] $ debuild

如果跳过了对生成的配置文件的手工调整流程,则最终生成的二进制软件包将缺少有意义的软件包描述信息,但是仍然能为 dpkg 命令所使用,在本地部署环境下正常工作。

[小心]小心

这里的 debmake 命令只提供一些不错的模板文件。如果生成的软件包需要发布出去供公众使用的话,这些模板文件必须手工调整至最佳状态以遵从 Debian 仓库的严格质量标准。

如果您在 Debian 打包方面还是个新手的话,此时不要过多在意细节问题,请先专注于理解整体的流程。

If you are familiar with Debian packaging, you’ll notice that debmake is similar to the dh_make command. This is because debmake is designed to replace the functionality historically provided by dh_make. [3]

debmake 命令设计提供如下特性与功能:

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

[提示]提示

Ensure that you properly quote the arguments of the -b, -f, and -w options to protect them from shell interference.

[提示]提示

非原生软件包是标准的 Debian 软件包。

[提示]提示

本文档中所有软件包构建示例的详细日志可以由 第 14.14 节 “细节” 一段给出的操作来获取。



[3] Before dh_make, the deb-make command was popular. The current debmake package starts its version from 4.0 to avoid version conflicts with the obsolete debmake package, which provided the deb-make command.