From 38b90453bc26e73b827104219f1cfd014ea5f6ca Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 17 Jun 2018 02:34:29 -0400 Subject: Packaging voodoo to support same code version on multiple releases. reprepro strictly follows the Debian package rule that two package files which have the same name must have identical content. Which is fine, except when we want to support the same version of a package on multiple releases of the same Debian-flavored operating system. The usual hack for this is to add a release-specific tag to the end of the version string. The brute force way of doing this requires modifying the source package for each release, but there's an obscure hack which lets us augment the binary package versions directly. --- source/debian/rules | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/debian/rules') diff --git a/source/debian/rules b/source/debian/rules index 88d6c5a..a0c3a65 100755 --- a/source/debian/rules +++ b/source/debian/rules @@ -16,6 +16,23 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed # see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/default.mk +include /usr/share/dpkg/pkg-info.mk %: dh $@ --with python2 + +# Distinct binary package versions for a single source package built +# on multiple releases, to keep reprepro happy. See: +# +# https://unix.stackexchange.com/questions/31584/two-differently-versioned-binary-debian-packages-from-one-source#32377 +# https://salsa.debian.org/android-tools-team/android-sdk-meta/blob/master/debian/rules +# +# This relies on pbuilder-dist setting the DIST environment variable. +# Without that, we fall back to the default behavior. + +ifneq (,${DIST}) + +override_dh_gencontrol: + dh_gencontrol -- -v${DEB_VERSION}~${DIST} + +endif -- cgit v1.2.3