UNPKG

2.72 kBapplication/x-shView Raw
1#!/bin/bash
2
3# 25 November 2019
4
5# YottaDB
6
7ydbversion="r1.28"
8ydbver="r128"
9platform="_armv7l"
10
11echo "Installing YottaDB $ydbversion"
12
13
14# Create a temporary directory for the installer
15mkdir -p /tmp/tmp
16cd /tmp/tmp
17wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
18chmod +x ydbinstall.sh
19
20gtmroot=/usr/lib/yottadb
21gtmcurrent=$gtmroot/current
22
23# make sure directory exists for links to current YottaDB
24mkdir -p $gtmcurrent
25./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
26echo "Configuring YottaDB $ydbversion"
27
28gtmprof=$gtmcurrent/gtmprofile
29gtmprofcmd="source $gtmprof"
30$gtmprofcmd
31tmpfile=`mktemp`
32
33echo 'copying ' $gtmprofcmd ' to profile...'
34echo $gtmprofcmd >> ~/.profile
35
36rm $tmpfile
37unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
38
39cd /opt/qewd
40mkdir sessiondb
41
42echo 'Setting up local internal, unjournalled region for QEWD Session global'
43/usr/local/lib/yottadb/$ydbver/mumps -run ^GDE < /opt/qewd/gde.txt
44/usr/local/lib/yottadb/$ydbver/mupip create -region=qewdreg
45/usr/local/lib/yottadb/$ydbver/mupip set -file -nojournal /opt/qewd/sessiondb/qewd.dat
46/usr/local/lib/yottadb/$ydbver/mupip set -key_size=1019 -region qewdreg
47
48
49# Install and configure mgsql routines and QEWD's interface to them
50
51svn export https://github.com/chrisemunt/mgsql/trunk/yottadb /opt/qewd/mgsql
52cp /opt/qewd/mgsql/* /root/.yottadb/$ydbversion$platform/r
53/usr/local/lib/yottadb/$ydbver/mumps -run ylink^%mgsql
54rm -r /opt/qewd/mgsql
55
56cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewd.ci /usr/local/lib/yottadb/$ydbver
57cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewdInterface.m /root/.yottadb/$ydbversion$platform/r
58
59echo 'mgsql has been installed'
60echo ' '
61
62echo 'YottaDB has been installed and configured, ready for use'
63
64cd /opt/qewd
65
66# NodeM
67
68echo 'Installing NodeM'
69
70npm install nodem
71
72ln -sf $gtm_dist/libgtmshr.so /usr/local/lib/
73ldconfig
74#base=~/qewd
75base=/opt/qewd
76[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"
77export ydb_ci="$(find $base -iname nodem.ci)"
78nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"
79echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"
80
81#echo 'base=~/qewd' >> ~/.profile
82echo 'base=/opt/qewd' >> ~/.profile
83echo '[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"' >> ~/.profile
84echo 'export ydb_ci="$(find $base -iname nodem.ci)"' >> ~/.profile
85echo 'nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"' >> ~/.profile
86echo 'echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"' >> ~/.profile