#!/usr/bin/make -f

export PYBUILD_NAME = pgpy

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

override_dh_auto_build-indep:
	dh_auto_build -O=--buildsystem=pybuild
ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
	make -C docs html
endif

override_dh_installchangelogs:
	dh_installchangelogs docs/source/changelog.rst

# LC_ALL=C.UTF-8 below is because of
# https://github.com/SecurityInnovation/PGPy/issues/173

# The test suite uses python-gpg, which is built only for one version
# of python3 (see https://bugs.debian.org/866555), so we have to tune
# this test rule to run the version that gpgme is built against (at
# the moment, that's 3.6).  yuck.  See https://bugs.debian.org/878633.
override_dh_auto_test:
	LC_ALL=C.UTF-8 PYBUILD_VERSIONS=3.6 dh_auto_test -O--buildsystem=pybuild
