#!/usr/bin/make -f
py3sdo=set -e; $(foreach py, $(shell py3versions -r), $(py) $(1);)

%:
	dh "$@" --with python3

override_dh_auto_build:
	$(call py3sdo, setup.py build)

override_dh_auto_install:
	$(call py3sdo, setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb)

override_dh_auto_clean:
	$(call py3sdo, setup.py clean)

override_dh_install:
	dh_install --fail-missing

override_dh_python3:
	dh_python3 --shebang=/usr/bin/python3

override_dh_clean:
	rm -rf build
	rm -rf *.egg-info
	find $(CURDIR) -name "__pycache__" -exec rm -rf "{}" \ || true;
	dh_clean

# Empty compatibility function
.PHONY: fill_templates
fill_templates:
	true
