#!/usr/bin/make -f

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

DEB_INSTALL_CHANGELOGS_ALL := CHANGES

install/python-mdp:: test-build

#$(CURDIR)/debian/python-mdp$(INSTALL_PATH)/usr/lib/$$PYTHON/site-packages;

test-build:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	for buildver in $(cdbs_python_build_versions); do \
        echo "I: Runnig MDP unittests using $$PYTHON"; \
        MDPPATH=$(cdbs_python_destdir)/$(call cdbs_expand_python_distutils_installdir,python$$buildver); \
        python$$buildver $$MDPPATH/mdp/test/run_tests.py $$MDPPATH/mdp \
                         $$MDPPATH/bimdp; \
    done
	: # Prune compiled code which could have been generated during testing
	/usr/bin/find \( -name __pycache__ -o -name \*.pyc \) -delete
endif
