1 | #!/usr/bin/env bash
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 | ydbversion="r1.28"
|
8 | ydbver="r128"
|
9 | platform="_armv7l"
|
10 |
|
11 | echo "Installing YottaDB $ydbversion"
|
12 |
|
13 |
|
14 |
|
15 | mkdir -p /tmp/tmp
|
16 | cd /tmp/tmp
|
17 | wget https://gitlab.com/YottaDB/DB/YDB/raw/master/sr_unix/ydbinstall.sh
|
18 | chmod +x ydbinstall.sh
|
19 |
|
20 | gtmroot=/usr/lib/yottadb
|
21 | gtmcurrent=$gtmroot/current
|
22 |
|
23 |
|
24 | mkdir -p $gtmcurrent
|
25 | ./ydbinstall.sh --utf8 default --verbose --linkenv $gtmcurrent --linkexec $gtmcurrent --force-install $ydbversion
|
26 | echo "Configuring YottaDB $ydbversion"
|
27 |
|
28 | gtmprof=$gtmcurrent/gtmprofile
|
29 | gtmprofcmd="source $gtmprof"
|
30 | $gtmprofcmd
|
31 | tmpfile=`mktemp`
|
32 |
|
33 | echo 'copying ' $gtmprofcmd ' to profile...'
|
34 | echo $gtmprofcmd >> ~/.profile
|
35 |
|
36 | rm $tmpfile
|
37 | unset tmpfile gtmprofcmd gtmprof gtmcurrent gtmroot
|
38 |
|
39 | cd /opt/qewd
|
40 | mkdir sessiondb
|
41 |
|
42 | echo '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 |
|
50 | svn export https://github.com/chrisemunt/mgsql/trunk/yottadb /opt/qewd/mgsql
|
51 | cp /opt/qewd/mgsql/* /root/.yottadb/$ydbversion$platform/r
|
52 | /usr/local/lib/yottadb/$ydbver/mumps -run ylink^%mgsql
|
53 | rm -r /opt/qewd/mgsql
|
54 |
|
55 | echo 'mgsql has been installed'
|
56 | echo ' '
|
57 |
|
58 |
|
59 |
|
60 | svn export https://github.com/chrisemunt/mg-dbx/trunk/yottadb /opt/qewd/mgsi
|
61 | cp /opt/qewd/mgsi/* /root/.yottadb/$ydbversion$platform/r
|
62 | /usr/local/lib/yottadb/$ydbver/mumps -run ylink^%zmgsi
|
63 | rm -r /opt/qewd/mgsi
|
64 |
|
65 | cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewd.ci /usr/local/lib/yottadb/$ydbver
|
66 | cp /opt/qewd/node_modules/qewd-mg-dbx/ci/qewdInterface.m /root/.yottadb/$ydbversion$platform/r
|
67 |
|
68 | echo 'zmgsi has been installed'
|
69 | echo ' '
|
70 |
|
71 |
|
72 |
|
73 | cp /opt/qewd/node_modules/qewd-mg-dbx/xinetd/zmgsi_ydb /usr/local/lib/yottadb/$ydbver
|
74 | cp /opt/qewd/node_modules/qewd-mg-dbx/xinetd/zmgsi_xinetd /etc/xinetd.d/zmgsi_xinetd
|
75 |
|
76 | echo "zmgsi_xinetd 7041/tcp # zmgsi" >> /etc/services
|
77 |
|
78 | echo 'Optional xinetd interface for mg-dbx has been installed'
|
79 | echo ' '
|
80 |
|
81 | echo 'YottaDB has been installed and configured, ready for use'
|
82 |
|
83 | cd /opt/qewd
|
84 |
|
85 |
|
86 |
|
87 | echo 'Installing NodeM'
|
88 |
|
89 | npm install nodem
|
90 |
|
91 | ln -sf $gtm_dist/libgtmshr.so /usr/local/lib/
|
92 | ldconfig
|
93 |
|
94 | base=/opt/qewd
|
95 | [ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"
|
96 | export ydb_ci="$(find $base -iname nodem.ci)"
|
97 | nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"
|
98 | echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"
|
99 |
|
100 |
|
101 | echo 'base=/opt/qewd' >> ~/.profile
|
102 | echo '[ -f "$GTMCI" ] || export GTMCI="$(find $base -iname nodem.ci)"' >> ~/.profile
|
103 | echo 'export ydb_ci="$(find $base -iname nodem.ci)"' >> ~/.profile
|
104 | echo 'nodemgtmr="$(find $base -iname v4wnode.m | tail -n1 | xargs dirname)"' >> ~/.profile
|
105 | echo 'echo "$gtmroutines" | fgrep "$nodemgtmr" || export gtmroutines="$nodemgtmr $gtmroutines"' >> ~/.profile
|