#!/usr/bin/make -f

export PYBUILD_NAME=ubelt

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

execute_after_dh_auto_build:
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	PYTHONPATH=$(CURDIR) $(MAKE) -C docs html
	# Avoid external images, but no PoYIsWE.png is here
	sed -i 's/https:\/\/i.imgur.com\/PoYIsWE.png//g' docs/build/html/index.html
endif

execute_after_dh_auto_clean:
ifeq (,$(findstring nodoc,$(DEB_BUILD_PROFILES)))
	$(MAKE) -C docs clean
endif

override_dh_installdocs:
	dh_installdocs -ppython-ubelt-doc --doc-main-package=python3-ubelt
	dh_installdocs --remaining-packages
