#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie
export QT_SELECT := qt5
export DEBIAN_VERSION = $(shell dpkg-parsechangelog | sed -n -e '/^Version:/s/.*: //p')

%:
	dh $@ --with autoreconf,python2,python3 --parallel

override_dh_auto_configure:
	dh_auto_configure -- \
	    --enable-static \
	    --enable-languages="python cpp qt" \
	    --infodir=/usr/share/info

override_dh_install:
	dh_install --list-missing -X.la -Xinfo/dir

override_dh_makeshlibs:
	dh_makeshlibs -V

# python-pyme needs an epoch number because previous versions had an
# epoch.  If we ever add an epoch to the source package, remove this
# stanza.
override_dh_gencontrol-arch:
	dh_gencontrol
	dpkg-gencontrol -ppython-pyme \
	-v1:$(DEBIAN_VERSION) \
	-Tdebian/python-pyme.substvars \
	-Pdebian/python-pyme \
	-Odebian/python-pyme/DEBIAN/control

override_dh_auto_build-indep:
	make -C lang/qt/doc
	make -C lang/qt/doc/generated/latex

override_dh_installdocs:
	dh_installdocs -X.md5
