#!/usr/bin/make -f
#export DH_VERBOSE = 1

export PYBUILD_NAME=pyobjcryst
export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
export DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)

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

override_dh_auto_build:
	mkdir debian/$(PYBUILD_NAME) || true
	dh_auto_build
	scons python=/usr/bin/python3 build=debug develop prefix=debian/$(PYBUILD_NAME)

override_dh_auto_install:
	scons python=/usr/bin/python3 prefix=debian/$(PYBUILD_NAME) install
	dh_numpy3

override_dh_auto_test:
	true

override_dh_auto_clean:
	dh_clean
	$(RM) -r src/pyobjcryst/version.cfg src/pyobjcryst.egg-info/ .pybuild build/
	$(RM) -r .sconf_temp/ .sconsign.dblite config.log src/pyobjcryst/_pyobjcryst.so
	find . -name "*.pyc" -delete
	$(RM) -r dist src/pyobjcryst/_pyobjcryst.* .pytest_cache/ debian/$(PYBUILD_NAME)
