第 2 章 概览

package-1.0.tar.gz,一个包含了简单的、符合 GNU 编码标准” 和 FHS(文件系统层级规范) 的 C 语言源代码的程序来说,它在 Debian 下打包工作可以按照下列流程,使用 debmake 命令进行。

 $ tar -xvzf package-1.0.tar.gz
 $ cd package-1.0
 $ debmake
   ... Make manual adjustments of generated configuration files
 $ 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, etc.

[提示]提示

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

[提示]提示

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

[提示]提示

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

[注意]注意

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



[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.