#!/usr/bin/make -f
#export DH_VERBOSE=1
export PYBUILD_NAME=yuma
export DEB_BUILD_OPTIONS=nocheck

# TODO
# without -pie build fails during perl module build somehow...
export DEB_BUILD_MAINT_OPTIONS := hardening=+all,-pie
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)

LIB_VERSION =
UPSTREAM_VERSION = $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ':' | sed 's/ //' | sed 's/~dfsg.*$$//')
COMPAT_VERSION = $(UPSTREAM_VERSION)~dfsg


%:
	dh $@ --with autoreconf,python3 --buildsystem=pybuild

override_dh_install:
	python3 setup.py build ; \
	python3 setup.py install --root=$(CURDIR)/debian/tmp --install-layout=deb ; \
	find $(CURDIR) -name *.pyc -delete
	dh_install

