#!/usr/bin/make -f

PYTHON3:=$(shell py3versions -vr)

export PYBUILD_NAME=cpl

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

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	for PYTHON in $(PYTHON3); do \
	    python$$PYTHON setup.py build_ext -i && \
	    MALLOC_CHECK_=0 PYTHONPATH=$$(pwd) python$$PYTHON test/TestRecipe.py \
	        || exit $$? ; \
	done
endif

override_dh_install:
	dh_install
	find debian -name recipe.py -exec sed s+DEB_HOST_MULTIARCH+$(DEB_HOST_MULTIARCH)+g -i {} \;

override_dh_shlibdeps:
	dh_shlibdeps
	dh_numpy3
