#!/usr/bin/make -f
#export DH_VERBOSE=1

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

backupdir=$(CURDIR)/debian/auto_backup

%:
	dh $@

override_dh_clean:
	dh_clean
	if [ -d $(backupdir) ] ; then mv $(backupdir)/* $(CURDIR); rmdir $(backupdir) ; fi
	rm -f config.guess config.sub # somehow these files are changed anyway - removing is the easiest way

override_dh_autoreconf:
	mkdir -p $(backupdir)
	mv INSTALL Makefile.in aclocal.m4 autogen.sh compile config.h.in configure depcomp install-sh $(backupdir)
	dh_autoreconf
