#!/usr/bin/make -f

export DH_GOLANG_INSTALL_ALL := 1

override_dh_auto_test:
	# TODO for some reason, we sometimes lose vendor/_testdata/copyfile/a/rick
	if [ ! -d '$(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/src/github.com/constabulary/gb/vendor/_testdata/copyfile' ]; then \
		cp -r vendor/_testdata/copyfile '$(CURDIR)/obj-$(DEB_BUILD_GNU_TYPE)/src/github.com/constabulary/gb/vendor/_testdata/'; \
	fi
	# some tests need network access (gated by -short), so we run those only via DEP8
	dh_auto_test -- -short

override_dh_auto_install:
	dh_auto_install
	# the source of "gb" shouldn't be shipped with the binary
	rm -rf debian/gb/usr/share/gocode

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