-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInstall
executable file
·209 lines (178 loc) · 4.79 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
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
208
#!/bin/sh
# remember the top-level directory
TOP=`pwd`
# variable definitions (edit as needed)
CONFIGURATION=Configuration
PYTHON_REL=$TOP/bin/python
# includeLinker function - create a ../include symbolic link in the current
# directory and in each subdirectory (and now a ../stylesheet symbolic link
# as well, for MGI 3.1)
includeLinker() {
# do this directory
if [ -h include ]; then
rm include
fi
if [ -h stylesheet ]; then
rm stylesheet
fi
if [ ! -d include ]; then
echo "Linking to include/ in `pwd`"
ln -s ../include include
fi
if [ ! -d stylesheet ]; then
echo "Linking to stylesheet/ in `pwd`"
ln -s ../stylesheet stylesheet
fi
# then do all subdirectories recursively
for name in `ls`
do
if [ -d $name ]; then
if [ $name != include ]; then
if [ $name != stylesheet ]; then
if [ $name != CVS ]; then
cd $name
(includeLinker)
cd ..
fi
fi
fi
fi
done
}
# 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
/usr/local/mgi/live/lib/python/Configuration.py $CONFIGURATION tab > .Configuration.tab
exec < .Configuration.tab
while read name value junk
do
case "$name" in
LD_LIBRARY_PATH)
LD_LIBRARY_PATH=$value;;
LIBDIRS)
LIBDIRS=$value;;
MGIHOME_PATH)
MGIHOME_PATH=$value;;
MGIHOME_URL)
MGIHOME_URL=$value;;
PYTHON)
PYTHON=$value;;
GROUP)
GROUP=$value;;
WI_PATH)
WI_PATH=$value;;
WEBSHARE_URL)
WEBSHARE_URL=$value;;
[A-z]*)
;; # other parms are not needed by Install
esac
done
exec 0<&4
# make bin directory and refresh the Python link
if [ ! -d bin ]; then
echo "Making 'bin' directory in `pwd`"
mkdir bin
fi
if [ -h bin/python ]; then
rm bin/python
fi
cd bin
echo "Linking from `pwd` to $PYTHON"
ln -s $PYTHON python
cd $TOP
cd www
if [ -h Configuration ]; then
echo "Making "Configuration" sym link in `pwd`"
rm Configuration
fi
ln -s ../Configuration Configuration
cd $TOP
# compile python libraries and make sure they're readable
cd lib/python
echo "Checking that python libraries in `pwd` compile"
for pyc in `ls *py`
do
if [ -h ${pyc}c ]; then
rm ${pyc}c
fi
done
$PYTHON -m compileall -l -f .
chgrp www *py
chmod 755 *py
cd $TOP
# add links to python and the config file from selected directories
for dir in www/nomen www/lists www/support www/submissions admin www/feedback www/other
do
cd $dir
if [ -h python ]; then
rm python
fi
ln -s $PYTHON_REL python
cd $TOP
done
# support new-style link to homology.shtml minihome page, by temporarily
# linking to old orthology.shtml version
cd www/homepages/
if [ -h homology.shtml ]; then
rm homology.shtml
fi
ln -s orthology.shtml homology.shtml
cd $TOP
# make the www/include directory and generate any include files
cd www
if [ ! -d include ]; then
echo "Making 'include' directory in `pwd`"
mkdir include
fi
cd $TOP/admin
curl "${WEBSHARE_URL}components.cgi?format=rcd" > ${TOP}/webshare.rcd
gen_includes
cd $TOP
# link to the stylesheet downloaded by the WI for its userdocs
# (temporarily disabled until needed)
# cd $TOP/www/stylesheet
# if [ -h mgihome.css ]; then
# rm mgihome.css
# fi
# if [ -r mgihome.css ]; then
# mv mgihome.css mgihome.css.old
# fi
# ln -s ${WI_PATH}www/userdocs/stylesheet/mgi.css mgihome.css
# cd $TOP
# make sure the www directory is executable by the right group;
# use 'find' to avoid doing a recursive chmod and chgrp, which
# also follow the symbolic links to the python interpreter...
echo "setting permissions in www/ directory..."
find www -type f -print | xargs chmod 755
find www -type f -print | xargs chgrp www
find www -type d -print | xargs chmod 755
find www -type d -print | xargs chgrp www
# add links to the include file directory and the stylesheet directory
# for each directory under www
cd www
includeLinker
cd $TOP
#
# Warranty Disclaimer and Copyright Notice
#
# THE JACKSON LABORATORY MAKES NO REPRESENTATION ABOUT THE SUITABILITY OR
# ACCURACY OF THIS SOFTWARE OR DATA FOR ANY PURPOSE, AND MAKES NO WARRANTIES,
# EITHER EXPRESS OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE OR THAT THE USE OF THIS SOFTWARE OR DATA WILL NOT
# INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS, OR OTHER RIGHTS.
# THE SOFTWARE AND DATA ARE PROVIDED "AS IS".
#
# This software and data are provided to enhance knowledge and encourage
# progress in the scientific community and are to be used only for research
# and educational purposes. Any reproduction or use for commercial purpose
# is prohibited without the prior express written permission of the Jackson
# Laboratory.
#
# Copyright (c) 1996, 1999, 2002 by The Jackson Laboratory
# All Rights Reserved
#