#!/usr/bin/make -f

# Installation paths
export DESTDIR=$(CURDIR)/debian/aerc
export PREFIX=/usr

# Go options
export GO111MODULE=off
export GOPROXY=off
export GOCACHE=$(CURDIR)/_build/go-build
export GOPATH=$(CURDIR)/_build
export GOFLAGS=-tags=notmuch -buildmode=pie

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

override_dh_auto_configure:
	dh_auto_configure
	cp Makefile _build/src/git.sr.ht/~sircmpwn/aerc/
	cp -r doc filters templates _build/src/git.sr.ht/~sircmpwn/aerc/
	cp config/*.conf* _build/src/git.sr.ht/~sircmpwn/aerc/config/

override_dh_auto_build:
	cd _build/src/git.sr.ht/~sircmpwn/aerc && make

override_dh_auto_install:
	cd _build/src/git.sr.ht/~sircmpwn/aerc && make install
