#!/usr/bin/make -f
%:
	dh $@ --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build $@ --buildsystem=pybuild
	cd docs; PYTHONPATH=$(CURDIR) LC_ALL=C.UTF-8 LANGUAGE=C.UTF-8 sphinx-build -bhtml -d _build/doctrees source _build/html

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	$(eval BUILD_DIR=$(shell pybuild --print '{build_dir}'))
	cp -r auditlog_tests $(BUILD_DIR)
	cd $(BUILD_DIR)
	PYTHONPATH=. python3 $(CURDIR)/debian/tests/setup-db-and-run-tests.py
endif
