#!/usr/bin/make -f

export GOPATH=$(CURDIR)/_build
export TMPDIR=$(CURDIR)/_build

%:
	dh $@ --buildsystem=golang --builddirectory=$(CURDIR)/_build

override_dh_auto_clean:
	rm -rf $(CURDIR)/obj-x86_64-linux-gnu $(CURDIR)/_build $(CURDIR)/execs/popeye

override_dh_auto_build:
	make build

override_dh_auto_test:
	go test

override_dh_auto_install:
	install -p -m 0755 $(CURDIR)/execs/popeye $(CURDIR)/debian/popeye/usr/bin/popeye
	install -p -m 0644 $(CURDIR)/debian/popeye.png $(CURDIR)/debian/popeye/usr/share/pixmaps/
	$(CURDIR)/debian/popeye/usr/bin/popeye completion bash > $(CURDIR)/debian/popeye/usr/share/bash-completion/completions/popeye
	$(CURDIR)/debian/popeye/usr/bin/popeye completion zsh > $(CURDIR)/debian/popeye/usr/share/zsh/vendor-completions/_popeye

override_dh_installdocs:
	dh_installdocs --all $(CURDIR)/LICENSE $(CURDIR)/README.md $(CURDIR)/change_logs/*

override_dh_dwz:
