#!/usr/bin/make -f
#export DH_VERBOSE=1

PYVERS := $(shell pyversions -r)
PY3VERS := $(shell py3versions -r)

%:
	dh $@  --with python2,python3,pypy

.PHONY: build_doc

override_dh_auto_build: build_doc
	# python2.x is expected to done in the auto build...
	for PYTHON in $(PY3VERS) pypy; do \
	  $$PYTHON setup.py build; \
	done
	dh_auto_build

override_dh_auto_install:
	# python2.x is expected to done in the auto install...
	for PYTHON in $(PY3VERS) pypy; do \
	  $$PYTHON setup.py install --skip-build --root debian/tmp \
	      --install-layout deb; \
	done
	dh_auto_install

.PHONY: build_doc clean_doc

override_dh_auto_clean: clean_doc
	dh_auto_clean

build_doc:
	$(MAKE) -C $(CURDIR)/docs devhelp

clean_doc:
	$(MAKE) -C $(CURDIR)/docs clean
