使用dpkg-buildpackage创建多个包 [英] Creating multiple packages with dpkg-buildpackage

查看:2525
本文介绍了使用dpkg-buildpackage创建多个包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个源代码树结构,如 -

I have a source tree structure like -

/src 
   /moduleA
   /moduleB
   /common

其中moduleA和moduleB需要单独打包但共享通用代码。

where moduleA and moduleB need packaged separately but share the common code.

是否可以使用dpkg-buildpackage创建2个独立的二进制包?

Is it possible to create 2 separate binary packages using dpkg-buildpackage?

谢谢!

推荐答案

这是可能的。为了做到这一点,你应该修改控制文件。
当您使用 dh_make -s 时,您可以使用以下内容:

It is possible. In order to do it, you should modify the control file. When you use dh_make -s, you have something like :

Source: yourpackage
Section: unknown
Priority: optional
Maintainer: toto <toto@unknown>
Build-Depends: debhelper (>= 8.0.0), autotools-dev
Standards-Version: 3.9.4
Homepage: <insert the upstream URL, if relevant>
#Vcs-Git: git://git.debian.org/collab-maint/libsnow.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/libsnow.git;a=summary

Package: yourpackage
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>

所有你需要做的是添加一个这样的段落:

All you have to do is to add a paragraph like that :

Package: yourpackagebis
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>
 <insert long description, indented with spaces>

(我应该提醒您,您只能使用小写字符作为包的名称)。一旦你这样做,你必须指定哪个文件将去哪里。您必须创建四个新文件:yourpackage.dirs,yourpackage.install,yourpackagebis.dirs和yourpackagebis.install。在yourpackage.dirs中,您必须指定需要创建的目录(每行一个)。在yourpackage.install中,你必须告诉dpkg-buildpackage你应该把包中的哪些文件放在你的包中,以及哪里。它必须采用以下格式(每行一个):

(I should warn you, you can only use lowercase characters for the package's name). Once you've done that, you have to specify which file will go where. You have to create four new files : yourpackage.dirs, yourpackage.install, yourpackagebis.dirs, and yourpackagebis.install. In yourpackage.dirs, you have to specify what are the directories you need to create (one per line). In yourpackage.install, you have to tell dpkg-buildpackage what files should be put in the package yourpackage, and where. It must be in the following format (one per line):

moduleA/foo usr/bin

(假设你的makefile在src /中,可以是usr / bin以外的东西)。
yourpackagebis.dirs和yourpackagebis.install的工作方式与packagepackpackbis相同。

(assuming your makefile is in src/. It can be something else than usr/bin). yourpackagebis.dirs and yourpackagebis.install works the same way for the package yourpackagebis.

这篇关于使用dpkg-buildpackage创建多个包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆