#!/usr/bin/make -f
export PYBUILD_NAME=cryptography

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

# This ... awful thing originally borrowed from Vincent Bernat; hopefully there
# will be a better canonical way to do this in future.
override_dh_gencontrol:
	dh_gencontrol -- \
	    -Vcffi:Depends="$(shell python debian/cffivers.py python-cffi)" \
	    -Vcffi3:Depends="$(shell python3 debian/cffivers.py python3-cffi)"


override_dh_auto_clean:
	dh_auto_clean
	rm -rf cryptography/hazmat/bindings/__pycache__ \
	       cryptography/hazmat/primitives/__pycache__

# Disable test suite for the moment, because it requires dependencies which are
# not yet in Debian :(

#override_dh_auto_test:
#	PYBUILD_SYSTEM=custom \
#	PYBUILD_TEST_ARGS="cd {build_dir}; {interpreter} -m pytest {dir}/tests" dh_auto_test
