UNPKG

2.4 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
16
17# YottaDB
18
19echo 'Installing YottaDB'
20
21echo "Installing YottaDB $ydbversion"
22
23# Create a temporary directory for the installer
24mkdir -p /tmp/tmp
25cd /tmp/tmp
26wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
27chmod +x ydbinstall.sh
28
29gtmroot=/usr/lib/yottadb
30gtmcurrent=$gtmroot/current
31
32# make sure directory exists for links to current YottaDB
33sudo mkdir -p $gtmcurrent
34sudo ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
35echo "Configuring YottaDB $ydbversion"
36
37gtmprof=$gtmcurrent/gtmprofile
38gtmprofcmd="source $gtmprof"
39$gtmprofcmd
40tmpfile=`mktemp`
41
42echo 'copying ' $gtmprofcmd ' to profile...'
43echo $gtmprofcmd >> ~/.profile
44
45rm $tmpfile
46unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
47
48mkdir ~/.yottadb/sessiondb
49
50cat >~/.yottadb/sessiondb/gde.txt <<EOL
51add -name qs -region=qewdreg
52add -region qewdreg -dynamic=qewdseg
53add -segment qewdseg -file=$HOME/.yottadb/sessiondb/qewd.dat
54exit
55EOL
56
57echo 'Setting up local internal, unjournalled region for QEWD Session global'
58/usr/local/lib/yottadb/$ydbver/mumps -run ^GDE < $HOME/.yottadb/sessiondb/gde.txt
59/usr/local/lib/yottadb/$ydbver/mupip create -region=qewdreg
60/usr/local/lib/yottadb/$ydbver/mupip set -file -nojournal $HOME/.yottadb/sessiondb/qewd.dat
61
62echo 'YottaDB has been installed and configured, ready for use'
63
64# Node.js
65
66echo 'Installing Node.js'
67
68cd ~
69
70curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.2/install.sh | bash
71export NVM_DIR="$HOME/.nvm"
72[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
73
74VERSION=${1:-12}
75
76nvm install $VERSION
77
78PLATFORM=$(uname -m)
79if [[ "$PLATFORM" != "armv"* ]]; then
80
81 #make Node.js available to sudo
82
83 sudo ln -s /usr/local/bin/node /usr/bin/node
84 sudo ln -s /usr/local/lib/node /usr/lib/node
85 sudo ln -s /usr/local/bin/npm /usr/bin/npm
86 sudo ln -s /usr/local/bin/node-waf /usr/bin/node-waf
87 n=$(which node);n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
88fi
89
90