forked from synopsx/synopsx
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·64 lines (53 loc) · 2.17 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
56
57
58
59
60
61
62
63
64
basexInstallationDirectory=/opt/basex/
synopsxBaseDirectory=~/synopsx/
#basexInstallationDirectory=~/temp/synopsxInstallTest/
#synopsxBaseDirectory=~/temp/synopsx/
tempDir=$synopsxBaseDirectory"temp/"
baseXFileUrl=http://files.basex.org/releases/8.3/BaseX83.zip
saxonUrl=http://downloads.sourceforge.net/project/saxon/Saxon-HE/9.6/SaxonHE9-6-0-7J.zip
synopsxBranch=master
synopsxUrl=https://github.com/synopsx/synopsx/archive/$synopsxBranch".zip"
dbaUrl=https://github.com/ahn-ens-lyon/dba/archive/master.zip
user=`who am i | awk '{print $1}'`
mkdir -p $tempDir
cd $tempDir
echo "Installing BaseX from "$baseXFileUrl" in "$basexInstallationDirectory
wget $baseXFileUrl
unzip BaseX83.zip
rm BaseX83.zip
mv $basexInstallationDirectory $basexInstallationDirectory.old
mv basex $basexInstallationDirectory
echo "BaseX installed"
echo "Installing Saxon from "$saxonUrl" in "$basexInstallationDirectory"lib"
mkdir -p $tempDir"/saxon"
cd $tempDir"/saxon"
wget $saxonUrl
unzip SaxonHE9-6-0-7J.zip
rm SaxonHE9-6-0-7J.zip
mv *.jar $basexInstallationDirectory"lib"
echo "Saxon installed"
echo "Installing SynopsX from"$synopsxUrl" in "$synopsxBaseDirectory"synopsx"
wget "$synopsxUrl"
unzip $synopsxBranch".zip"
rm $synopsxBranch".zip"
mv $synopsxBaseDirectory"synopsx/" $synopsxBaseDirectory"synopsx.old/"
mv synopsx-$synopsxBranch $synopsxBaseDirectory"synopsx"
ln -s $synopsxBaseDirectory"synopsx" $basexInstallationDirectory"webapp"
rm $basexInstallationDirectory"webapp/restxq.xqm"
echo "Installing dba from"$dba" in "$synopsxBaseDirectory"/dba"
wget "$dbaUrl"
unzip master.zip
rm master.zip
rm -fr $synopsxBaseDirectory"dba"
mv dba-master $synopsxBaseDirectory"dba"
rm -fr $basexInstallationDirectory"webapp/dba"
ln -s $synopsxBaseDirectory"dba" $basexInstallationDirectory"webapp"
mkdir $synopsxBaseDirectory"data"
mv $basexInstallationDirectory"data" $basexInstallationDirectory"data.old"
ln -s $synopsxBaseDirectory"data" $basexInstallationDirectory"data"
rm -fr $tempDir
chown -R $user $basexInstallationDirectory
chmod -R u+w $basexInstallationDirectory
chown -R $user $synopsxBaseDirectory
chmod -R u+w $synopsxBaseDirectory
echo "You can run BaseX and SynopsX with: "$basexInstallationDirectory"bin/basexhttp"