#!/usr/bin/make -f
#export DH_VERBOSE = 1

DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/default.mk

export PYBUILD_NAME = brotli

devi := $(shell lsb_release -r -s | cut -d '.'  -f1)
ifeq ($(shell if [ $(devi) -gt 7 ] ; then echo gt ; else echo lt ; fi),gt)
   DEBVE2=yes
else
   DEBVE2=no
endif

%:
ifeq ($(DEBVE2),yes)
	dh $@ --buildsystem=pybuild --with=python2,python3
else
	dh $@ --buildsystem=pybuild --with=python2,python3 --no-guessing-versions
endif

override_dh_auto_configure:
	dh_auto_configure
	dh_auto_configure --buildsystem=cmake

override_dh_auto_build:
	dh_auto_build
	dh_auto_build --buildsystem=cmake

override_dh_auto_install:
	dh_auto_install
	dh_auto_install --buildsystem=cmake

override_dh_auto_clean:
	dh_auto_clean
	dh_auto_clean --buildsystem=cmake

override_dh_auto_test:
	dh_auto_test
	dh_auto_test --buildsystem=cmake

override_dh_install:
	find debian/tmp -name '*.a' -print -delete
	dh_install

override_dh_missing:
	dh_missing --fail-missing

