#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

# detect if build targets experimental suite (or is a draft)
DEB_SUITE_EXP = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))

DH_OPTIONS = -O--buildsystem=pybuild

STEM = matrix-nio
DOCDIR = debian/python3-$(STEM)-doc/usr/share/doc/python3-$(STEM)-doc/html

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	dh_auto_test $(if $(DEB_SUITE_EXP),|| true)
endif

override_dh_sphinxdoc:
ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS)))
	sphinx-build \
		-b html doc $(DOCDIR)
	dh_sphinxdoc
endif

%:
	dh $@ --with python3,sphinxdoc $(DH_OPTIONS:-O%=%)
