【问题标题】:Create debian package from source file with multiple binaries从具有多个二进制文件的源文件创建 debian 包
【发布时间】:2018-05-04 18:30:36
【问题描述】:

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

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

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

欢迎任何帮助或指点。

【问题讨论】:

  • 您可以将源代码放在一个包中(实际上并没有做任何事情),然后为依赖于源包的每个二进制文件创建另一个包。我不知道这是你应该做的还是黑客攻击。
  • @nullqube 是的,这有点 RTFM,我已经阅读了 wiki 和很多其他内容,但我认为没有关于这个特定问题的信息。
  • @nwp 是的,这是一种方法。许多其他人在 Debian 中可用的 +30K 软件包中一定遇到过这个问题。

标签: linux debian package deb


【解决方案1】:

一个源包可以构建成多个二进制包(又名.deb-files,您可以安装它)。这确实是创建 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 提供这方面的信息。

【讨论】:

  • 非常感谢,这正是我想要的。我有很多红色文档,但从未找到此信息。再次感谢!
猜你喜欢
  • 2018-01-20
  • 1970-01-01
  • 1970-01-01
  • 2020-05-02
  • 2010-12-07
  • 1970-01-01
  • 2017-05-28
  • 1970-01-01
  • 2014-04-08
相关资源
最近更新 更多