#!/usr/bin/make -f

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

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

override_dh_auto_install:
	rm -f _build/bin/mk-add-tree-request _build/bin/sha256-n \
		_build/bin/use-agent
	dh_auto_install

ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
override_dh_installman:
	for c in $$(cd $(CURDIR)/_build/bin && echo *); do \
		help2man --no-info --version-string="$(DEB_VERSION)" \
			-Idebian/$$c.h2m $(CURDIR)/_build/bin/$$c > $$c.1; \
	done
	dh_installman *.1
	rm -f *.1
endif
