#!/usr/bin/make -f
#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS=nocheck
export PYBUILD_NAME=lasagne
export THEANO_FLAGS=base_compiledir='.pybuild',device=cpu

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

override_dh_auto_test:
	PYBUILD_SYSTEM=custom PYBUILD_TEST_ARGS="{interpreter} -m pytest -v -rs lasagne/" dh_auto_test

override_dh_auto_install:
	dh_auto_install
	PYTHONPATH=. http_proxy='127.0.0.1:9' sphinx-build -N docs/ debian/lasagne-doc/usr/share/doc/lasagne-doc/html/

override_dh_installdocs:
	rst2html -r 5 README.rst .pybuild/README.html
	LANG=C.UTF-8 links -dump .pybuild/README.html > .pybuild/README
	dh_installdocs -A .pybuild/README

override_dh_sphinxdoc:
	dh_sphinxdoc --exclude=MathJax.js

override_dh_compress:
	dh_compress -X.py
