#!/usr/bin/make -f

DEBPKGNAME     := $(shell dpkg-parsechangelog | awk '/^Source:/ {print $$2}')
export PYBUILD_DESTDIR=debian/$(DEBPKGNAME)
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with python2 --buildsystem=pybuild

override_dh_auto_install:
	dh_auto_install -- --after-install='mv {destdir}/{install_dir}/Epigrass/egicon.png {destdir}/usr/share/pixmaps/epigrass.png; \
					    ln -s /usr/share/pixmaps/epigrass.png {destdir}/{install_dir}/Epigrass/egicon.png'

override_dh_installdocs:
	# no idea why doc is installed in main package as well - just remove this copy
	dh_installdocs
	rm debian/$(DEBPKGNAME)/usr/share/doc/$(DEBPKGNAME)/Epigrass.pdf*

get-orig-source:
	mkdir -p ../tarballs
	uscan --verbose --force-download --destdir=../tarballs
