#!/usr/bin/make -f

#export DH_VERBOSE = 1
include /usr/share/dpkg/pkg-info.mk

export GOCACHE=$(CURDIR)/vendor
export GOPATH=$(CURDIR)/vendor
export GOPROXY=off

%:
	dh $@

execute_after_dh_auto_clean:
	rm -rf vendor

override_dh_auto_build:
	# we just want calicoctl in Kali
	cp -r debian/vendor $(CURDIR)
	cd calicoctl && go build -v -o bin/calicoctl -ldflags "-X github.com/projectcalico/calico/calicoctl/calicoctl/commands.VERSION=upstream/$(DEB_VERSION_UPSTREAM) -X github.com/projectcalico/calico/calicoctl/calicoctl/commands/common.VERSION=upstream/$(DEB_VERSION_UPSTREAM)" "./calicoctl/calicoctl.go"

override_dh_auto_test:

override_dh_dwz:
	# fails with "dwz: debian/calicoctl/usr/bin/calicoctl: Found
	# compressed .debug_abbrev section, not attempting dwz
	# compression"
