#! /usr/bin/make -f

export PYBUILD_NAME=bepasty
export PYBUILD_DISABLE=test
%:
	dh $@ --with python3,sphinxdoc --buildsystem=pybuild

override_dh_auto_clean:
	cp src/bepasty/_version.py debian/old_version.py
	dh_auto_clean || true
	rm -rf .pybuild
	rm -rf .pytest_cache
	mv debian/old_version.py src/bepasty/_version.py

override_dh_auto_build:
	dh_auto_build
	cd docs ; make html PYTHONPATH=../src ; cd -
	cd debian ; rst2man bepasty-server.1.rst bepasty-server.1 ; cd -
	cd debian ; rst2man bepasty-object.1.rst bepasty-object.1 ; cd -
