#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

export PVER=$(shell dpkg-parsechangelog --show-field version | cut -d"-" -f1)

%:
	dh $@ --with autoreconf

override_dh_auto_configure:
	dh_auto_configure -- LDFLAGS="$(LDFLAGS) -Wl,--as-needed,-z,defs" \
		--enable-s3=yes --enable-python=no --enable-static=no \
		--enable-shared=yes

override_dh_auto_install:
	dh_auto_install
	chrpath -d debian/tmp/usr/bin/*
	set -e; for file in `ls debian/tmp/usr/lib/*/*.la`; do \
		sed -i "/dependency_libs/ s/'.*'/''/" $$file ; \
	done

override_dh_auto_test:
	# do nothing

override_dh_strip:
	dh_strip -a --dbg-package=afflib-dbg

override_dh_makeshlibs:
	dh_makeshlibs -- -v$(PVER)
