#!/usr/bin/make -f

export PYBUILD_NAME=matrix-sydent

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

override_dh_auto_test:
	# don't run unit tests in PYBUILD's {build_dir}, simply run them on the $(CURDIR)
	# this fixes failing unit tests in tests/test_email.py (where smtplib is patched
	# out via mock.patch().
	#
	# If anyone has a better idea, please file a bug and send a patch
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	python3 -m unittest discover -v
endif

override_dh_compress:
	dh_compress -XREADME.rst


override_dh_auto_clean:
	-dh_auto_clean
	rm -f sydent.conf
	rm -f sydent.pid
	rm -Rf matrix_sydent.egg-info/

get-orig-source:
	uscan --noconf --force-download --rename --download-current-version --destdir=..
