#!/usr/bin/make -f

export PYBUILD_NAME=uncertainties
export DH_VERBOSE=1

%:
	dh $@ --buildsystem=pybuild

ifeq (,$(findstring nodoc, $(DEB_BUILD_OPTIONS)))
execute_after_dh_auto_build:
	PYTHONPATH=. http_proxy='http://127.0.0.1:9/' sphinx-build -N -E -bhtml doc debian/html
	sed -i 's|https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js|file:///usr/share/nodejs/mathjax-full/es5/tex-mml-chtml.js|' debian/html/user_guide.html
	rm -rf ./build/html/.doctrees
endif

# override_dh_sphinxdoc:
# ifeq (,$(findstring nodoc,$(DEB_BUILD_OPTIONS)))
# 	dh_sphinxdoc -ppython-uncertainties-doc
# endif

execute_after_dh_python3:
	rm -rfv debian/python3-$(PYBUILD_NAME)/usr/lib/python3.*
