#!/usr/bin/make -f

export GOPATH=$(CURDIR)/_build
export GOBIN=$(CURDIR)/_build/bin
export GO111MODULE=on

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

override_dh_auto_build:
	make version
	make releasebin

override_dh_auto_test:
	go test

override_dh_auto_install:
	install -p -m 0755 $(CURDIR)/_build/bin/packer $(CURDIR)/debian/packer/usr/bin
	install -p -m 0755 $(CURDIR)/contrib/zsh-completion/_packer $(CURDIR)/debian/packer/usr/share/zsh/vendor-completions
	install -p -m 0644 $(CURDIR)/debian/packer.png $(CURDIR)/debian/packer/usr/share/pixmaps
