#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-

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

# Don't compress .py files
DEB_COMPRESS_EXCLUDE := .py

# Install egg-info directories
DEB_PYTHON_INSTALL_ARGS_ALL += --single-version-externally-managed \
	--install-layout=deb

ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
install/python-pyasn1 install/python3-pyasn1::
	set -e; cd test; for buildver in $(cdbs_python_build_versions); do \
        echo "I: Running pyasn1 unittests using python$$buildver"; \
        pd=$$(/bin/ls -d $(CURDIR)/build/lib.*-$$buildver) && \
        PYTHONPATH=$$pd $(call cdbs_python_binary,python$$buildver) suite.py; \
    done
install/python3-pyasn1::
	set -e; cd test; for buildver in $(cdbs_python3_build_versions); do \
        echo "I: Running pyasn1 unittests using python$$buildver"; \
        pd=$$(/bin/ls -d $(CURDIR)/build/lib/) && \
        PYTHONPATH=$$pd $(call cdbs_python_binary,python$$buildver) suite.py; \
    done
endif
