#!/usr/bin/make -f

include /usr/share/dpkg/pkg-info.mk

BUILDDIR := $(shell perl -w -MDebian::Debhelper::Buildsystem::golang -e \
        'print Debian::Debhelper::Buildsystem::golang->new()->get_builddir()')
DH_GOPKG := github.com/kr/binarydist

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

override_dh_auto_configure:
	dh_auto_configure -O--buildsystem=golang
	# Include test fixtures.
	cp -av testdata $(BUILDDIR)/src/$(DH_GOPKG)/

gen-orig-source:
	git archive --prefix=$(DEB_SOURCE)-$(DEB_VERSION)/     \
		upstream/$(subst ~,_,$(DEB_VERSION))           \
		-o ../$(DEB_SOURCE)_$(DEB_VERSION).orig.tar.xz
