#!/usr/bin/make -f

export PATH := $(shell ls -d /usr/lib/go-1.*/bin | sort -V | tail -1):$(PATH)

%:
	dh $@

override_dh_auto_build:
	cd $(CURDIR) && GO111MODULE=on go build -mod=vendor -trimpath -o fortigate_exporter .

override_dh_auto_install:
	install -D -m 0755 fortigate_exporter debian/fortigate-exporter/usr/bin/fortigate_exporter

override_dh_auto_clean:
	rm -f fortigate_exporter

override_dh_golang:
	# Using manual build, skip dh_golang

override_dh_makeshlibs:
	# Go binaries don't use shared libraries

override_dh_shlibdeps:
	# Go binaries don't use shared libraries

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-start --name fortigate-exporter

override_dh_dwz:
	dh_dwz -X fortigate-exporter
