UNPKG

3.45 kBapplication/x-shView Raw
1#!/usr/bin/env bash
2
3# 15 June 2020
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# Install and configure mgsql routines and QEWD's interface to them
49
50svn export https://github.com/chrisemunt/mgsql/trunk/yottadb /opt/qewd/mgsql
51cp /opt/qewd/mgsql/* /root/.yottadb/$ydbversion$platform/r
52/usr/local/lib/yottadb/$ydbver/mumps -run ylink^%mgsql
53rm -r /opt/qewd/mgsql
54
55echo 'mgsql has been installed'
56echo ' '
57
58# Install and configure the M interface routines for mg-dbx
59
60svn export https://github.com/chrisemunt/mg-dbx/trunk/yottadb /opt/qewd/mgsi
61cp /opt/qewd/mgsi/* /root/.yottadb/$ydbversion$platform/r
62/usr/local/lib/yottadb/$ydbver/mumps -run ylink^%zmgsi
63rm -r /opt/qewd/mgsi
64
65cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewd.ci /usr/local/lib/yottadb/$ydbver
66cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewdInterface.m /root/.yottadb/$ydbversion$platform/r
67
68echo 'zmgsi has been installed'
69echo ' '
70
71# Set up optional xinetd network interface for mg-dbx
72
73cp /opt/qewd/node_modules/qewd-mg-dbx/xinetd/zmgsi_ydb /usr/local/lib/yottadb/$ydbver
74cp /opt/qewd/node_modules/qewd-mg-dbx/xinetd/zmgsi_xinetd /etc/xinetd.d/zmgsi_xinetd
75
76echo "zmgsi_xinetd 7041/tcp # zmgsi" >> /etc/services
77
78echo 'Optional xinetd interface for mg-dbx has been installed'
79echo ' '
80
81echo 'YottaDB has been installed and configured, ready for use'
82
83cd /opt/qewd
84
85# NodeM
86
87echo 'Installing NodeM'
88
89npm install nodem
90
91ln -sf $gtm_dist/libgtmshr.so /usr/local/lib/
92ldconfig
93#base=~/qewd
94base=/opt/qewd
95[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"
96export ydb_ci="$(find $base -iname nodem.ci)"
97nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"
98echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"
99
100#echo 'base=~/qewd' >> ~/.profile
101echo 'base=/opt/qewd' >> ~/.profile
102echo '[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"' >> ~/.profile
103echo 'export ydb_ci="$(find $base -iname nodem.ci)"' >> ~/.profile
104echo 'nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"' >> ~/.profile
105echo 'echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"' >> ~/.profile