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

PYTHON3:=$(shell py3versions -vr)

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

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
test-python%:
	python$* setup.py test -vv --args -v

override_dh_auto_test: $(PYTHON3:%=test-python%)
endif

override_dh_fixperms:
	dh_fixperms
	chmod a-x debian/python3-regions/usr/lib/python3/dist-packages/regions/io/ds9/tests/data/* \
                  debian/python3-regions/usr/lib/python3/dist-packages/regions/shapes/tests/reference/* \
                  debian/python3-regions/usr/lib/python3/dist-packages/regions/tests/coveragerc \
	          debian/python3-regions/usr/lib/python3/dist-packages/regions/shapes/tests/data/example_header.fits

