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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Makefile to build the nml debian package.
# Enable all hardening options (since nml processes potentially
# untrusted input).
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
# Use debhelper default for all targets (but some are overridden below).
%:
# Force the pybuild buildsystem, since there is also a
# Makefile (which is used only for testing by this rules file).
dh $@ --buildsystem pybuild
ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
# When terse is specified, pass --quiet to dh_auto_*, which gets passed
# on to pybuild. We cannot pass this directly to dh above, since:
# - Options passed to dh get wrapped on -O and are not passed on to the
# actual buildsystem.
# - If you work around that using DH_OPTIONS, you will be passing
# --quiet also to steps that do not understand it (e.g. clean).
#
# This stuff can be removed once dh-python starts handling this
# automatically: https://bugs.debian.org/945945
override_dh_auto_build:
dh_auto_build $@ -- --quiet
override_dh_auto_configure:
dh_auto_configure $@ -- --quiet
override_dh_auto_install:
dh_auto_install $@ -- --quiet
endif
ifeq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
# Enable verbose by *unsetting* _V, which defaults to a prefix that
# supresses verbose output
TEST_VERBOSE="_V="
endif
override_dh_auto_test:
if ! [ -d debian/original-pcx-files ]; then \
mkdir debian/original-pcx-files; \
mv regression/*.pcx debian/original-pcx-files; \
cp debian/fixed-pcx-files/*.pcx regression/; \
fi
# Regression testing is done through a Makefile. Set an env var
# to prevent python from generating pyc files all over the
# source tree well. We still run dh_auto_test here, so we don't
# need to check DEB_BUILD_OPTIONS for nocheck
PYTHONDONTWRITEBYTECODE=1 dh_auto_test --buildsystem makefile -- ${TEST_VERBOSE}
execute_after_dh_auto_clean:
# The distutils buildsystem doesn't know about the regression
# test, so we'll have to manually clean it.
make -C regression clean
if [ -d debian/original-pcx-files ]; then \
mv debian/original-pcx-files/*.pcx regression/; \
rmdir debian/original-pcx-files; \
fi
|