#!/usr/bin/make -f
#DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk

PYTHON3_VERSIONS = $(shell pyversions -r)
pyalldo = set -e; $(foreach py, $(PYTHON3_VERSIONS), $(py) $(1);)

%:
	dh $@ --with python3

override_dh_auto_install:
	mkdir -p debian/tmp/
	python3 setup.py install --root=debian/tmp --prefix=usr --install-layout deb
	mv debian/tmp/usr/etc debian/tmp
	dh_auto_install

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	$(call pyalldo, -m unittest discover -vv test/)
endif

override_dh_auto_clean:
	$(RM) -r build *.egg-info
	dh_auto_clean

