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

PACKAGE_NAME = python-pyxnat
PACKAGE_ROOT_DIR = debian/${PACKAGE_NAME}
INSTALL_PATH = $(CURDIR)/debian/${PACKAGE_NAME}

# default Python
PYTHON=$(shell pyversions -d)

%:
	dh $@

override_dh_auto_test:
	: # Do not test just after build, lets install and then test

override_dh_auto_install:
	dh_auto_install

# All tests later on
# cd build to prevent use of local/not-built source tree
ifneq (,$(filter check-through-internet,$(DEB_BUILD_OPTIONS)))
	cd build; \
	for PYTHON in $(shell pyversions -r); do \
		echo "I: Running pyxnat unittests using $$PYTHON"; \
		PYTHONPATH=$$(/bin/ls -d $(INSTALL_PATH)/usr/lib/$$PYTHON/*-packages):$$PYTHONPATH \
		$$PYTHON /usr/bin/nosetests --exclude=test_del_provenance pyxnat; \
	done
endif

override_dh_auto_clean:
	dh_auto_clean
	-rm -rf doc/build build
