#!/usr/bin/make -f
# -*- makefile -*-

export GOVER := $(shell debian/helpers/getver.pl)
golang_archs = $(shell debian/helpers/getgoarches.pl)

IS_GOLANG_ARCH := true
ifeq (,$(filter $(DEB_HOST_ARCH),$(golang_archs)))
        IS_GOLANG_ARCH := false
endif

%:
	dh $@

override_dh_clean:
	dh_clean
	rm -f debian/golang-go.links

override_dh_prep:
	dh_prep
ifeq (true, $(IS_GOLANG_ARCH))
	cp debian/golang-go.links.golang-go debian/golang-go.links
else
	cp debian/golang-go.links.gccgo debian/golang-go.links
endif

override_dh_gencontrol:
	dh_gencontrol -- -Vgolang:GOVER=$(GOVER)
