#!/usr/bin/make -f

#export DH_VERBOSE=1
export DH_GOLANG_EXCLUDES =
export DH_GOLANG_GO_GENERATE := 1

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

# Need to exclude packages without .go files.
override_dh_auto_build: DH_GOLANG_EXCLUDES += test/jsonpb-gogo
override_dh_auto_build:
	dh_auto_build

override_dh_auto_test:
ifneq (,$(filter $(DEB_HOST_ARCH),armhf))
## Ignore test failures:
##    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824717
##    https://github.com/gogo/protobuf/issues/164
	-PATH="$(CURDIR)/_build/bin:$$PATH" dh_auto_test
else
	PATH="$(CURDIR)/_build/bin:$$PATH" dh_auto_test
endif
