Hide dbgsym metapackage behind DEB_BUILD_OPTIONS 03/7103/1
authorLuca Boccassi <luca.boccassi@gmail.com>
Mon, 12 Jun 2017 12:54:44 +0000 (13:54 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Mon, 12 Jun 2017 13:42:29 +0000 (14:42 +0100)
dbgsym packages go in the -debug section of the archive, and various
DDs and FTP Masters have strongly recommended to avoid uploading any
such metapackage to Main for this reason.
It can be still very useful for users and rebuilders, so leave it
disabled behind a dbgsym_meta DEB_BUILD_OPTIONS flag.

Change-Id: I112f3195755cc6bafef3167b39d3d47273572377
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
debian/rules

index bd5ec0b..33b98b5 100755 (executable)
@@ -113,17 +113,6 @@ DPDK_CONFIG_BUILD_KMOD=y
 # dpkg-genchanges, and also would require a lot of overrides for debhelpers.
 get_built_using        ?= $(filter-out (=),$(shell dpkg-query -f='$${source:Package} (=$${source:Version})' -W $1))
 
-override_dh_gencontrol:
-       dh_gencontrol
-       dh_gencontrol -p dpdk-modules-$(KVERS) -- \
-               -v`cat debian/VERSION` \
-               -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))'
-       ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym
-
-override_dh_builddeb:
-       dh_builddeb
-       dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym
-
 build:
        @if [ x"$(KVERS)" = x ] ; then \
            echo 'No version in $(KSRC)/include/linux/version.h' >&2; \
@@ -137,6 +126,29 @@ endif
 %:
        dh $@ --with python2,dkms
 
+override_dh_gencontrol:
+       dh_gencontrol
+ifneq (,$(findstring kernel_modules,$(DEB_BUILD_OPTIONS)))
+       dh_gencontrol -p dpdk-modules-$(KVERS) -- \
+               -v`cat debian/VERSION` \
+               -V'built:using:kernel=$(call get_built_using,linux-headers-$(KVERS))'
+endif
+ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS)))
+       ./debian/dh-dbgsym-metapkg libdpdk$(DPDK_ABI)-dbgsym
+endif
+
+# dbgsym_meta can be passed via DEB_BUILD_OPTIONS to enable building the
+# optional dbgsym meta package libdpdk<ABI>-dbgsym.
+# This is not built by default as it would go in main but depend on
+# packages in the debian-debug archive.
+# Debian Developers and FTP masters strongly discourage this.
+# We provide this optional flag as a convenience for rebuilders.
+ifneq (,$(findstring dbgsym_meta,$(DEB_BUILD_OPTIONS)))
+override_dh_builddeb:
+       dh_builddeb
+       dh_builddeb -plibdpdk$(DPDK_ABI)-dbgsym
+endif
+
 override_dh_auto_clean:
        rm -rf debian/build debian/tmp debian/dpdk-modules-* \
                debian/control.modules debian/VERSION