#!/usr/bin/make -f

export PYBUILD_NAME=sphinx-autodoc2

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

override_dh_installdocs:
	https_proxy='127.0.0.1:9' http_proxy='127.0.0.1:9' sphinx-build -b html docs build/sphinx/html

	# Remove or replace privacy-breach URLs with local paths
	find -type f -name "*.html" -exec sed -i 's|https://img.shields.io/github/stars/chrisjsewell/sphinx-autodoc2|(URL removed)|g' {} +
	find -type f -name "*.html" -exec sed -i 's|https://img.shields.io/pypi/v/sphinx-autodoc2|(URL removed)|g' {} +

	dh_installdocs -ppython-sphinx-autodoc2-doc --doc-main-package=python-sphinx-autodoc2-doc build/sphinx/html
	dh_installdocs
