#!/usr/bin/make -f

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

ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
override_dh_auto_test:
	dh_auto_test
	./devel pydoctests
endif

override_dh_fixperms:
	dh_fixperms
	chmod 440 debian/mini-buildd/etc/sudoers.d/mini-buildd-sudoers

# Note: With python3, build_sphinx is no longer reproducible.
# Note: Using PYTHONHASHSEED=0 seems to be a workaround.
# Note: See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=877637
override_dh_auto_build:
	dh_auto_build
	PYTHONHASHSEED=0 /usr/share/sphinx/scripts/python3/sphinx-build -N -bhtml ./doc/ ./build/sphinx/html/
