#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=qutip

export PYBUILD_BUILD_ARGS=--with-openmp

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

ifneq ($(DEB_HOST_ARCH_OS),amd64)
override_dh_auto_test:
	dh_auto_test || /bin/true
endif

# setup.py clean creates build files instead of removing them
# https://github.com/qutip/qutip/issues/986
override_dh_auto_clean:
	dh_auto_clean
	rm -f qutip/control/*cpp qutip/cy/*.cpp qutip/version.py


override_dh_fixperms:
	dh_fixperms
	for f in openmp/benchmark.pyx openmp/src/zspmv_openmp.hpp src/zspmv.hpp; do \
	  chmod a-x debian/python3-qutip/usr/lib/python3/dist-packages/qutip/cy/$$f; \
	done
