2015-10-05 20:32:10 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
2015-12-20 17:44:11 +01:00
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2016-04-10 23:16:09 +02:00
|
|
|
# gocryptfs version according to git
|
2015-11-01 13:55:35 +01:00
|
|
|
GITVERSION=$(git describe --tags --dirty)
|
2016-04-10 23:16:09 +02:00
|
|
|
# go-fuse version according to git
|
2016-04-28 08:41:39 +02:00
|
|
|
GITVERSIONFUSE=$(cd $GOPATH/src/github.com/hanwen/go-fuse && git rev-parse --short HEAD)
|
2015-11-01 13:55:35 +01:00
|
|
|
|
2016-06-14 22:56:28 +02:00
|
|
|
# Make sure we have the go binary
|
|
|
|
go version > /dev/null
|
|
|
|
|
2016-06-19 19:33:15 +02:00
|
|
|
# "go version go1.6.2 linux/amd64" -> "1.6"
|
2015-12-20 17:30:10 +01:00
|
|
|
V=$(go version | cut -d" " -f3 | cut -c3-5)
|
|
|
|
|
|
|
|
if [ $V == "1.3" -o $V == "1.4" ]
|
|
|
|
then
|
2016-04-10 23:16:09 +02:00
|
|
|
go build -ldflags="-X main.GitVersion $GITVERSION -X main.GitVersionFuse $GITVERSIONFUSE"
|
2015-12-20 17:30:10 +01:00
|
|
|
else
|
2015-12-20 17:44:11 +01:00
|
|
|
# Go 1.5 wants an "=" here
|
2016-04-10 23:16:09 +02:00
|
|
|
go build -ldflags="-X main.GitVersion=$GITVERSION -X main.GitVersionFuse=$GITVERSIONFUSE"
|
2015-12-20 17:30:10 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
./gocryptfs -version
|
2016-01-09 15:31:34 +01:00
|
|
|
|
|
|
|
mkdir -p $GOPATH/bin
|
|
|
|
cp -af gocryptfs $GOPATH/bin
|