#!/usr/bin/make -f

# Exclude cas/cloudcas, kms/cloudkms and cmd/step-cloudkms-init until golang-google-cloud
# in repos has been updated to v0.83.0
export DH_GOLANG_EXCLUDES := cas/cloudcas cmd/step-cloudkms-init kms/cloudkms examples

include /usr/share/dpkg/pkg-info.mk
VERSION = $(shell echo $(DEB_VERSION) | cut -d- -f1)
LDFLAGS := -ldflags '-w -X "main.Version=$(VERSION)"'

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

execute_before_dh_auto_configure:
	rm -f acme/challenge_test.go acme/db/nosql/challenge_test.go

override_dh_auto_build:
	dh_auto_build -- $(LDFLAGS)
