1 | #!/usr/bin/env bash
|
2 |
|
3 |
|
4 |
|
5 | ydbver="r128"
|
6 | ydbversion=r1.28
|
7 |
|
8 |
|
9 |
|
10 | echo 'Preparing environment'
|
11 |
|
12 | sudo apt-get update
|
13 | sudo apt-get install -y build-essential libssl-dev dos2unix nano locate subversion
|
14 | sudo apt-get install -y wget gzip openssh-server curl python-minimal libelf1
|
15 |
|
16 | FILE=/etc/apt/sources.list.d/ydb.list
|
17 | if [ -f "$FILE" ]; then
|
18 | echo "$FILE exist"
|
19 | else
|
20 | echo "$FILE does not exist"
|
21 | sudo touch /etc/apt/sources.list.d/ydb.list
|
22 | echo 'deb http://ftp.debian.org/debian/ buster main' | sudo tee -a /etc/apt/sources.list.d/ydb.list
|
23 | sudo apt-get update
|
24 | fi
|
25 |
|
26 | sudo apt-get -t buster install -y libc6 libncurses6
|
27 |
|
28 |
|
29 |
|
30 | sudo ln -s /lib/arm-linux-gnueabihf/libncursesw.so.6 /lib/arm-linux-gnueabihf/libncurses.so.5
|
31 |
|
32 |
|
33 |
|
34 | echo 'Installing YottaDB'
|
35 |
|
36 | echo "Installing YottaDB $ydbversion"
|
37 |
|
38 |
|
39 | mkdir -p /tmp/tmp
|
40 | cd /tmp/tmp
|
41 | wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
|
42 | chmod +x ydbinstall.sh
|
43 |
|
44 | gtmroot=/usr/lib/yottadb
|
45 | gtmcurrent=$gtmroot/current
|
46 |
|
47 |
|
48 | sudo mkdir -p $gtmcurrent
|
49 | sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
|
50 | echo "Configuring YottaDB $ydbversion"
|
51 |
|
52 | gtmprof=$gtmcurrent/gtmprofile
|
53 | gtmprofcmd="source $gtmprof"
|
54 | $gtmprofcmd
|
55 | tmpfile=`mktemp`
|
56 |
|
57 | echo 'copying ' $gtmprofcmd ' to profile...'
|
58 | echo $gtmprofcmd >> ~/.profile
|
59 |
|
60 | rm $tmpfile
|
61 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
62 |
|
63 | mkdir ~/.yottadb/sessiondb
|
64 |
|
65 | cat >~/.yottadb/sessiondb/gde.txt <<EOL
|
66 | add -name qs -region=qewdreg
|
67 | add -region qewdreg -dynamic=qewdseg
|
68 | add -segment qewdseg -file=$HOME/.yottadb/sessiondb/qewd.dat
|
69 | exit
|
70 | EOL
|
71 |
|
72 | echo 'Setting up local internal, unjournalled region for QEWD Session global'
|
73 | /usr/local/lib/yottadb/$ydbver/mumps -run ^GDE < $HOME/.yottadb/sessiondb/gde.txt
|
74 | /usr/local/lib/yottadb/$ydbver/mupip create -region=qewdreg
|
75 | /usr/local/lib/yottadb/$ydbver/mupip set -file -nojournal $HOME/.yottadb/sessiondb/qewd.dat
|
76 |
|
77 | echo 'YottaDB has been installed and configured, ready for use'
|
78 |
|
79 |
|
80 |
|
81 | echo 'Installing Node.js'
|
82 |
|
83 | cd ~
|
84 |
|
85 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash
|
86 | export NVM_DIR="$HOME/.nvm"
|
87 | [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
88 |
|
89 | VERSION=${1:-12}
|
90 |
|
91 | nvm install $VERSION
|
92 |
|
93 | PLATFORM=$(uname -m)
|
94 | if [[ "$PLATFORM" != "armv"* ]]; then
|
95 |
|
96 |
|
97 |
|
98 | sudo ln -s /usr/local/bin/node /usr/bin/node
|
99 | sudo ln -s /usr/local/lib/node /usr/lib/node
|
100 | sudo ln -s /usr/local/bin/npm /usr/bin/npm
|
101 | sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
|
102 | n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
|
103 | fi
|
104 |
|
105 |
|