-
Notifications
You must be signed in to change notification settings - Fork 0
/
Install
executable file
·76 lines (57 loc) · 1.41 KB
/
Install
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
#!/bin/sh
# variable definitions (edit as needed)
CONFIGURATION=Configuration
# ensure that the config file exists
if test ! -r $CONFIGURATION
then
echo "Missing configuration file. Please create $CONFIGURATION."
exit 1
fi
# read variables from the config file
exec 4<&0
exec < $CONFIGURATION
while read name value junk
do
case "$name" in
GROUP)
GROUP=$value;;
DBDIR)
DBDIR=$value;;
MAPFILE)
MAPFILE=$value;;
MAPFILE_ALL)
MAPFILE_ALL=$value;;
MAPFILE_DEV)
MAPFILE_DEV=$value;;
[A-z]*)
;; # other parms are not needed by Install
esac
done
exec 0<&4
# remove the python link before chmod, if there already
if [ -h python ]; then
rm python
fi
# protect files from world write access
chmod o-rwx *
chmod o+rx *
# set up the mapping file sym link, assuming that this is during curation
# hours when all databases should be active
if [ -h $MAPFILE ]; then
rm $MAPFILE
fi
ln -s $MAPFILE_ALL $MAPFILE
# make Python link
echo "Linking to python"
ln -s $PYTHON python
echo $DBDIR > library.path
chmod 664 library.path
chgrp $GROUP library.path
# compile python libraries and make sure they're readable
echo "Compiling libraries"
$PYTHON -c 'import compileall; compileall.compile_dir(".")'
# set permissions for group to read & execute
echo "Setting permissions"
chgrp $GROUP *cgi $MAPFILE_ALL $MAPFILE_DEV $CONFIGURATION
chmod 755 setMapfile *cgi $MAPFILE_ALL $MAPFILE_DEV *py
echo "Done"