Creating multiple packages with dpkg-buildpackage

家住魔仙堡 提交于 2019-12-25 02:26:52

问题


I have a source tree structure like -

/src 
   /moduleA
   /moduleB
   /common

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

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

Thanks!


回答1:


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>

(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

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



来源:https://stackoverflow.com/questions/24670630/creating-multiple-packages-with-dpkg-buildpackage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!