#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

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

include /usr/share/dpkg/architecture.mk

BUILDDIR := $(shell pybuild --print build_dir --interpreter python3)

ifeq ($(DEB_HOST_ARCH),armhf)
export SKIP_ARMHF_TESTS=1
endif

%:
	dh $@ --buildsystem=pybuild --without=single-binary

ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	PYTHONPATH=$(BUILDDIR) sphinx-build -b html docs/ build/html/

override_dh_auto_install-indep:
endif

execute_after_dh_auto_install-arch:
	find $(CURDIR)/debian/tmp/ -name core -type f -delete
	find $(CURDIR)/debian/tmp/ -name 'core.*' -type f -delete

override_dh_compress:
	dh_compress -X.html
