#!/usr/bin/make -f
export PYBUILD_NAME=sbws
export PYBUILD_DESTDIR=debian/sbws
%:
	dh $@ --with python3 --buildsystem=pybuild

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=. sphinx-build -N -bman docs/source/ docs/build/man # man generator

override_dh_installsystemd:
	dh_installsystemd --no-stop-on-upgrade --name=sbws
	dh_installsystemd --no-stop-on-upgrade --name=sbws_generate
	dh_installsystemd --no-stop-on-upgrade --name=sbws_cleanup

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	# do not run integration tests since tor can not run in a chroot
	# run pytest with all the installed python versions
	for p in $(py3versions -s); do $p -m pytest tests/unit/; done
endif
