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

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

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

execute_after_dh_auto_build:
	# Rename the binary to match the debian package.
	mv -v $(BUILDDIR)/bin/bird_exporter $(BUILDDIR)/bin/$(BINNAME)

override_dh_auto_install:
	dh_auto_install -- --no-source

execute_before_dh_installman:
	pandoc -s -t man bird_exporter.1.md -o $(BINNAME).1
