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

# Uncomment this to enable verbose mode.
#export DH_VERBOSE := 1

BINNAME := $(DEB_SOURCE)

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

execute_before_dh_auto_build:
	# Copy vendored packages
	cp -a debian/vendor _build/src/$(PKG)/

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

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

override_dh_auto_install:
	dh_auto_install -- --no-source
