#!/usr/bin/make -f
# -*- makefile -*-
#  # Uncomment this to turn on verbose mode.
export DH_VERBOSE=1

# Hardening
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

# In fact, we are not using pybuild at all.
#export PYBUILD_NAME=mypaint
export PYBUILD_DISABLE_python2=1
export PYBUILD_DESTDIR_python3=debian/tmp/

# Python variable
PYTHON = python3

%:
	dh $@ --buildsystem=pybuild

override_dh_clean:
	# As suggested by upstream
	$(PYTHON) setup.py clean --all

override_dh_auto_build:
	# As suggested by upstream
	$(PYTHON) setup.py build

override_dh_auto_install:
	# From AUR package
	$(PYTHON) setup.py install \
	        --root=$(CURDIR)/debian/tmp/ \
	        --prefix=/usr/ \
		--skip-build

override_dh_auto_test:
	# Known to be failing, just ignore failure for now
	# As suggested by upstream
	-$(PYTHON) setup.py nosetests
	# Heavy tests including C++ part
	-$(PYTHON) setup.py test

override_dh_installchangelogs:
	dh_installchangelogs Changelog.md

override_dh_missing:
	dh_missing --fail-missing
