#!/usr/bin/make -f

# Aim for the top, adapt if anything should break on the buildds.
DEB_BUILD_MAINT_OPTIONS=	hardening=+all
export DEB_BUILD_MAINT_OPTIONS

include /usr/share/dpkg/default.mk

include /usr/share/debhelper/dh_package_notes/package-notes.mk

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- --without-openssl --with-nettle \
		--enable-bsdtar=shared --enable-bsdcpio=shared \
		--enable-bsdcat=shared --enable-bsdunzip=shared

override_dh_autoreconf:
	dh_autoreconf build/autogen.sh

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

execute_before_dh_install:
	find debian -name '*.la' -delete

override_dh_auto_test:
	_VERBOSITY_LEVEL=1 dh_auto_test || { \
		find "$${TMP-$${TMPDIR-$${TEMP-$${TEMPDIR-/tmp}}}}" -xdev -type f -path '*/*_test.*-*T*-*/*' -exec grep -EHe '^' -- '{}' +; \
		false; \
	}

execute_after_dh_installchangelogs:
	set -e; for p in $$(dh_listpackages); do \
		install -m 644 NEWS debian/$$p/usr/share/doc/$$p/; \
	done
