#!/usr/bin/make -f

export SPECFILE_USE_GNU_SOURCE=1
export QHULL_CFLAGS=-I/usr/include/qhull
export QHULL_LIBS=-lqhull

# Get the supported Python versions
PYVERS = $(shell pyversions -r -v)

override_dh_installchangelogs:
	dh_installchangelogs changelog.txt

override_dh_auto_install:
	# fix the creation of the man directory
	# https://sourceforge.net/tracker/?func=detail&aid=3524625&group_id=164626&atid=832479
	mkdir -p  $(CURDIR)/debian/tmp/usr/share/man
	dh_auto_install
	dh_numpy
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -e -x;\
	for py in $(PYVERS); do \
		cd $(CURDIR)/build/lib.*-$$py;\
		env PYTHONPATH=. python$$py PyMca/tests/TestAll.py;\
	done
endif

%:
	dh $@ --with python2
