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

DEB_BUILD_ARCH ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

export PYBUILD_NAME=pysal
export PYBUILD_TEST_NOSE=1
export PYBUILD_TEST_ARGS=--verbose
export PYBUILD_BEFORE_TEST=sh $(CURDIR)/debian/copy-test-data.sh "{version}" "{interpreter}" "{dir}" "{destdir}" "{home_dir}" "{build_dir}" "{install_dir}" "{package}"

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

override_dh_auto_test:
	# Skip tests, tend to hang with many defunct processes

override_dh_install:
	dh_install --list-missing

	find $(CURDIR)/debian/*/usr/lib/python*/dist-packages/pysal/model/mgwr/tests/ -type f -not -name "*.py" -exec chmod 644 {} \;

	$(RM) $(CURDIR)/debian/*/usr/lib/python*/dist-packages/lattice.dbf

override_dh_python3:
	dh_python3 -ppython3-pysal
	dh_numpy3 -ppython3-pysal
