#!/usr/bin/make -f

#export DH_VERBOSE := 1
# Disable conformance due to it requires with Bazel workspace, and not to vendoring it due to out of previous discussion.
export DH_GOLANG_EXCLUDES := examples codelab repl/main conformance
export DH_GOLANG_INSTALL_EXTRA := cel/templates/authoring.tmpl

export BUILDDIR := build

%:
	dh $@ --builddirectory=$(BUILDDIR) --buildsystem=golang --with=golang

override_dh_auto_configure:
	mkdir -p -v $(BUILDDIR)/src/github.com/google/cel-go/vendor
	cp -v -a debian/missing-sources/* $(BUILDDIR)/src/github.com/google/cel-go/vendor
	dh_auto_configure

override_dh_install:
	find debian/golang-github-google-cel-go-dev/usr/share/gocode/src/github.com/google/cel-go/ \
	    -type f -exec chmod -x \{\} \;
	dh_install -i

override_dh_auto_test:
	# Set to warn to workaround the conflict registration from vendor/
	GOLANG_PROTOBUF_REGISTRATION_CONFLICT=warn dh_auto_test -- -short
