3 ###--------------------------------------------------------------------------
4 ### Preliminary definitions.
6 ## The multiarch triple.
7 DEB_HOST_MULTIARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_MULTIARCH
)
8 a
:= $(DEB_HOST_MULTIARCH
)
10 ## My version number, shorn of the Debian package version if any.
11 DEB_UPSTREAM_VERSION ?
= \
12 $(shell dpkg-parsechangelog | \
13 sed
-n
"/^Version: \([^-]*\)\(-.*\)\?/s//\1/p")
14 v
:= $(DEB_UPSTREAM_VERSION
)
16 ## Default Debhelper options.
17 DH_OPTIONS
= --parallel
19 ## Default Debhelper actions.
20 %:; dh
$@
$(DH_OPTIONS
)
22 ###--------------------------------------------------------------------------
23 ### Multiple flavours.
25 ## The various flavours of the library which we must build.
26 FLAVOURS
= noadns adns
28 ## The build actions which we have to override.
29 DH_BUILD_OVERRIDES
= configure
clean build
install test
31 ## How to perform build action for a particular library flavour.
32 define flavour-build-action
33 dh_auto_
$1 -Bdebian
/build-
$2 \
34 $(DH_OPTIONS
) $(DH_OPTIONS_
$2) \
35 $(DH_
$1_OPTIONS) $(DH_
$1_OPTIONS_$2)
39 ## Override the build actions, and perform the relevant action for each
41 $(foreach t
, $(DH_BUILD_OVERRIDES
), dh-
$t-hook
):: %:; @
:
42 $(foreach t
, $(DH_BUILD_OVERRIDES
), override_dh_auto_
$t): \
43 override_dh_auto_
%: dh-
%-hook
44 $(foreach f
, $(FLAVOURS
), $(call flavour-build-action
,$*,$f))
46 ## Configuration options.
47 DH_configure_OPTIONS
= -- --libexecdir
='$${libdir}'
48 DH_configure_OPTIONS_noadns
= --without-adns
49 DH_configure_OPTIONS_adns
= --with-adns
53 rm -rf debian
/tmp-adns
55 ## Installation options.
56 DH_install_OPTIONS_adns
= --destdir
=debian
/tmp-adns
58 ###--------------------------------------------------------------------------
59 ### Additional tweaks.
61 ## Some of the install lists need to be generated. This is a little
63 GEN_INSTALL_PKGS
= mlib2-adns
64 GEN_INSTALL_FILES
= $(foreach p
, $(GEN_INSTALL_PKGS
), debian
/$p.
install)
65 $(GEN_INSTALL_FILES
): debian
/%.
install: \
66 debian
/%.
install.in debian
/changelog debian
/rules
67 sed
's,@ARCH@,$a,g' $< >$@.new
&& mv
$@.new
$@
68 dh-install-hook
:: $(GEN_INSTALL_FILES
); @
:
70 rm -f
$(GEN_INSTALL_FILES
)
72 ## Override the shared-library dependency information to allow any flavour.
73 override_dh_makeshlibs
:
74 dh_makeshlibs
-V
"mlib2 (>= $v) | mlib2-adns (>= $v)"
76 ###----- That's all, folks --------------------------------------------------