#!/usr/bin/make -f

%:
	dh $@

override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/doctrees
	rm -rf docs/build/html docs/build/man

override_dh_auto_configure:
	dh_auto_configure -- --without-python3 --$(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),dis,en)able-tests

override_dh_auto_build-indep:
	PYTHONPATH=. sphinx-build -bman docs/user_manual/ -d debian/doctrees docs/build/man
	PYTHONPATH=. sphinx-build -bhtml docs/user_manual/ -d debian/doctrees docs/build/html

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	if [ -f src/unit_tests ]; then ./src/unit_tests; fi
endif
