#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk

export DH_GOPKG := github.com/soundcloud/ipmi_exporter

BUILDDIR := $(CURDIR)/build
BINNAME := $(DEB_SOURCE)

%:
	dh $@ --buildsystem=golang --with=golang --builddirectory=$(BUILDDIR)

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)
	# Rename the binary to match the debian package.
	mv -v $(BUILDDIR)/bin/ipmi_exporter $(BUILDDIR)/bin/$(BINNAME)

override_dh_auto_install:
	dh_auto_install -- --no-source

override_dh_installinit:
	dh_installinit --noscripts
