UNPKG

2.89 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# 28 January 2020
4
5ydbver="r128"
6ydbversion=r1.28
7
8# Prepare
9
10echo 'Preparing environment'
11
12sudo apt-get update
13sudo apt-get install -y build-essential libssl-dev dos2unix nano locate subversion
14sudo apt-get install -y wget gzip openssh-server curl python-minimal libelf1
15
16FILE=/etc/apt/sources.list.d/ydb.list
17if [ -f "$FILE" ]; then
18 echo "$FILE exist"
19else
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
24fi
25
26sudo apt-get -t buster install -y libc6 libncurses6
27
28# Raspberry Pi fix
29
30sudo ln -s /lib/arm-linux-gnueabihf/libncursesw.so.6 /lib/arm-linux-gnueabihf/libncurses.so.5
31
32# YottaDB
33
34echo 'Installing YottaDB'
35
36echo "Installing YottaDB $ydbversion"
37
38# Create a temporary directory for the installer
39mkdir -p /tmp/tmp
40cd /tmp/tmp
41wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
42chmod +x ydbinstall.sh
43
44gtmroot=/usr/lib/yottadb
45gtmcurrent=$gtmroot/current
46
47# make sure directory exists for links to current YottaDB
48sudo mkdir -p $gtmcurrent
49sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
50echo "Configuring YottaDB $ydbversion"
51
52gtmprof=$gtmcurrent/gtmprofile
53gtmprofcmd="source $gtmprof"
54$gtmprofcmd
55tmpfile=`mktemp`
56
57echo 'copying ' $gtmprofcmd ' to profile...'
58echo $gtmprofcmd >> ~/.profile
59
60rm $tmpfile
61unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
62
63mkdir ~/.yottadb/sessiondb
64
65cat >~/.yottadb/sessiondb/gde.txt <<EOL
66add -name qs -region=qewdreg
67add -region qewdreg -dynamic=qewdseg
68add -segment qewdseg -file=$HOME/.yottadb/sessiondb/qewd.dat
69exit
70EOL
71
72echo '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
77echo 'YottaDB has been installed and configured, ready for use'
78
79# Node.js
80
81echo 'Installing Node.js'
82
83cd ~
84
85curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash
86export NVM_DIR="$HOME/.nvm"
87[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
88
89VERSION=${1:-12}
90
91nvm install $VERSION
92
93PLATFORM=$(uname -m)
94if [[ "$PLATFORM" != "armv"* ]]; then
95
96 #make Node.js available to sudo
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
103fi
104
105