#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export trusted_keyid=5759F35001AA4A64
export GNUPGHOME=$(CURDIR)/debian/tmp

%:
	dh $@

override_dh_auto_build:
	# check GPG sig for sha512sums and sha512sums for gpg keys
	mkdir -p $(CURDIR)/debian/tmp
	gpg --no-default-keyring \
	    --keyring /usr/share/keyrings/debian-keyring.gpg \
    	    --trusted-key $(trusted_keyid) \
	    --no-auto-check-trustdb \
    	    --decrypt $(CURDIR)/SHA512SUMS.txt.asc > $(CURDIR)/debian/tmp/SHA512SUMS.txt
	sha512sum -c $(CURDIR)/debian/tmp/SHA512SUMS.txt

override_dh_installchangelogs:
	dh_installchangelogs -Xchangelog

override_dh_clean:
	dh_clean
	debconf-updatepo
