#!/usr/bin/make -f

export INSTALL_PATH = /usr/share/bazel/tools/bazel_lib

%:
	dh $@

override_dh_auto_build:
	mkdir -p _build/src/github.com/bazel-contrib/bazel-lib _build/src/github.com/bmatcuk/doublestar
	cp -r tools _build/src/github.com/bazel-contrib/bazel-lib/
	ln -sf /usr/share/gocode/src/github.com/bmatcuk/doublestar _build/src/github.com/bmatcuk/doublestar/v4
	GOPATH=$(CURDIR)/_build:/usr/share/gocode GO111MODULE=off GOCACHE=$(CURDIR)/_build/gocache \
		go install -trimpath github.com/bazel-contrib/bazel-lib/tools/...

override_dh_auto_test:

override_dh_auto_install:

override_dh_dwz:

execute_after_dh_fixperms:
	chmod +x debian/bazel-lib$(INSTALL_PATH)/lib/private/diff_test_tmpl.sh
	chmod +x debian/bazel-lib$(INSTALL_PATH)/shlib/lib/assertions.sh
