#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

PKG        := github.com/jpillora/chisel
GO_LDFLAGS += -X $(PKG)/share.BuildVersion=$(DEB_VERSION)

export GODEBUG=x509ignoreCN=0

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

override_dh_auto_build:
	dh_auto_build -- -ldflags '$(GO_LDFLAGS)'

override_dh_auto_install:
	dh_auto_install -- --no-source
	# remove bench binary: only for tests
	rm debian/chisel/usr/bin/bench
