#!/usr/bin/make -f

export DEB_BUILD_MAINT_OPTIONS = hardening=+all

%:
	dh $@ --with sphinxdoc --buildsystem=cmake --sourcedirectory=src/ --no-parallel

override_dh_auto_build:
	dh_auto_build
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	cd doc/sphinx/ ; sphinx-build -b html ./ html
endif

override_dh_auto_clean:
	dh_auto_clean
	rm -rf doc/sphinx/html
override_dh_sphinxdoc:
	dh_sphinxdoc
	find debian/libsvgpp-doc/usr/share/doc/libsvgpp-doc/html -type f -print0 | xargs -0 sed -i 's/https:\/\/cdn\.mathjax\.org\/mathjax\/latest/\/usr\/share\/javascript\/mathjax/g'
	rm -rf debian/libsvgpp-doc/usr/share/doc/libsvgpp-doc/html/_sources/license.txt 
