#!/usr/bin/make -f

export DH_GOLANG_INSTALL_EXTRA := test

MANPAGES = reposurgeon.1 repotool.1 repomapper.1 repocutter.1
HTMLFILES = $(MANPAGES:.1=.html) \
            dvcs-migration-guide.html features.html reporting-bugs.html

%:
	dh $@ --builddirectory=_build --buildsystem=golang --with golang,python3

execute_after_dh_auto_configure:
	ln -s $(CURDIR)/debian/go/src _build/src/gitlab.com/esr/reposurgeon/vendor

execute_after_dh_auto_build:
	for i in cutter mapper surgeon; do \
		cp -al _build/bin/$$i repo$$i ; \
		done
	make $(MANPAGES) $(HTMLFILES)

override_dh_auto_install:
	DH_INTERNAL_OPTIONS= dh_auto_install -- prefix=/usr

# Run "make check" for fullcheck when ready
#
#override_dh_auto_test:
#	$(subst test,check,$(shell dh_auto_test --no-act -v))

execute_after_dh_auto_clean:
	DH_INTERNAL_OPTIONS= dh_auto_clean
