-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.md
executable file
·208 lines (159 loc) · 6.47 KB
/
INSTALL.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
#!/bin/bash -x
function MAINTAINER {
echo SKIPPING: $*
}
function RUN {
echo RUNing: $*
$*
}
# set +e
if [[ $EUID -ne 0 ]]; then
echo "#* "
echo -e "\e[1;31mWARNING: This script ${BASH_SOURCE[0]} should be run as root. \e[0m"
echo "#* "
return 0 2>/dev/null ; exit 0
fi
mkdir -p /usr/share/man/man1
DIR0="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
(
cd $DIR0
export LOGICMOO_WS=$DIR0
./logicmoo_env.sh
#git submodule init
#git submodule update
#git submodule sync --recursive
#git config --global http.sslVerify false
#git status -v --show-stash
#git pull -f && git pull -f --recurse-submodules
if [ -f "/.dockerenv" ]; then
DIR="$LOGICMOO_WS/lib/deps_installed"
if [ -d "$DIR" ]; then
echo "#* "
echo "#* GOOD: Logicmoo Deps are hopefully installed"
echo "#* (if there was a problem with them rm -rf ${DIR} and restart this script)"
echo "#* "
else
(source ./INSTALL-DEPS.md )
fi
fi
stty sane
cd $DIR0
# who/where
export LOGICMOO_USER=prologmud_server
export LOGICMOO_WS=$DIR0
export LOGICMOO_GAMES=$LOGICMOO_WS/prologmud_server
. $DIR0/logicmoo_env.sh
(
cd $DIR0
echo whoami=`whoami`
echo PATH=$PATH
echo LOGICMOO_GAMES=$LOGICMOO_GAMES
echo LOGICMOO_WS=$LOGICMOO_WS
if [ -f "/.dockerenv" ]; then
echo "127.0.0.1 eggdrop" >> /etc/hosts
#echo "10.0.0.194 logicmoo.org" >> /etc/hosts
if [ ! -z "$LOGICMOO_EXTRAS" ];
then
curl -O http://mirror.umd.edu/eclipse/technology/epp/downloads/release/2020-06/R/eclipse-java-2020-06-R-linux-gtk-x86_64.tar.gz \
&& tar -zxvf eclipse-java-2020-06-R-linux-gtk-x86_64.tar.gz -C /usr/ \
&& ln -s /usr/eclipse/eclipse /usr/bin/eclipse \
&& rm -f eclipse-java-2020-06-R-linux-gtk-x86_64.tar.gz
fi
fi
#apt-add-repository -y ppa:swi-prolog/devel && apt-get install -y swi-prolog elpa-ediprolog swi-prolog-java swi-prolog-odbc swi-prolog-bdb
# check out our repo
if [[ ! -d /opt/logicmoo_workspace ]]; then
mkdir -p /opt
cd /opt
git config --global http.sslVerify false \
echo "git clone --recurse-submodules https://github.com/logicmoo/logicmoo_workspace"
git clone --recurse-submodules https://github.com/logicmoo/logicmoo_workspace
cd /opt/logicmoo_workspace
else
cd /opt/logicmoo_workspace
echo "git pull"
git pull
fi
git config --local http.sslVerify false
# git config --global http.sslVerify false
# find -name "*.lock" -delete
git config credential.helper 'cache --timeout=300000'
git update-index --assume-unchanged prologmud_server/.bash_history
git update-index --assume-unchanged packs_sys/eggdrop/conf/PrologMUD-freenode.chan
git update-index --assume-unchanged packs_sys/eggdrop/conf/PrologMUD-freenode.user
git remote add --track master github https://github.com/logicmoo/logicmoo_workspace.git 2>/dev/null ; /bin/true
git remote add --track master gitlab https://logicmoo.org/gitlab/logicmoo/logicmoo_workspace.git 2>/dev/null ; /bin/true
echo "git submodule update --init"
git submodule update --init
#git submodule foreach --recursive bash -c "git fetch --unshallow ; /bin/true"
#git submodule foreach --recursive bash -c "git lfs pull ; /bin/true"
git pull --recurse-submodules
if [ -f "/.dockerenv" ]; then
rm -rf /usr/local/lib/python3.8/dist-packages/butterfly/templates
rm -rf /usr/local/lib/python3.8/dist-packages/butterfly/static
ln -s /opt/logicmoo_workspace/packs_web/butterfly/butterfly/static/ /usr/local/lib/python3.8/dist-packages/butterfly/static
ln -s /opt/logicmoo_workspace/packs_web/butterfly/butterfly/templates/ /usr/local/lib/python3.8/dist-packages/butterfly/templates
#\cp /opt/logicmoo_workspace/packs_web/butterfly/butterfly/static/* /usr/local/lib/python3.8/dist-packages/butterfly/static/
#\cp /opt/logicmoo_workspace/packs_web/butterfly/butterfly/templates/* /usr/local/lib/python3.8/dist-packages/butterfly/templates/
mkdir -p /opt/ros/eloquent/
touch /opt/ros/eloquent/setup.bash
# make our process running user
adduser --disabled-password --gecos "" --no-create-home $LOGICMOO_USER --home $LOGICMOO_GAMES
chown -R $LOGICMOO_USER $LOGICMOO_GAMES
# apache config
#cp -a -n -v $LOGICMOO_WS/packs_web/logicmoo_webui/etc/* /etc \
# ; cp -a -n -v $LOGICMOO_WS/packs_web/logicmoo_webui/var/* /var \
# ; cp -a -n -v $LOGICMOO_WS/etc/* /etc
# install swi-prolog
# DIR="$LOGICMOO_WS/swipl-devel"
DIR="$LOGICMOO_WS/lib/swipl"
if [ -d "$DIR" ]; then
echo "#* "
echo "#* GOOD: SWI-Prolog is hopefully installed"
echo "#* (if there was a problem with them rm -rf ${DIR} and restart this script)"
echo "#* "
else
(cd $LOGICMOO_WS && ./INSTALL-SWI.md)
fi
RUN echo "copying config RC's into /root/"
# set up our runtime stuff (give root better shell stuff and our likely history commands)
MAINTAINER cp -n $LOGICMOO_GAMES/.??*rc ~root/ \
; cp -n $LOGICMOO_GAMES/.bash* ~root/ \
; cp -n $LOGICMOO_GAMES/.profile* ~root/ \
echo "Chowning and Chmoding..."
cd $LOGICMOO_WS \
&& touch $LOGICMOO_GAMES/tempDir/history_4000 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4000 \
&& touch $LOGICMOO_GAMES/tempDir/history_4001 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4001 \
&& touch $LOGICMOO_GAMES/tempDir/history_4002 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4002 \
&& touch $LOGICMOO_GAMES/tempDir/history_4003 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4003 \
&& touch $LOGICMOO_GAMES/tempDir/history_4004 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4004 \
&& touch $LOGICMOO_GAMES/tempDir/history_4023 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4023 \
&& touch $LOGICMOO_GAMES/tempDir/history_4025 \
&& touch $LOGICMOO_GAMES/tempDir/completion_4025 \
&& touch $LOGICMOO_GAMES/nohup.out \
&& chmod 777 $LOGICMOO_GAMES/tempDir/completion_* \
&& chmod 777 $LOGICMOO_GAMES/tempDir/history_* \
&& chmod 777 $LOGICMOO_GAMES/nohup* \
&& chown $LOGICMOO_USER $LOGICMOO_GAMES/?*0* \
&& chmod 777 /opt/logicmoo_workspace/packs_sys/*/ \
&& chmod 777 /opt/logicmoo_workspace/packs_sys/*/*/ \
&& chmod 777 /opt/logicmoo_workspace/packs_sys/*/*/*/ \
&& echo Maybe chown -R $LOGICMOO_USER $LOGICMOO_WS/packs_sys/logicmoo_nlu/ext/pldata/ \
&& chown -R $LOGICMOO_USER $LOGICMOO_WS/packs_sys/eggdrop/ \
&& echo Maybe chown -R $LOGICMOO_USER $LOGICMOO_WS/packs_sys/logicmoo_nlu/ext/pldata/plkb0988/ \
&& echo Maybe chown -R $LOGICMOO_USER $LOGICMOO_WS/packs_sys/logicmoo_nlu/ext/pldata/plkb0988/src~/ \
&& echo Maybe chown -R $LOGICMOO_USER $LOGICMOO_WS/packs_web/butterfly
#git update-index --assume-unchanged $LOGICMOO_WS/packs_sys/eggdrop/conf/P*
#echo "${BASH_SOURCE[0]} Assesing GIT STATUS..."
#git status -s
fi
)
find -name "*.qlf" -exec touch '{}' +
)
echo "${BASH_SOURCE[0]} Completed."