-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathinstall_ubuntu.sh
executable file
·444 lines (309 loc) · 10 KB
/
install_ubuntu.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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
#!/bin/bash
echo "[0%] Updating apt-get..."
sudo apt-get update
echo "[0%] Updating apt-get... Done!"
echo "[5%] Upgrading apt-get..."
sudo apt-get upgrade --assume-yes --force-yes
echo "[5%] Upgrading apt-get... Done!"
echo "[10%] Finished."
install_package () {
REQUIRED_PKG="$1"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
if [ "" = "$PKG_OK" ]; then
sudo apt-get --assume-yes --force-yes -y install $REQUIRED_PKG
else
echo "Already installed."
fi
}
uninstall_package () {
REQUIRED_PKG="$1"
PKG_OK=$(dpkg-query -W --showformat='${Status}\n' $REQUIRED_PKG|grep "install ok installed")
if [ "install ok installed" = "$PKG_OK" ]; then
sudo apt remove --purge --auto-remove --assume-yes --force-yes -y $REQUIRED_PKG
fi
# clean remaining locks
sleep 1
sudo killall apt apt-get 2> /dev/null
sudo rm /var/lib/apt/lists/lock 2> /dev/null
sudo rm /var/cache/apt/archives/lock 2> /dev/null
sudo rm /var/lib/dpkg/lock 2> /dev/null
sudo rm /var/lib/dpkg/lock-frontend 2> /dev/null
}
echo ""
echo "[10%] Installing dependency: build-essential... "
install_package build-essential
echo ""
echo "[11%] Installing dependency: build-essential... Done!"
echo ""
echo "[11%] Installing dependency: cmake... "
version=3.14
build=1
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build
./bootstrap --prefix=/usr && make -j$(nproc) && sudo make install
cd -
echo ""
echo "[11%] Installing dependency: cmake... Done!"
echo ""
echo "[12%] Installing dependency: git... "
install_package git
echo ""
echo "[12%] Installing dependency: git... Done!"
echo ""
echo "[12%] Installing dependency: python3... "
install_package python3
echo ""
echo "[13%] Installing dependency: python3... Done!"
echo ""
echo "[13%] Installing dependency: Boost 1.71.0... "
wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.gz
tar -xf boost_1_71_0.tar.gz
cd boost_1_71_0
./bootstrap.sh --prefix=/usr --with-python=python3 &&
sudo ./b2 stage -j$(nproc) threading=multi link=shared --with-regex --with-test --with-filesystem --with-date_time --with-random --with-system --with-thread --with-program_options --with-chrono --with-fiber --with-log --with-context --with-math && sudo ./b2 install --prefix=/usr
cd -
echo ""
echo "[13%] Installing dependency: Boost 1.71.0... Done!"
echo ""
echo "[15%] Installing dependency: libtool... "
install_package libtool
echo ""
echo "[15%] Installing dependency: libtool... Done!"
echo ""
echo "[16%] Installing dependency: bsdmainutils... "
install_package bsdmainutils
echo ""
echo "[16%] Installing dependency: bsdmainutils... Done!"
echo ""
echo "[17%] Installing dependency: autotools-dev... "
install_package autotools-dev
echo ""
echo "[17%] Installing dependency: autotools-dev... Done!"
echo ""
echo "[18%] Installing dependency: autoconf... "
install_package autoconf
echo ""
echo "[18%] Installing dependency: autoconf... Done!"
echo ""
echo "[19%] Installing dependency: pkg-config... "
install_package pkg-config
echo ""
echo "[19%] Installing dependency: pkg-config... Done!"
echo ""
echo "[20%] Installing dependency: automake... "
install_package automake
echo ""
echo "[20%] Installing dependency: automake... Done!"
echo ""
echo "[22%] Installing dependency: libminiupnpc-dev... "
install_package libminiupnpc-dev
echo ""
echo "[22%] Installing dependency: libminiupnpc-dev... Done!"
echo ""
echo "[23%] Installing dependency: miniupnpc... "
install_package miniupnpd
echo ""
echo "[23%] Installing dependency: libminiupnpc-dev... Done!"
echo ""
echo "[23%] Installing dependency: libzmq3-dev... "
install_package libzmq3-dev
echo ""
echo "[23%] Installing dependency: libzmq3-dev... Done!"
echo ""
echo "[24%] Installing dependency: librocksdb-dev... "
install_package librocksdb-dev
echo ""
echo "[24%] Installing dependency: librocksdb-dev... Done!"
echo ""
echo "[25%] Installing dependency: libssl-dev... "
install_package libssl-dev
echo ""
echo "[25%] Installing dependency: libssl-dev... Done!"
echo ""
echo "[26%] Installing dependency: libgmp-dev... "
install_package libgmp-dev
echo ""
echo "[26%] Installing dependency: libgmp-dev... Done!"
echo ""
echo "[27%] Installing dependency: libevent-dev... "
install_package libevent-dev
echo ""
echo "[27%] Installing dependency: libevent-dev... Done!"
echo ""
echo "[28%] Installing dependency: libjsonrpccpp-dev... "
install_package libjsonrpccpp-dev
echo ""
echo "[28%] Installing dependency: libjsonrpccpp-dev... Done!"
echo ""
echo "[29%] Installing dependency: libsnappy-dev... "
install_package libsnappy-dev
echo ""
echo "Done!"
echo ""
echo "[30%] Installing dependency: libbenchmark-dev... "
install_package libbenchmark-dev
echo ""
echo "[30%] Installing dependency: libbenchmark-dev... Done!"
echo ""
echo "[31%] Installing dependency: libgtest-dev... "
install_package libgtest-dev
echo ""
echo "[31%] Installing dependency: libgtest-dev... Done!"
echo ""
echo "[32%] Configuring GTest... "
cd /usr/src/googletest
sudo cmake . && sudo cmake --build . --target install && cd -
echo ""
echo "[32%] Configuring GTest... Done!"
echo ""
echo "[32%] Checking Berkeley DB... "
uninstall_package libdb-dev
uninstall_package libdb++-dev
echo ""
echo "[32%] Checking Berkeley DB... Done!"
echo ""
echo "[33%] Installing dependency: libprotobuf-dev... "
install_package libprotobuf-dev
echo ""
echo "[33%] Installing dependency: libprotobuf-dev... Done!"
echo ""
echo "[34%] Installing dependency: protobuf-compiler... "
install_package protobuf-compiler
echo ""
echo "[34%] Installing dependency: protobuf-compiler... Done!"
echo ""
echo "[35%] Installing dependency: libqrencode-dev... "
install_package libqrencode-dev
echo ""
echo "[35%] Installing dependency: libqrencode-dev... Done!"
echo ""
echo "[36%] Installing dependency: libpng-dev... "
install_package libpng-dev
echo ""
echo "[36%] Installing dependency: libpng-dev... Done!"
echo ""
echo "[39%] Installing QT Components. "
echo ""
echo "[40%] Installing QT dependency: libqt5gui5... "
install_package libqt5gui5
echo ""
echo "[40%] Installing QT dependency: libqt5gui5... Done!"
echo ""
echo "[41%] Installing QT dependency: libqt5core5a... "
install_package libqt5core5a
echo ""
echo "[41%] Installing QT dependency: libqt5core5a... Done!"
echo ""
echo "[42%] Installing QT dependency: libqt5dbus5... "
install_package libqt5dbus5
echo ""
echo "[42%] Installing QT dependency: libqt5dbus5... Done!"
echo ""
echo "[43%] Installing QT dependency: qttools5-dev... "
install_package qttools5-dev
echo ""
echo "[43%] Installing QT dependency: qttools5-dev... Done!"
echo ""
echo "[44%] Installing QT dependency: qttools5-dev-tools... "
install_package qttools5-dev-tools
echo ""
echo "[44%] Installing QT dependency: qttools5-dev-tools... Done!"
echo ""
echo "[45%] Installing QT dependency: libqt5svg5-dev... "
install_package libqt5svg5-dev
echo ""
echo "[45%] Installing QT dependency: libqt5svg5-dev... Done!"
echo ""
echo "[46%] Installing QT dependency: libqt5charts5-dev... "
install_package libqt5charts5-dev
echo ""
echo "[46%] Installing QT dependency: libqt5charts5-dev... Done!"
echo ""
echo "[47%] All QT Components has been installed. "
echo ""
echo "[50%] Checking is folder the git repository... "
if [ -d .git ]; then
echo -ne "yes"
if [ "$1" = "update" ]
then
echo ""
echo "[50%] Updating current version of the BTCU... "
git checkout master
if [ -s "versions.txt" ]
then
file="versions.txt"
l=""
while IFS= read line
do
l=$line
done <"$file"
my_var="$( cut -d ' ' -f 2 <<< "$l" )";
echo ""
echo "[51%] Working branch: release_$my_var"
git checkout "release_$my_var"
else
echo ""
echo "[51%] Working branch: master"
fi
git pull
echo ""
echo "[50%] Updating current version of the BTCU... Done!"
echo ""
else
echo ""
echo "[50%] Updating current version of the BTCU"
fi
else
echo -ne "no"
echo ""
echo "[50%] Downloading latest version of the BTCU... "
git clone https://github.com/bitcoin-ultimatum/orion
cd orion
echo ""
echo "[50%] Downloading latest version of the BTCU... Done!"
echo ""
fi;
echo ""
echo "[60%] Installing Berkeley DB... "
if [ -f /opt/lib/libdb-18.1.a ]
then
echo "[60%] Berkeley DB is already installed."
else
# Since as of 5th March 2020 the Oracle moved Barkeley DB
# to login-protected tarball for 18.1.32 version
# we added the dependency as a static file included in the repository.
# You can check the details in depends/packages/static/berkeley-db-18.1.32/README.MD
tar zxvf depends/packages/static/berkeley-db-18.1.32/berkeley-db-18.1.32.tar.gz -C ./
cd db-18.1.32/build_unix
../dist/configure --enable-cxx --disable-shared --disable-replication --with-pic --prefix=/opt && make && sudo make install
cd -
fi
echo ""
echo "[60%] Installing Berkeley DB... Done!"
echo ""
echo "[65%] Running CMake configuring... "
cmake -G "CodeBlocks - Unix Makefiles" .
echo ""
echo "[65%] Running CMake configuring... Done!"
echo ""
echo "[75%] Building BTCU... "
make
echo ""
echo "[75%] Building BTCU... Done!"
echo ""
echo "[100%] Build is completed!"
echo ""
echo ""
echo ""
echo "=========================================================="
echo "The built binaries was placed in ./bin folder"
echo "For start daemon please run:"
echo "./bin/btcud -daemon"
echo "Outputs a list of command-line options:"
echo "./bin/btcu-cli --help"
echo "Outputs a list of RPC commands when the daemon is running:"
echo "./bin/btcu-cli help"
echo "Start GUI:"
echo "./src/qt/btcu-qt"
echo "=========================================================="