#!/usr/bin/make -f

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

export PYBUILD_NAME=pycryptodome
export PYBUILD_BEFORE_BUILD=touch .separate_namespace
#export PYBUILD_AFTER_INSTALL=rm '{destdir}/{install_dir}/Cryptodome/SelfTest/PublicKey/test_vectors/ECC/gen_ecc_p256.sh'

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

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
        PYBUILD_TEST_ARGS="python{version} -m Cryptodome.SelfTest {build_dir}/" dh_auto_test

#override_dh_auto_build: export http_proxy=127.0.0.1:9
#override_dh_auto_build: export https_proxy=127.0.0.1:9
#override_dh_auto_build:
#	dh_auto_build
#	PYTHONPATH=. sphinx-build -N -bhtml Doc/ build/html # HTML generator
#	PYTHONPATH=. sphinx-build -N -bman Doc/ build/man # Manpage generator

## Do this until it becomes clearer where documentation should live post Python 2
#override_dh_installdocs:
#	dh_installdocs -p python-pycryptodome
#	dh_installdocs -p python3-pycryptodome
#	dh_installdocs --doc-main-package=python-pycryptodome-doc -p python-pycryptodome-doc
