#!/usr/bin/make -f

export DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND  = -Wall -pedantic
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

%:
	dh $@

override_dh_autoreconf:
	dh_autoreconf ./autogen.sh

override_dh_auto_configure:
	dh_auto_configure -- --prefix=/usr --sysconfdir=/etc --enable-test=yes

override_dh_clean:
	#removing files generated by autogen.sh
	rm -fr build-aux/
	rm -fr m4/*
	rm -fr Documentation/Makefile.in
	rm -fr Makefile.in
	rm -fr aclocal.m4
	rm -fr autom4te.cache
	rm -fr config.h.in
	rm -fr configure
	rm -fr accfg/lib/Makefile.in
	rm -fr accfg/Makefile.in
	rm -fr test/Makefile.in
	# created by tests and not cleaned up after
	rm -fr version.m4
	rm -fr Documentation/accfg/asciidoc.conf
	rm -fr Documentation/accfg/Makefile.in
	rm -fr config.log
	dh_clean

override_dh_install:
	find debian/tmp -name '*.la' -print -delete
	dh_install

override_dh_fixperms:
	dh_fixperms -X2g2q_user_1.conf -X2g2q_user_2.conf

override_dh_makeshlibs:
	dh_makeshlibs -- -c4

#override_dh_missing:
	dh_missing --fail-missing
