#!/usr/bin/make -f

export DH_OPTIONS

BUILD_DIR := obj-$(DEB_BUILD_GNU_TYPE)
export DH_GOLANG_EXCLUDES := test vendor
export DH_GOLANG_INSTALL_EXTRA := git/githistory/fixtures tq/schemas locking/schemas
export PATH := $(CURDIR)/$(BUILD_DIR)/bin:$(PATH)

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

override_dh_clean:
	rm -rf man
	dh_clean

override_dh_auto_build:
	dh_auto_build
	rm $(BUILD_DIR)/bin/script
	rm $(BUILD_DIR)/bin/man
	rm $(BUILD_DIR)/bin/genmakefile
	./script/man

override_dh_auto_install:
	dh_auto_install -- --no-source
