-
Notifications
You must be signed in to change notification settings - Fork 0
/
linuxVroomcoin.sh
118 lines (95 loc) · 2.22 KB
/
linuxVroomcoin.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#!/bin/bash
set -o errexit # Exit on error
set -o nounset # Trigger error when expanding unset variables
function realpath
{
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}"
}
SCRIPT_PATH="$(realpath ""$0"")"
PATCH_PATH="${SCRIPT_PATH/sh/patch}"
BASE_DIR="$HOME/vroomcoin"
function force
{
echo "Check failed: $1"
if [[ -z "$DO_FORCE" ]]
then
echo "Use --force to ignore checks"
exit 1
fi
}
function check
{
[[ $(cat /etc/debian_version) == 7.* ]] || force "Debian 7 (wheezy) required"
[[ -x "$(which git)" ]] || force "git not found. Please check that it is istalled and in PATH"
#[[ -f "$PATCH_PATH" ]] || force "Patch file not found"
}
function reset
{
sudo apt-get update || force "apt-get update failed"
sudo apt-get -y install build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev || force "apt-get install failed"
rm -rf "$BASE_DIR"
mkdir -p "$BASE_DIR"
cd "$BASE_DIR"
git clone https://github.com/vroomDotClub/vroomcoin
#cd src/leveldb
#chmod 755 build_detect_platform
#make
#make libmemenv.a
cp LevelDB/libleveldb.a src/leveldb/libleveldb.a
cp LevelDB/libmemenv.a src/leveldb/libmemenv.a
#cd vroomcoin
#git am "$PATCH_PATH"
}
function build
{
cd "$HOME/vroomcoin/vroomcoin/src"
make STATIC=1 USE_UPNP=1 -f makefile.unix
strip vroomcoind
}
function help
{
echo "Use:"
echo "$0 [ --help ] [ --force ] [ --reset ] [ --build ]"
}
DO_HELP=
DO_FORCE=
DO_RESET=
DO_BUILD=
for arg in "$@"
do
if [[ "$arg" == "--help" ]]
then
DO_HELP=1
elif [[ "$arg" == "--force" ]]
then
DO_FORCE=1
elif [[ "$arg" == "--reset" ]]
then
DO_RESET=1
elif [[ "$arg" == "--build" ]]
then
DO_BUILD=1
else
echo "Unknown argument: $arg"
help
exit 1
fi
done
if [[ -z "$DO_RESET" && -z "$DO_BUILD" || -n "$DO_HELP" ]]
then
help
exit 0
fi
check
if [[ -n "$DO_RESET" ]]
then
reset
fi
if [[ -n "$DO_BUILD" ]]
then
build
fi
if [[ -z "$DO_FORCE" ]]
then
echo "Success!"
fi