#!/usr/bin/make -f

override_dh_auto_install:
	PYTHONPATH=$(CURDIR) sphinx-build -b html -a -c docs docs \
	    $(CURDIR)/debian/python-pkginfo-doc/usr/share/doc/python-pkginfo-doc/html
	python setup.py install --install-layout=deb \
	    --root $(CURDIR)/debian/python-pkginfo
 
override_dh_python2:
	dh_python2 -ppython-pkginfo

override_dh_sphinxdoc:
	dh_sphinxdoc -ppython-pkginfo-doc

override_dh_compress:
	dh_compress -i -X.rst -X.js -X.html -X.txt -X.py

override_dh_clean:
	rm -rf *.egg-info
	dh_clean

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -e -x; \
	PYTHONPATH=$(CURDIR)/build/lib.* python setup.py test
endif

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