#!/usr/bin/make -f

export QT_SELECT=5

override_dh_auto_clean:
	dh_auto_clean
	rm -f src/translations/*.qm

override_dh_auto_configure:
	dh_auto_configure -- iso-snapshot.pro

override_dh_auto_build:
	lrelease iso-snapshot.pro
	head -n1 debian/changelog | sed -e "s/.*(\([^(]*\)).*/#define VERSION \"\1\"/" > version.h
	gzip -kf manual/mx-snapshot.8
	gzip -kf manual/iso-snapshot-cli.8
	# build iso-snapshot
	dh_auto_build
	mv iso-snapshot iso-snapshot-binary
	# clean, reconfigure, and build iso-snapshot-cli
	dh_auto_clean
	dh_auto_configure -- iso-snapshot-cli.pro
	dh_auto_build
	# before installing move binary back and make a iso-snapshot-cli copy of .list file
	mv iso-snapshot-binary iso-snapshot
	cp iso-snapshot-exclude.list iso-snapshot-cli-exclude.list

override_dh_shlibdeps:
	dh_shlibdeps -- -xvirtualbox-guest-x11 --ignore-missing-info

%:
	dh $@ --no-automatic-dbgsym --parallel 

