#!/usr/bin/make -f

# The next two lines are part of the support for yggdrasilctl getSelf.
# For details, see #1034737.
include /usr/share/dpkg/pkg-info.mk
LDFLAGS := -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildName=yggdrasil -X github.com/yggdrasil-network/yggdrasil-go/src/version.buildVersion=$(DEB_VERSION_UPSTREAM)

DH_GOLANG_EXCLUDES:=ansible mobile
export DH_GOLANG_EXCLUDES

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

# The next two lines are part of the support for yggdrasilctl getSelf.
# For details, see #1034737.
override_dh_auto_build:
	dh_auto_build -- -ldflags "$(LDFLAGS)"

override_dh_installsystemd:
	dh_installsystemd --no-enable --no-restart-on-upgrade --no-start

override_dh_auto_install:
	cp _build/bin/genkeys _build/bin/yggdrasil-genkeys
	dh_auto_install -- --no-binaries

