#!/usr/bin/make -f
# -*- makefile -*-

export LC_ALL := C.UTF-8
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
	dh_autoreconf ./bootstrap

override_dh_autoreconf_clean:
	rm -f compile depcomp ltmain.sh config.sub missing config.guess \
                install-sh m4/ltoptions.m4 m4/ltversion.m4 m4/libtool.m4 \
                m4/ltsugar.m4 m4/lt\~obsolete.m4
	dh_autoreconf_clean

override_dh_gencontrol:
	dh_gencontrol -- \
	  -Vlib:Depends=$(shell dpkg-query -W -f '$${Depends}' libtss2-dev \
			| sed -E 's/.*(libtss2-esys-[[:alnum:].-]+).*/\1/')
