#!/usr/bin/make -f

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

export GO111MODULE=off
export GOPROXY=off
export GOCACHE=$(CURDIR)/_build/go-build
export GOPATH=$(CURDIR)/_build
export DH_GOLANG_INSTALL_EXTRA := govarnam/migrations/ install.sh.in govarnam.syms

export DESTDIR=debian/tmp
export PREFIX=/usr

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

override_dh_auto_build:
	make LIBDIR=/lib/$(DEB_HOST_MULTIARCH) VERSION=$(DEB_VERSION_UPSTREAM) library install.sh pc

override_dh_auto_install:
	SUDO=fakeroot make install

override_dh_auto_test:
	# TODO: run tests once we have the VST files in Debian
