Ubuntu – How to create multiple debian packages using the same debian directory

dpkgpackage-managementpackaging

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 using dpkg-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 ?

Best Answer

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 its control 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: