1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
# DEB_BUILD_OPTIONS=parallel=N
PARALLEL = $(subst parallel=,-j,$(filter parallel=%,${DEB_BUILD_OPTIONS}))
# the main python version (single)
PYVER=$(shell py3versions -vd)
# extra python versions to build if any (plural)
# To enable multiple pyversions:
# Build-Depends: python3-all-dev vs python3-dev in d/control.
#PYVERS=$(filter-out ${PYVER},$(shell py3versions -vs))
# This does not (yet) work for different python versions, b/c each next install
# rule below overrides python module files installed by the previous install,
# so we end up with just the last module. Also, the upstream build system has
# bugs building pyldns in a subdir.
# We can do a loop over $PYVERS in build target and run make _ldns.la in turn,
# with all python-related definitions taken directly from python$vers-config,
# removing ldns_wrapper.*o before each step, and saving resulting _ldns.la
# under a version-specific name. But this is too ugly already. Upstream should
# grow up a real module description file like setup.py and whole thing will be
# built automatically from there instead of using all the wrong custom
# commands, and it will automatically build things for multiple versions too,
# so we'll no need to override many targets in there.
# For now, build only for a single pyversion is supported.
PYVERS=
CONFIGFLAGS=--disable-rpath --enable-ed25519 --disable-ldns-config \
--with-trust-anchor=/usr/share/dns/root.key
build-arch build-indep build \
install-indep install-arch install \
binary-arch binary-indep binary \
clean \
: %:
dh $@
.PHONY: build-arch build-indep build \
install-indep install-arch install \
binary-arch binary-indep binary \
clean
override_dh_auto_configure:
PYTHON_VERSION=${PYVER} dh_auto_configure -B build/main -- $(CONFIGFLAGS) --with-examples --with-drill --with-pyldns --disable-gost
for pyvers in $(PYVERS); do \
PYTHON_VERSION=$$pyvers dh_auto_configure -B build/python-$$pyvers -- $(CONFIGFLAGS) --with-pyldns; \
done
override_dh_auto_build:
${MAKE} -C build/main ${PARALLEL} all doc
for pyvers in $(PYVERS); do \
${MAKE} -C build/python-$$pyvers pyldns;\
done
override_dh_auto_install:
${MAKE} -C build/main DESTDIR=${CURDIR}/debian/tmp install install-doc
for pyvers in $(PYVERS); do \
${MAKE} DESTDIR=${CURDIR}/debian/tmp -C build/python-$$pyvers install-pyldns install-pyldnsx;\
done
# upstream wrongly builds static library for the python module (.a & .la)
rm -fv debian/tmp/usr/lib/python*/*-packages/_ldns.*a
override_dh_auto_clean:
rm -rf build/
# generated even when doing build in a separate directory:
rm -f contrib/python/ldns.py contrib/python/ldns_wrapper.c
override_dh_auto_test:
# tests in Makefile.in are not distributed
|