#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

export PYBUILD_NAME=sounddevice
export SOUNDDEVICE_VERSION_RELEASE ?= "$(firstword $(subst +, ,$(DEB_VERSION_UPSTREAM))) (Debian $(DEB_VERSION))"
export SOUNDDEVICE_VERSION_TODAY ?= "$(shell date -u -d @$(SOURCE_DATE_EPOCH) +%Y-%m-%d)"

%:
	dh $@ --buildsystem=pybuild

override_dh_sphinxdoc:
	http_proxy='http://127.0.0.1:9/' PYTHONPATH=$(CURDIR)/.pybuild/cpython3_$(shell py3versions -vd)_sounddevice/build python3 -P -m sphinx -N -bhtml doc/ debian/python-sounddevice-doc/usr/share/doc/python-sounddevice-doc/html/
	-rmdir debian/python-sounddevice-doc/usr/share/doc/python-sounddevice-doc/html/_sources/
	dh_sphinxdoc
