#!/usr/bin/make -f

export PYBUILD_NAME=asv_bench_memray

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

override_dh_installdocs:
	https_proxy='127.0.0.1:9' sphinx-build -b html doc/source build/sphinx/html

	# Remove doctrees
	rm -rf build/sphinx/html/.doctrees

	# Create symbolic link for js
	rm -f build/sphinx/html/_static/doctools.js
	rm -f build/sphinx/html/_static/language_data.js
	rm -f build/sphinx/html/_static/searchtools.js

	ln -sf /usr/share/doc/sphinx-doc/html/_static/doctools.js build/sphinx/html/_static/doctools.js
	ln -sf /usr/share/doc/sphinx-doc/html/_static/language_data.js build/sphinx/html/_static/language_data.js
	ln -sf /usr/share/doc/sphinx-doc/html/_static/searchtools.js build/sphinx/html/_static/searchtools.js

	dh_installdocs -ppython-asv-bench-memray-doc --doc-main-package=python-asv-bench-memray-doc build/sphinx/html
	dh_installdocs
