-
Notifications
You must be signed in to change notification settings - Fork 11
/
install.sh
executable file
·55 lines (51 loc) · 1.95 KB
/
install.sh
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
#!/bin/sh
CORE_INSTALL="\n## INSTALLING PHILOLOGIC C CORE ##"
echo "$CORE_INSTALL"
cd libphilo/
make clean
make
if [[ $OSTYPE == 'darwin'* ]];
then
sudo /usr/bin/install -c db/corpus_search /usr/local/bin/
sudo /usr/bin/install -c db/pack4 /usr/local/bin/
else
sudo /usr/bin/install -c db/corpus_search /bin/
sudo /usr/bin/install -c db/pack4 /bin/
fi
cd ..;
PYTHON_INSTALL="\n## INSTALLING PYTHON LIBRARY ##"
echo "$PYTHON_INSTALL"
sudo pip3 install build
cd python;
rm -rf dist/
python3 -m build --sdist
sudo -H pip3 install dist/*gz
sudo mkdir -p /etc/philologic/
cd ..;
sudo mkdir -p /var/lib/philologic4/web_app/
sudo rm -rf /var/lib/philologic4/web_app/*
if [ -d www/app/node_modules ]
then
sudo rm -rf www/app/node_modules
fi
sudo cp -R www/* /var/lib/philologic4/web_app/
sudo cp www/.htaccess /var/lib/philologic4/web_app/
if [ ! -f /etc/philologic/philologic4.cfg ]
then
db_url="# Set the filesytem path to the root web directory for your PhiloLogic install.
database_root = None
# /var/www/html/philologic/ is conventional for linux,
# /Library/WebServer/Documents/philologic for Mac OS.\n"
echo "$db_url" | sed "s/^ *//g" | sudo tee /etc/philologic/philologic4.cfg > /dev/null
url_root="# Set the URL path to the same root directory for your philologic install.
url_root = None
# http://localhost/philologic/ is appropriate if you don't have a DNS hostname.\n"
echo "$url_root" | sed "s/^ *//g" | sudo tee -a /etc/philologic/philologic4.cfg > /dev/null
web_app_dir="## This should be set to the location of the PhiloLogic4 www directory
web_app_dir = '/var/lib/philologic4/web_app/'"
echo "$web_app_dir" | sed "s/^ *//g" | sudo tee -a /etc/philologic/philologic4.cfg > /dev/null
else
echo "\n## WARNING ##"
echo "/etc/philologic/philologic4.cfg already exists"
echo "Please delete and rerun the install script to avoid incompatibilities\n"
fi