#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

%:
	dh $@

override_dh_auto_configure:
	dh_quilt_patch
	dh_testdir
	qmake-qt4 DEFINES+="SPLASH_DIR=\'\\\"/usr/share/guymager\\\"\' LANGUAGE_DIR=\'\\\"/usr/share/guymager\\\"\' LANGUAGE_DIR_QT=\'\\\"/usr/share/qt4/translations\\\"\'"
	touch configure-stamp

override_dh_auto_build:
	dh_testdir
	$(MAKE)
	lrelease guymager.pro
	cd manuals  && ./rebuild.sh && cd -
	touch $@

override_dh_auto_clean:
	dh_quilt_unpatch
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	# dpkg-buildpackage starts with cleaning, so we have to be sure that there's a
	# Makefile (and thus call qmake-qt4):
	qmake-qt4
	$(MAKE) clean
	# remove leftover files:
	rm -f guymager
	rm -f guymager_de.qm guymager_en.qm guymager_fr.qm guymager_it.qm guymager_nl.qm
	rm -f Makefile
	dh_clean
