#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_build: patch_center-cwheib.stamp
	dh_auto_build

override_dh_auto_clean: unpatch_center-cwheib
	dh_auto_clean

override_dh_installchangelogs:
	dh_installchangelogs Changes-en.txt

patch_center-cwheib.stamp: patch_center-cwheib
	touch patch_center-cwheib.stamp

patch_center-cwheib:
	# patch center/cwheib.ttf
	if test -f $(CURDIR)/debian/bspatch/cwheib_1.0_to_1.1a.bsdiff; then \
		if test ! -f center/cwheib.ttf.debsave; then \
			mv center/cwheib.ttf center/cwheib.ttf.debsave; \
			bspatch center/cwheib.ttf.debsave center/cwheib.ttf $(CURDIR)/debian/bspatch/cwheib_1.0_to_1.1a.bsdiff; \
		fi; \
	fi

unpatch_center-cwheib:
	if test -f center/cwheib.ttf.debsave; then \
		mv -f center/cwheib.ttf.debsave center/cwheib.ttf; \
	fi
	rm -f patch_center-cwheib.stamp
