#!/usr/bin/make -f

PYTHON2:=$(shell pyversions -vr)
PYTHON3:=$(shell py3versions -vr)
export PYBUILD_NAME = pyraf

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

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
test-python%:
	HOME=/tmp/ PYTHONPATH=$(CURDIR)/.pybuild/pythonX.Y_$*/build python$* debian/tests/pyraf-test.py

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

override_dh_clean:
	dh_clean
	rm -rf lib/pyraf.egg-info/
