#!/usr/bin/make -f

export PYTHONPATH=$(CURDIR)/debian/python2-wheels/setuptools-44.1.0-py2.py3-none-any.whl:$(CURDIR)/debian/python2-wheels/py-1.8.1-py2.py3-none-any.whl

export PYBUILD_DESTDIR_python2=debian/python-cffi
export PYBUILD_EXT_DESTDIR_python2=debian/python-cffi-backend
export PYBUILD_EXT_DESTDIR_python2-dbg=debian/python-cffi-backend-dbg

export VIRTUALENV_DOWNLOAD=no

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

override_dh_auto_test:
	# don't run the tests: it requires too many python modules

#override_dh_install:
#	debian/gen-backend-versions.py
#	dh_install

override_dh_installchangelogs:
	dh_installchangelogs doc/source/whatsnew.rst

override_dh_strip:
	dh_strip -p python-cffi-backend -p python-cffi-backend-dbg \
	         --dbg-package=python-cffi-backend-dbg
	dh_strip --remaining-packages

override_dh_clean:
	dh_clean
	rm -rf $(wildcard testing/*/snippets/*/build testing/*/snippets/*/dist testing/*/snippets/*/*.egg-info)
