#!/usr/bin/make -f
# -*- makefile -*-

export DH_VERBOSE=1
export PYBUILD_NAME=pyfuse3
export PYBUILD_TEST_PYTEST=1
export PYBUILD_TEST_ARGS=--installed "{dir}/test/"

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

ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	python3 setup.py build_cython
	python3 setup.py build_ext --inplace
	sphinx-build -b html rst doc/html
endif

execute_before_dh_auto_clean:
	# Remove documentation and cython output
	rm -rf build_cython build_sphinx doc/
	rm -rf src/pyfuse3/*.so test/.pytest_cache/
