#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# Used during building to set the version
export CFLAGS=-DVERSION=\"$(DEB_VERSION_UPSTREAM)\"

# Enable hardening
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --buildsystem=python_distutils --with=python2,python3

override_dh_install:
	dh_install --list-missing

override_dh_auto_build:
	dh_auto_build
	set -ex; for python in $(shell py3versions -r); do \
            $$python setup.py build; \
	done;

override_dh_auto_install:
	dh_auto_install
	set -ex; for python in $(shell py3versions -r); do \
            $$python setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb; \
	done;

override_dh_installchangelogs:
	dh_installchangelogs -k NEWS
