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

PYTHON3:=$(shell py3versions -vr)
export PYBUILD_NAME=gammapy
export LC_ALL=C.UTF-8

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

override_dh_install:
	dh_install
	rm -rf debian/python3-gammapy/usr/bin

override_dh_fixperms:
	dh_fixperms
	chmod a-x debian/python3-gammapy/usr/share/doc/python3-gammapy/examples/*.py

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

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