#!/usr/bin/make -f

export DH_VERBOSE=1
export DH_GOPKG := github.com/prometheus/prometheus_cli

DEBPKGNAME ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')

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

override_dh_auto_install:
	dh_auto_install
	# we don't want the golang source (yet?)
	rm -r debian/$(DEBPKGNAME)/usr/share/gocode
	# Rename the binary to match the debian package.
	mv -v debian/$(DEBPKGNAME)/usr/bin/prometheus_cli \
	    debian/$(DEBPKGNAME)/usr/bin/$(DEBPKGNAME)

