#!/usr/bin/make -f


export DEB_BUILD_MAINT_OPTIONS := hardening=+all
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

export KLAPKI_VERSION := "$(shell IFS="$$IFS()" read -r _ v _ < debian/changelog && echo "$$v")"
export TZ := UTC0
export NOLOCREGEN := @\#


override_dh_auto_build:
	mkdir -p out/tmp
	dh_auto_build -- build locales $(if $(filter nocheck,$(DEB_BUILD_PROFILES)),,build-test) $(if $(filter nodoc,$(DEB_BUILD_PROFILES)),,manpages)
	ln bash-completion out/tmp/klapki

override_dh_installchangelogs:
	dh_installchangelogs debian/changelog.upstream

override_dh_installdocs:
	dh_installdocs README.md $(wildcard screenshot*.png)
	cp debian/NEWS.upstream debian/klapki/usr/share/doc/klapki/NEWS


%:
	dh $@
