#!/usr/bin/make -f

export DH_VERBOSE=1

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

override_dh_auto_build:
	dh_auto_build -O--buildsystem=pybuild
	$(MAKE) -C docs html PYTHONPATH=$(shell pwd)/src

override_dh_auto_clean:
	dh_auto_clean -O--buildsystem=pybuild
	$(MAKE) -C docs clean PYTHONPATH=$(shell pwd)/src
	rm -fr src/icalendar.egg-info

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	python setup.py test
	python3 setup.py test
endif

override_dh_installdocs:
	dh_installdocs
	dh_sphinxdoc

override_dh_installchangelogs:
	dh_installchangelogs CHANGES.rst

override_dh_installdocs:
	dh_installdocs -Xlicense.txt -Xjquery.js -Xunderscore.js
