#! /usr/bin/make -f ###-------------------------------------------------------------------------- ### Preliminary definitions. ## The multiarch triple. DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) a := $(DEB_HOST_MULTIARCH) ## My version number, shorn of the Debian package version if any. DEB_UPSTREAM_VERSION ?= \ $(shell dpkg-parsechangelog | \ sed -n "/^Version: \([^-]*\)\(-.*\)\?/s//\1/p") v := $(DEB_UPSTREAM_VERSION) ## Default Debhelper options. DH_OPTIONS = --parallel ## Default Debhelper actions. %:; dh $@ $(DH_OPTIONS) ###-------------------------------------------------------------------------- ### Multiple flavours. ## The various flavours of the library which we must build. FLAVOURS = noadns adns ## The build actions which we have to override. DH_BUILD_OVERRIDES = configure clean build install test ## How to perform build action for a particular library flavour. define flavour-build-action dh_auto_$1 -Bdebian/build-$2 \ $(DH_OPTIONS) $(DH_OPTIONS_$2) \ $(DH_$1_OPTIONS) $(DH_$1_OPTIONS_$2) endef ## Override the build actions, and perform the relevant action for each ## flavour in turn. $(foreach t, $(DH_BUILD_OVERRIDES), override_dh_auto_$t):: \ override_dh_auto_%: $(foreach f, $(FLAVOURS), $(call flavour-build-action,$*,$f)) ## Configuration options. DH_configure_OPTIONS = -- --libexecdir='$${libdir}' DH_configure_OPTIONS_noadns = --without-adns DH_configure_OPTIONS_adns = --with-adns ## Cleaning options. override_dh_auto_clean:: rm -rf debian/tmp-adns ## Installation options. DH_install_OPTIONS_adns = --destdir=debian/tmp-adns ###-------------------------------------------------------------------------- ### Additional tweaks. ## Override the shared-library dependency information to allow any flavour. override_dh_makeshlibs: dh_makeshlibs -V"mlib2 (>= $v) | mlib2-adns (>= $v)" ###----- That's all, folks --------------------------------------------------