#!/usr/bin/make -ef

export PYBUILD_NAME = certbot

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

%:
	dh $@ --with python2,sphinxdoc,systemd --buildsystem=pybuild

override_dh_clean: debian/control
	dh_clean

debian/control: debian/control.in debian/changelog
	sed -e 's/###UPSTREAM_VERSION###/$(DEB_VERSION_UPSTREAM)/g' < debian/control.in > debian/control

override_dh_install:
	mkdir -p debian/certbot/usr/bin
	mv debian/python-certbot/usr/bin/* debian/certbot/usr/bin
	rm -rf debian/python-certbot/usr/bin
	http_proxy='127.0.0.1:9' \
		https_proxy='127.0.0.1:9' \
		sphinx-build -N -bhtml docs/ build/html
	http_proxy='127.0.0.1:9' \
		https_proxy='127.0.0.1:8' \
		sphinx-build -N -bman docs/ build/man

override_dh_installinit:
