#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all
# Get __DATE__ and __TIME__ in sources to refer to debian/changelog ultimate timestamp
include /usr/share/dpkg/pkg-info.mk

%:
	dh $@

override_dh_strip:
	dh_strip --no-automatic-dbgsym

override_dh_auto_build:
	dh_auto_build -- translations all

execute_after_dh_auto_install:
	-rm --verbose debian/*/usr/share/xournalpp/ui/icons/hicolor/update-icon-cache.sh
	-rm --verbose debian/*/usr/share/xournalpp/ui/iconsDark/hicolor/update-icon-cache.sh

override_dh_installman: debian/xournalpp.1
	dh_installman

debian/xournalpp.1:
	help2man --no-info \
		--version-string="$(DEB_VERSION)" \
		--name="Xournal++, $(shell egrep '^Description: ' debian/control | head -1 | sed 's/Description: //')" \
		./*/src/xournalpp > $@

override_dh_dwz:
	dh_dwz --no-dwz-multifile
