aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/aristanetworks/goarista/rpmbuild.sh
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2016-10-14 11:51:29 +0800
committerFelix Lange <fjl@twurst.com>2016-11-09 09:12:53 +0800
commit9f8d192991c4f68fa14c91366722bbca601da117 (patch)
tree5c1e089673d3f0208cd4a8208623bb95f29622c9 /vendor/github.com/aristanetworks/goarista/rpmbuild.sh
parent760fd65487614b7a61443cd9371015925795f40f (diff)
downloaddexon-9f8d192991c4f68fa14c91366722bbca601da117.tar
dexon-9f8d192991c4f68fa14c91366722bbca601da117.tar.gz
dexon-9f8d192991c4f68fa14c91366722bbca601da117.tar.bz2
dexon-9f8d192991c4f68fa14c91366722bbca601da117.tar.lz
dexon-9f8d192991c4f68fa14c91366722bbca601da117.tar.xz
dexon-9f8d192991c4f68fa14c91366722bbca601da117.tar.zst
dexon-9f8d192991c4f68fa14c91366722bbca601da117.zip
les: light client protocol and API
Diffstat (limited to 'vendor/github.com/aristanetworks/goarista/rpmbuild.sh')
-rwxr-xr-xvendor/github.com/aristanetworks/goarista/rpmbuild.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/vendor/github.com/aristanetworks/goarista/rpmbuild.sh b/vendor/github.com/aristanetworks/goarista/rpmbuild.sh
new file mode 100755
index 000000000..52b691bd9
--- /dev/null
+++ b/vendor/github.com/aristanetworks/goarista/rpmbuild.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+# Copyright (C) 2016 Arista Networks, Inc.
+# Use of this source code is governed by the Apache License 2.0
+# that can be found in the COPYING file.
+
+if [ "$#" -lt 1 ]
+then
+ echo "usage: $0 <binary>"
+ exit 1
+fi
+binary=$1
+
+if [ -z "$GOPATH" ] || [ -z "$GOOS" ] || [ -z "$GOARCH" ]
+then
+ echo "Please set \$GOPATH, \$GOOS and \$GOARCH"
+ exit 1
+fi
+
+set -e
+
+version=$(git rev-parse --short=7 HEAD)
+pwd=$(pwd)
+cd $GOPATH/bin
+if [ -d $GOOS_$GOARCH ]
+then
+ cd $GOOS_GOARCH
+fi
+os=$GOOS
+arch=$GOARCH
+if [ "$arch" == "386" ]
+then
+ arch="i686"
+fi
+cmd="fpm -n $binary -v $version -s dir -t rpm --rpm-os $os -a $arch --epoch 0 --prefix /usr/bin $binary"
+echo $cmd
+$cmd
+mv $binary-$version-1.$arch.rpm $pwd