From c03a0bc9d07cd714e17616cf6d3d53cdf148dd5d Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Thu, 13 Mar 2014 08:41:51 +0000
Subject: [PATCH] install Go for the host architecture

---
 debian/install-golang | 12 ++++++------
 debian/rules          |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/debian/install-golang b/debian/install-golang
index f89851f..7ea0574 100755
--- a/debian/install-golang
+++ b/debian/install-golang
@@ -3,16 +3,16 @@
 # Install Go.
 #
 
-get_arch() {
-  case $(uname -m) in
+mangle_arch() {
+  case $1 in
   i686) echo 386 ;;
-  x86_64) echo amd64 ;;
+  *) echo $1 ;;
   esac
 }
 
-ROOT="${1}"
-VERSION="${2}"
-ARCH=$(get_arch)
+ROOT="$1"
+ARCH=`mangle_arch $2`
+VERSION="$3"
 DL_URL=https://go.googlecode.com/files/go${VERSION}.linux-${ARCH}.tar.gz
 
 mkdir -p ${ROOT}
diff --git a/debian/rules b/debian/rules
index 7ae7881..4ceff66 100755
--- a/debian/rules
+++ b/debian/rules
@@ -26,7 +26,7 @@ override_dh_install:
 	install -m 755 -o root -g root -d $(DEBDIR)/localauditd/usr/sbin
 	(export GOPATH=$(BUILDDIR) GOROOT=$(GOROOT) ; \
 	 mkdir -p $(GOROOT) $(BUILDDIR)/src/$(GOPKG) ; \
-	 sh $(CURDIR)/debian/install-golang $(GOROOT) $(GO_VERSION) ; \
+	 sh $(CURDIR)/debian/install-golang $(GOROOT) $(DEB_HOST_ARCH) $(GO_VERSION) ; \
 	 rsync -a --exclude=debian --exclude=.git $(CURDIR)/ $(BUILDDIR)/src/$(GOPKG)/ ; \
 	 cd $(BUILDDIR)/src && \
 	 $(GOROOT)/bin/go get -d -v ./$(GOPKG)/... && \
-- 
GitLab