aboutsummaryrefslogtreecommitdiff
path: root/source/debian
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2018-06-17 02:34:29 -0400
committerRob Austein <sra@hactrn.net>2018-06-17 02:34:29 -0400
commit38b90453bc26e73b827104219f1cfd014ea5f6ca (patch)
tree8c6ad50f316dabe583095cad29bc962f746eb9c0 /source/debian
parent24d90023742273179a4f7816a62d973188f7c3ed (diff)
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.
Diffstat (limited to 'source/debian')
-rwxr-xr-xsource/debian/rules17
1 files changed, 17 insertions, 0 deletions
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