#!/usr/bin/make -f

export http_proxy = http://127.0.1.1:9/
export https_proxy = ${http_proxy}
export PYBUILD_NAME=gnupg
export NO_EXTERNAL_TESTS=true

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

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	chmod 755 $(CURDIR)/debian/bin/gpg
	set -ex; for python in $(shell py3versions -r); do \
		PATH=$(CURDIR)/debian/bin:$$PATH PYTHONPATH=$(CURDIR)/build/lib $$python test_gnupg.py --verbose ;\
	done
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf build/ keys/ __pycache__/
