#!/usr/bin/make -f

%:
	dh "$@" --with python3,translations --buildsystem pybuild

# needs manual commands for Python 3, see Debian #597105
override_dh_auto_clean:
	dh_auto_clean
	rm -rf build

override_dh_auto_build:
	dh_auto_build
	python3 setup.py build

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_auto_test:
ifeq (, $(findstring nocheck, $(DEB_BUILD_OPTIONS)))
	tests/run-linters
	python3 -m unittest -v tests/unit/test_*.py tests/integration/test_*.py
endif

override_dh_installinit:
	dh_installinit --error-handler=true

override_dh_install:
	dh_install -X.pyc -X.egg-info
	pod2man -c Debhelper -r "$(DEB_VERSION)" debhelper/dh_apport debhelper/dh_apport.1

override_dh_missing:
	dh_missing --list-missing

override_dh_python3:
	dh_python3 --skip-private
