#!/usr/bin/make -f

include /usr/share/dpkg/default.mk

BUILDER    := $(shell sed -ne 's,^Maintainer: .[^<]*<\([^>]*\)>,\1,p' debian/control)
BUILDPKG   := github.com/elves/elvish/build
BUILDFLAGS := -ldflags\
  "-X $(BUILDPKG).Version=$(DEB_VERSION)\
   -X $(BUILDPKG).Builder=$(BUILDER)"

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

override_dh_auto_build:
	dh_auto_build -- $(BUILDFLAGS)

override_dh_auto_install:
	dh_auto_install -- --no-source
