#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@

execute_before_dh_autoreconf:
	ln -s etc/configure.ac configure.ac

override_dh_auto_test:
	# Workaround for https://github.com/uutils/coreutils/issues/5162
	# use GNU coreutils fmt here
	mkdir -p debian/gnu-bin
	if command -v gnufmt >/dev/null 2>&1; then \
		ln -sf $$(command -v gnufmt) debian/gnu-bin/fmt; \
		PATH=$(CURDIR)/debian/gnu-bin:$$PATH dh_auto_test --no-parallel; \
	else \
		dh_auto_test --no-parallel; \
	fi

execute_after_dh_auto_install:
	rm -fv debian/tmp/usr/lib/*/*.la
	rm -fv debian/tmp/usr/share/man/man1/explain_license.1
	rm -fv debian/tmp/usr/share/man/man3/explain_license.3

override_dh_compress:
	dh_compress --exclude=.pdf
