#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#export DH_VERBOSE = 1

export PYBUILD_NAME=pyocd

# Prevent setuptools/distribute from accessing the internet.
export http_proxy = http://127.0.9.1:9


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

override_dh_auto_build:
	python3 setup.py build
	rst2man debian/pyocd-gdbserver.rst > debian/pyocd-gdbserver.1
	rst2man debian/pyocd-tool.rst > debian/pyocd-tool.1
	rst2man debian/pyocd-flashtool.rst > debian/pyocd-flashtool.1

override_dh_auto_install:
	python3 setup.py install --root=$(CURDIR)/debian/python3-pyocd/ --install-layout=deb
	dh_installman -ppython3-pyocd debian/pyocd-gdbserver.1
	dh_installman -ppython3-pyocd debian/pyocd-tool.1
	dh_installman -ppython3-pyocd debian/pyocd-flashtool.1

override_dh_auto_clean:
	python3 setup.py clean -a
	${RM} -r .eggs

