从具有多个二进制文件的源文件创建 debian 包

Create debian package from source file with multiple binaries

我有一个用于 Linux 的 C/C++ am autoconf 源代码包,它由几个二进制文件组成,在开发中合乎逻辑,因为其中许多共享相同的源代码。图形环境中的一些二进制文件 运行,一些是服务器组件,一些服务器驱动程序,库和其他是 shell 命令。我想为这个系统制作一个合适的 debian 包(我已经有一个基于检查安装的有效安装)。

如果我遵循 Debian 教程,我可以为所有二进制文件制作一个包。但是如果我想制作一个只安装一个二进制组件的包怎么办?在我的例子中,将图形内容与非图形内容分开安装。

从教程中可以看出,我需要为我想要维护的每个包制作一个单独的源包,但这听起来很愚蠢,我一定是错过了什么。

欢迎任何帮助或指点。

一个源代码包可以构建成多个二进制包(又名 .deb-文件,您可以安装)。这确实是创建 Debian 软件包时非常常见的模式。

要创建多个二进制包,您需要在 debian/control 文件中为每个包添加一个部分。类似于:

Source: foobar
Section: utils
Priority: optional
Maintainer: me@example.com
Build-Depends:
 debhelper (>= 10~),
Standards-Version: 4.1.1
Homepage: https://github.com/foobar/foobar

Package: foobar
Section: utils
Architecture: any
Multi-Arch: same
Depends:
 foobar-common (= ${source:Version}),
 ${misc:Depends},
Description: foo bar baz
 bla bla bla

Package: foobar-data
Architecture: all
Depends:
 ${misc:Depends},
Description: foo bar baz (architecture independent files)
 libmysofa is a light weight C-library intended to read SOFA (Spatially Oriented
 bla bla bla.
 .
 this package contains the binary independent parts

在最简单的情况下,您需要指定将哪些文件放入哪个包:

$ cat debian/foobar.install
foobar usr/bin/
foobar.1 usr/share/man/man1/
$ cat debian/foobar-data.install
data/* usr/share/foobar/
$

当然有plenty of documentation可用。