#!/usr/bin/make -f
#DH_VERBOSE=1
export DH_GOPKG := github.com/danos/provisiond
export DH_GOLANG_INSTALL_EXTRA := testdata/configtest testdata/configtest_yang

GOBUILDDIR := _build

%:
	dh $@ --buildsystem=golang --with=golang,vci --builddirectory=$(GOBUILDDIR)

override_dh_auto_build: vet
	dh_auto_build

override_dh_auto_install:
	dh_auto_install --destdir=debian/tmp

# We do not vet vendor code
vet:
	if go doc cmd/vet >/dev/null 2>&1; then \
		GOPATH=$(CURDIR)/$(GOBUILDDIR) go vet $$(find . -type f -name \*.go | \
	    xargs dirname | sort -u | grep -v "/vendor/"); \
	fi
