#!/usr/bin/make -f

DEB_PYTHON_SYSTEM=pysupport

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/python-distutils.mk

DEB_COMPRESS_EXCLUDE		:= .py
DEB_PYTHON_INSTALL_ARGS_ALL 	+= --single-version-externally-managed
DEB_DESTDIR			 = $(CURDIR)/debian/python-traits4
PYSHARED			 = $(DEB_DESTDIR)/usr/share/pyshared

test-build:
	for buildver in $(cdbs_python_build_versions); do \
        echo "I: Running traits unittests using python$$buildver"; \
        cd $(CURDIR)/build && pd=$$(/bin/ls -d $$PWD/lib.*-$$buildver) && \
        PYTHONPATH=$$pd $(call cdbs_python_binary,python$$buildver) /usr/bin/nosetests -s -v traits; \
    done

install/python-traits4:: test-build

binary-predeb/python-traits::
	find $(PYSHARED) -type f | xargs sed -i '/^#!/d'
	find $(PYSHARED) -type f | xargs chmod 644

get-orig-source:
	-uscan --upstream-version 0 --rename
