#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_configure:
	cp $(CURDIR)/debian/Makefile.config $(CURDIR)/
	$(MAKE) config.force

override_dh_auto_build:
	dh_auto_build
	LC_ALL=C LANG=C $(MAKE) -C doc whizzytex.html whizzytex.info

override_dh_auto_install:
	dh_auto_install
	rm -f "$(CURDIR)/debian/whizzytex/usr/share/doc/whizzytex/COPYING" \
              "$(CURDIR)/debian/whizzytex/usr/share/doc/whizzytex/GPL" \
              "$(CURDIR)/debian/whizzytex/usr/share/doc/whizzytex/INSTALL"

override_dh_clean:
	dh_clean -Xexamples/*

override_dh_installinfo:
	dh_installinfo -v $(CURDIR)/doc/whizzytex.info $(CURDIR)/doc/whizzytex.info-[1-9]

override_dh_installchangelogs:
	dh_installchangelogs CHANGES

# eval this in emacs: (shell-command "cd ../ && debian/rules getfaq")
getfaq:
	-rm -f debian/FAQ-new.html
	wget http://cristal.inria.fr/whizzytex/FAQ.html -O debian/FAQ-new.html && \
	mv debian/FAQ-new.html debian/FAQ.html
	dch -a "updated FAQ from http://cristal.inria.fr/whizzytex/FAQ.html"
