#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

override_dh_auto_configure:
#Avoid conflicting with upstreams build system

override_dh_auto_test:
#Upstream states test is only for their local development not a functional test

override_dh_auto_build:
	$(MAKE)
	cd doc && $(MAKE) festival.info festival.html festival.ps

override_dh_auto_clean:
	-QUILT_PATCHES=debian/patches quilt push 01-config_config.diff
	[ ! -f Makefile ] || $(MAKE) clean

override_dh_clean:
	find . -name make.depend -print0 | xargs -0r $(RM)
	find . -name make.include -print0 | xargs -0r $(RM)
	find bin/ \( -name SCCS -o -name RCS -o -name CVS \) -prune \
	     -o -type f ! -name Makefile -print0 | xargs -0r $(RM)
	dh_clean

override_dh_installinit:
#Init script has BAD security Debian switches it off by default

override_dh_installchangelogs:
	dh_installchangelogs -a -k NEWS
	dh_installchangelogs -pfestival-doc -a -k NEWS

override_dh_installexamples:
	dh_installexamples -pfestival examples/* -Xexamples/text2utt -Xexamples/text2wave debian/festival.init debian/festival.scm

%:
	dh $@ --ddeb-migration='festival-dbg (<< 1:2.4~release-3~)'
#
