#!/usr/bin/make -f
# Copyright © 2017-2020 IOhannes m zmölnig
# under the LGPL-2.1+

DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

execute_after_dh_auto_build:
	dh_auto_build -- checkprograms

execute_after_dh_clean:
	-find man/ -type l -delete

execute_after_dh_install:
	find debian/libsndfile1-dev/ -name test_wrapper.sh -exec \
		sed -e 's|^\(ABS_TOP_SRCDIR\)=.*|\1=$$\(pwd\)|' -i {} +
	find debian/libsndfile1-dev/ -name pedantic-header-test.sh -exec \
		sed -e 's| -I *[^ ]*| |g' -i {} +
	find debian/libsndfile1-dev/usr/lib/ -name "*.sh" -exec \
		chmod +x {} +

licensecheck:
	licensecheck --check '.*' --recursive --deb-machine --lines 0 * \
		> debian/copyright_newhints
	cmp debian/copyright_hints debian/copyright_newhints \
		&& rm debian/copyright_newhints
