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
|
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LDFLAGS += -Wl,--as-needed
WAF_OPTIONS = --verbose --destdir=debian/tmp --prefix=/usr --enable-fftw3f
WAF_OPTIONS += --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
WAF_CMD = python3 ./waf
export PYBUILD_NAME=aubio
export PYBUILD_AFTER_INSTALL_python2=rm -vrf '{destdir}/usr/bin'
export PYBUILD_AFTER_INSTALL_python3=mv '{destdir}/usr/bin/aubio' '{destdir}/usr/bin/aubiocut' '{dir}/debian/tmp/usr/bin'
export PYBUILD_BEFORE_TEST=make create_test_sounds
export PYBUILD_AFTER_TEST=rm -rf '{dir}/python/tests/sounds'
%:
dh $@ --with python3 --buildsystem=pybuild
execute_after_dh_auto_clean:
-$(WAF_CMD) distclean
rm -rf python/ext/config.h
rm -rf aubio.egg-info/
rm -f this_version.pyc
rm -f waf_gensyms.pyc
rm -rf python/tests/sounds
rm -rf .cache/ .pytest_cache/
rm -rf waflib/*/__pycache__/
rm -rf ./__pycache__/
# extra rules to remove files manually
#-find waf -name '*.pyc' -delete
#rm -rf .waf* .lock-waf*
#rm -rf build/ dist/ .waf* .lock-waf*
#rm -rf python/gen/ aubio.egg-info
#rm -rf python/lib/*.pyc python/lib/aubio/*.so
#rm -rf debian/tmp
#rm -rf manpages.refs manpages.links
override_dh_auto_configure:
$(WAF_CMD) configure $(WAF_OPTIONS)
execute_before_dh_auto_build:
@echo "blhc: ignore-line-regexp: ^\[[ 0-9]+/[ 0-9]+\] Compiling .*"
$(WAF_CMD) build $(WAF_OPTIONS)
override_dh_auto_test:
# run tests
LD_LIBRARY_PATH=$(CURDIR)/build/src:$(LD_LIBRARY_PATH) \
dh_auto_test -- --test-pytest --test-args $(CURDIR)/python/tests/
execute_before_dh_auto_install:
# library
$(WAF_CMD) install $(WAF_OPTIONS)
################ d/copyright helper ##############
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = \
debian/.*
# licensecheck v1
.PHONY: licensecheck
licensecheck:
LANG=C.UTF-8 licensecheck \
-i "^($(DEB_COPYRIGHT_CHECK_IGNORE_REGEX))$$" \
--check '.*' --recursive --deb-machine --lines 0 * \
> debian/copyright_newhints
cmp debian/copyright_hints debian/copyright_newhints \
&& rm debian/copyright_newhints
|