#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=sagenb-export

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


# If you need to rebuild the Sphinx documentation
# Add spinxdoc to the dh --with line
#override_dh_auto_build:
#	dh_auto_build
#	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bhtml        docs/ build/html # HTML generator
#	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N -bman        docs/ build/man # Manpage generator

TOX_ENVLIST = py27,py35

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	VIRTUALENV_DOWNLOAD=no \
	http_proxy=http://127.0.9.1:9 \
	https_proxy=https://127.0.9.1:9 \
	tox -r --sitepackages -e $(TOX_ENVLIST) -- -s
endif

override_dh_auto_clean:
	rm -rf .tox
	dh_auto_clean

override_dh_install:
	dh_install
	mv debian/python-sagenb-export/usr/bin/sagenb-export \
	   debian/python-sagenb-export/usr/bin/sagenb-export-python2
	mv debian/python3-sagenb-export/usr/bin/sagenb-export \
	   debian/python3-sagenb-export/usr/bin/sagenb-export-python3
