#!/usr/bin/make -f
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
export DEB_CFLAGS_MAINT_APPEND = -Ithird_party/md5 -Ithird_party/json -Iinclude -fPIC
export DEB_CXXFLAGS_MAINT_APPEND = -Ithird_party/md5 -Ithird_party/json -Iinclude -fPIC

%:
	dh $@ -Scmake --with python3

override_dh_auto_configure:
	dh_auto_configure -- \
		-DUSE_SYSTEM_GTEST=ON \
		-DBUILD_JSONNET=ON \
		-DBUILD_TESTS=ON

override_dh_auto_build:
	dh_auto_build
	for PY in $(shell py3versions -rs); do \
		$$PY setup.py build; done

override_dh_auto_install:
	dh_auto_install
	for PY in $(shell py3versions -rs); do \
		$$PY setup.py install --install-layout=deb \
		--root=$(shell pwd)/debian/tmp; done
