Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/build.sh

60 lines
1.1 KiB
Bash
Raw Normal View History

2015-10-21 19:48:14 +05:00
#!/usr/bin/env bash
2015-10-21 19:45:49 +05:00
root=$(readlink -e $(dirname $0))
set -e
if [ "x" == "x$root" ] ; then
root=$PWD/${0##*}
fi
cd $root
2016-03-09 18:36:44 +05:00
tags=""
help_text="usage: $0 [--disable-redis]"
# check for help flags first
for arg in $@ ; do
case $arg in
-h|--help)
echo $help_text
exit 0
;;
esac
done
2016-04-19 02:11:40 +05:00
rev="QmaNuKBcG3hb5YJ4xpeipdX3t2Fw6pwZJSnpvsfn9Zj1tm"
2016-04-18 17:40:01 +05:00
_next=""
2016-03-09 18:36:44 +05:00
# check for build flags
for arg in $@ ; do
case $arg in
"--disable-redis")
tags="$tags -tags disable_redis"
;;
2016-04-18 17:40:01 +05:00
"--revision")
_next="rev"
;;
"--revision=*")
rev=$(echo $arg | cut -d'=' -f2)
;;
*)
if [ "x$_next" == "xrev" ] ; then
rev="$arg"
fi
2016-03-09 18:36:44 +05:00
esac
done
2016-04-18 17:40:01 +05:00
if [ "x$rev" == "x" ] ; then
echo "revision not specified"
exit 1
fi
2015-10-21 19:45:49 +05:00
cd $root
2016-04-19 04:42:24 +05:00
#echo "obtaining gx"
#go get -v github.com/whyrusleeping/gx
#go get -v github.com/whyrusleeping/gx-go
#gx install --global && go build -v
export GOPATH=$PWD/go
mkdir -p $GOPATH
go get -u -v github.com/majestrate/srndv2
cp $GOPATH/bin/srndv2 $root
2016-03-09 18:36:44 +05:00
echo "Built"