#!/usr/bin/make -f

export DH_OPTIONS

export DH_GOLANG_EXCLUDES := test vendor
export DH_GOLANG_GO_GENERATE := 1
export DH_GOLANG_INSTALL_EXTRA := git/githistory/fixtures tq/schemas locking/schemas docs/man
export PATH := $(CURDIR)/_build/bin:$(PATH)

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

override_dh_clean:
	rm -rf man
	dh_clean

override_dh_auto_build:
	dh_auto_build
	rm -f _build/bin/script
	rm -f _build/bin/man
	rm -f _build/bin/cmd
	rm -f _build/bin/trgen
	mkdir man
	asciidoctor -b manpage -D man/ docs/man/*.adoc
