#!/usr/bin/make -f

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

export PYBUILD_NAME=backports.zoneinfo

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

override_dh_auto_test:
ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS)))
	dh_auto_test -- --system=custom --test-args="PYTHONPATH=. {interpreter} -m pytest"
endif

override_dh_sphinxdoc:
ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
	#sphinx-build -b man docs/rce docs/build/man
	#sed -i 's/.TH "WATCHDOG" "1"/.TH "WATCHDOG" "3"/g' docs/build/man/watchdog.1
	#cp -f docs/build/man/watchdog.1 docs/build/man/watchdog3.1
	#PYTHONPATH=. sphinx-build -b html docs/source $(CURDIR)/debian/python-watchdog/usr/share/doc/python-watchdog/html
	#PYTHONPATH=. sphinx-build -b html docs/source $(CURDIR)/debian/python3-watchdog/usr/share/doc/python3-watchdog/html
	dh_sphinxdoc -O--buildsystem=pybuild
endif

