#!/usr/bin/make -f

# Supported Python versions
PYVERS = $(shell pyversions -vr)

# Callable functions to determine the correct PYTHONPATH
pythonpath = $$(ls -d $(CURDIR)/build/lib.*-$(1))

%:
	dh $@ --with=python2

override_dh_auto_build:
	dh_auto_build
	PYTHONPATH=$(call pythonpath,$$py) epydoc speaklater

override_dh_auto_test:
ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
	set -ex && for py in $(PYVERS); do \
		PYTHONPATH=$(call pythonpath,$$py) python$$py -m speaklater ;\
	done
endif

