How to create multiple debian packages using the same debian directory
I assume that your target program is a c/c++ or similar language.
-
You can include all files in one binary packages. But still the best to separate development files in another one.
*-dev
(not-devel
) should include only headers, statics libs, shared libs and even binary tools if these tools only used for development. -
You can declare multiple binaries packages for single source in
debian/control
. The best is to learn by example,samba
:<to editors please keep these links clear, I want to mention them> Source package: http://packages.ubuntu.com/source/focal/samba , see how many binary package built from same source.
Let choose one (main package, samba-*.deb): http://packages.ubuntu.com/focal/samba , see to right side
*-debian.tar.xz
. Download it then open it. Read itscontrol
file:Source: samba ... Package: samba ... Package: samba-libs ...
Each binary package has its own
*.install
file which list the files going to be installed and where. Example:samba.install
,samba-libs.install
, .. -
For libraries, static one included only in
*-dev
package.Shared ones should be included in both if you have different versions that could be installed in same time.
Example,
samba-dev
, at the bottom of the page click on list of files and this with static libs libc6-dev.Otherwise, put shared libs only in the regular binary package then add it as dependency for the development package.
References:
Dig The Code
Updated on September 18, 2022Comments
-
Dig The Code almost 2 years
I am packaging an application in my PC for installation/distribution purposes. I have created the package successfully using
dpkg
facility in ubuntu 12.04. Now I need to create multiple packages (binary package(like xxx.deb), source package(xxx.1.0-1-devel.deb)) using the same file set-up. Debian folder contains all modified files required for packaging usingdpkg-buildpackage -rfakeroot
. If I need to create all .deb files using the same debian file set-up. What should I additionally do ?additionally, below things also confused for me. what should include -devel package ? does it only development header files or development header files and required shared libraries or all binary files including header files ?
-
OrangeDog about 7 yearsI'm trying to get this working, building multiple packages of a shared source - similar to this. However,
dpkg-buildpackage
always gives an error e.g.dpkg-source: error: source package has two conflicting values - php-java-bridge and php-java-bridge-j2ee
. I don't even want to build the source package, but it's just won't work. -
user.dz about 7 years@OrangeDog, this answer is for multiple binaries with same compile options (regular case:
rules
file runs 1 compile cycle). However, your case needs to compile the source with different options for each binary (ie: multiple compile cycles). check this answer askubuntu.com/a/908351/26246 for similar case. Quick hint: notice the use ofconfigure-stamp
&build-stamp
inrules
file. -
OrangeDog about 7 yearsActually, it seems to be because the changelog doesn't match the source package name. I guess you're not allowed different changelogs for different packages like this?
-
user.dz about 7 years@OrangeDog, no need for multiple changelog files. changelog is related to debian source package (not the binaries). Because it's to document changes in debian packaging and debian patches (not the upstream dev). So it has to use the source package name. btw, parent folder should be also using name of source package.
-
troglobit over 6 yearsAwesome mini-howto here by @user.dz, thank you so much! :-)