简体   繁体   English

使用多个二进制文件从源文件创建Debian软件包

[英]Create debian package from source file with multiple binaries

I have a C/C++ am autoconf source package for Linux that consist of several binaries, logical in development as many of them share the same source. 我有一个用于Linux的C / C ++ amautoconf源程序包,它由几个二进制文件组成,在开发中是合乎逻辑的,因为许多二进制文件共享同一源代码。 Some binaries run in a graphical environment, some are server components, some drivers for the server, libs and others are shell commands. 一些二进制文件在图形环境中运行,一些是服务器组件,一些用于服务器的驱动程序,库,而另一些则是Shell命令。 I would like to make a proper debian package for this system (I already have a working checkinstall based install). 我想为此系统制作一个合适的debian软件包(我已经有一个基于checkinstall的有效安装)。

If I follow the Debian tutorials I can make a package for for all binaries in one. 如果遵循Debian教程,则可以为所有二进制文件打包一个软件包。 But how do I do if I want to make a package that just install one binary component? 但是,如果我想制作一个仅安装一个二进制组件的软件包,该怎么办? In my case installing graphical stuff separate from non-graphical stuff. 就我而言,安装图形素材和非图形素材是分开的。

As it looks from the tutorials I need to make a separate source package for each package I want to maintain but that sounds stupid and I must have missed something. 从教程中可以看出,我需要为要维护的每个程序包制作一个单独的源程序包,但这听起来很愚蠢,我一定错过了一些东西。

Any help or pointers are welcome. 欢迎任何帮助或指点。

A single source package can be build into multiple binary packages (aka .deb -files, which you can install). 可以将一个源程序包构建到多个二进制程序包中(也可以安装.deb -files)。 This is indeed a very common pattern when creating Debian packages. 在创建Debian软件包时,这确实是非常常见的模式。

To create multiple binary packages, you need to add a section for each of them to your debian/control file. 要创建多个二进制软件包,您需要为它们的每个部分添加一个部分到您的debian/control文件中。 Something like: 就像是:

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

In the simplest case you then need to specify which files go into which package: 在最简单的情况下,您需要指定将哪些文件放入哪个包中:

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

Of course there is plenty of documentation available about this. 当然,有很多关于此的文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM