#! /usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --parallel --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- \
		--enable-ld-version-script \
		--with-packager=Debian \
		--with-packager-bug-reports=https://bugs.debian.org/ \
		--with-packager-version="$(DEB_VERSION)"

# Texinfo PDF manual is not built by 'make' but removed by 'make clean'.
override_dh_auto_build:
	dh_auto_build
	make -C doc libidn2.pdf

override_dh_auto_clean:
	test ! -f Makefile || dh_auto_clean

override_dh_compress:
	dh_compress -Xlibidn2.pdf

override_dh_install:
	chrpath -d $(CURDIR)/debian/tmp/usr/lib/*/libidn2.so.*
	chrpath -d $(CURDIR)/debian/tmp/usr/bin/idn2
	dh_install
