#!/usr/bin/make -f
#export DH_VERBOSE=1
#export DEB_BUILD_OPTIONS=nocheck
export PYBUILD_NAME=djvu

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

override_dh_auto_test:
	PYBUILD_SYSTEM=custom \
	PYBUILD_TEST_ARGS="unset LANGUAGE; cd {dir}/tests; ln -sf {build_dir}/djvu djvu; {interpreter} -m nose --verbose --no-skip; rm djvu" \
	dh_auto_test

override_dh_install:
	rm -r debian/python*-djvu/usr/lib/python*/dist-packages/djvu/dllpath.py

override_dh_installdocs:
	python setup.py build_ext -i
	http_proxy='127.0.0.1:9' python setup.py build_sphinx
	dh_installdocs -Xobjects.inv -A doc/credits.txt

override_dh_strip:
ifeq (,$(filter nostrip,$(DEB_BUILD_OPTIONS)))
	dh_strip -ppython-djvu --dbg-package=python-djvu-dbg
	dh_strip -ppython3-djvu --dbg-package=python3-djvu-dbg
endif

