At the moment I build and package our software for Ubuntu 14.04 aka 'trusty' via dpkg-buildpackage
. I get a .deb
package that can be installed on Ubuntu 14.04 but also on other Ubuntu releases e.g. 12.04 aka 'precise'. This is dangerous as the software can be installed without error message but the program is unable to run/work correctly.
Dependencies of my package are given in the control
file. However this file does not let me enter a distribution/codename of Ubuntu. The distribution may be entered as part of the *.changes
but this is not reflected anywhere in the .deb file. Checking the complex dependency situation during the post-install script is complex too. Thus I want an easy way to prevent an installation of an Ubuntu package on the wrong Ubuntu release.
What is the best way to build a package that targets a single Ubuntu release only? In the best case (1) the installation should only work on the targeted Ubuntu release and (2) the .deb
package contains the distribution name*, e.g. like package_1.0.0-3_trusty_amd64.deb
.
(*) Otherwise the apt repository managed via reprepro
cannot have two packages with the same version number, each targeting a different Ubuntur release.
Thanks in advance.
Update:
The debian/control
file of my package:
Source: mypackage
Priority: extra
Build-Depends: debhelper (>= 9), python (>=2.7), pyside-tools
X-Python-Version: >= 2.7
Standards-Version: 3.9.2
Package: mypackage
Architecture: amd64
Depends: ros-indigo-desktop-full|ros-hydro-desktop-full, ros-indigo-rqt|ros-hydro-rqt, ros-indigo-gps-umd|ros-hydro-gps-umd, ros-indigo-map-server|ros-hydro-map-server, imagemagick, octave (>= 3.6), libdc1394-22, sox, tree, python (>=2.7), python-psutil, python-usb, python-serial, python-gi, gir1.2-gexiv2-0.10|gir1.2-gexiv2-0.4, exfat-fuse|fuse-exfat, exfat-utils, gphotofs, python-pyproj, libusb-1.0-0 (>=2:1.0.17), libpyside1.2|libpyside1.1 (>=1.1.2), ${shlibs:Depends}, ${misc:Depends}
Description: ...
As one can see this control file was adapted such that we can run the build on multiple Ubuntu releases where the dependencies have different version numbers: libpyside1.2|libpyside1.1 (>=1.1.2)
. Is there a better way to handle this?
debian
folder for all releases, then that would be the only way (unless you have a script that changes the dependencies for each particular version). Alternatively, you can have adebian
folder (or, for this case, adebian/control
file) for each separate version.debian/
directories or differentcontrol
files? I have not found a command line option that allowsdpkg-buildpackge
to use a different directory.