#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

export PYBUILD_NAME=actdiag
ifneq (,$(PYBUILD_AUTOPKGTEST))
# pybuild doesn't copy src/$module/tests - use the installed copy instead
export PYBUILD_BEFORE_TEST:=ln -s /usr/lib/python3/dist-packages/${PYBUILD_NAME}/tests {build_dir}/tests
endif

%:
	dh $@ --buildsystem=pybuild

override_dh_python3:
	dh_python3
	mv -f $(CURDIR)/debian/python3-actdiag/usr/bin/actdiag $(CURDIR)/debian/python3-actdiag/usr/bin/actdiag3

convert_manpage_actdiag3:
	sed 's/^actdiag \\/actdiag3 \\/' $(CURDIR)/actdiag.1 > $(CURDIR)/debian/actdiag3.1
	sed -i 's/.B actdiag/.B actdiag3/g' $(CURDIR)/debian/actdiag3.1
	sed -i 's/.TH ACTDIAG /.TH ACTDIAG3 /' $(CURDIR)/debian/actdiag3.1
	sed -i 's/^\\fBactdiag/\\fBactdiag3/' $(CURDIR)/debian/actdiag3.1
