Debian Codegraph @

wtools/INSTALL.database

raw
1 #!/bin/csh
2 # INSTALL for 4_3 July 1996
3 # $Id: INSTALL,v 1.20 1999/09/14 15:15:34 rd Exp $
4 ##########################################################################
5 ################# A C.elegans database ###########################
6 ################# R.Durbin and J.Thierry-Mieg #########################
7 ################# #########################
8 ################# Installation script, june 91 #########################
9 ##########################################################################
10 #
11 # To install ACeDB, this file and the appropriate distribution tar.Z files
12 # should be in the same directory. See the NOTES file to find out which
13 # distribution tar.Z files you need for your site. You must have write
14 # access in the directory to be able to run the INSTALL script.
15 #
16 # We can provide executables for most X11-Unix platforms, like SUN
17 # DEC stations, Next, Alliant, Silicon Graphics, IBM
18 # and for PC-compatibles running the freeware Unix-OS called LINUX
19 #
20 # Go to the directory and, omitting the leading #, type the command
21 # source INSTALL
22 #
23 ###################################################################
24
25 echo ' '
26 echo ' ACEDB installation script'
27 echo ' '
28
29 if ($USER == "root") then
30 echo ' You should not be root when installing ACEDB'
31 echo ' su to some other user name and try again'
32 exit
33 endif
34
35 echo -n " $USER"
36 echo ' will be known as the acedb-administrator'
37 echo ' '
38
39 echo ' We are going to install the acedb system in the present directory: '
40 echo -n " "
41 pwd
42 echo ' This is your available disk space in this directory: '
43 df -k .
44 echo " The amount of space you need will depend on what data you are installing."
45 echo " For the source code and binary, you need around 15 Mb."
46 echo -n " Should we proceed? Please answer yes/no : "
47
48 switch("$<")
49 case "yes":
50 case "y":
51 breaksw
52 default:
53 echo ' You did not answer yes, I quit'
54 exit
55 breaksw
56 endsw
57
58 echo ' '
59 echo ' Starting the installation'
60
61 if (-e wspec/passwd.wrm ) then
62 echo ' I save the old wspec/passwd.wrm file as wspec/passwd.old'
63 \mv wspec/passwd.wrm wspec/passwd.old
64 echo ' '
65 endif
66
67 # next items fix problems in the tar.Z files
68 if (-d wdoc/code) then
69 chmod 755 wdoc/code
70 endif
71 if (-d wmake/others) then
72 chmod 755 wmake/others
73 endif
74
75 if (-d wspec) then # save active database wspec
76 if (-d wspec.save) then
77 \rm -r wspec.save
78 endif
79 mv wspec wspec.save
80 endif
81
82 foreach i ( 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0b4 0 )
83 foreach a ( m l k j i h g f e d c b a '')
84 if (-e source.4_$i$a.tar.Z) then
85 echo -n ' Restoring files from '
86 echo source.4_$i$a.tar.Z
87 zcat source.4_$i$a.tar.Z | tar xf -
88 goto ok1;
89 endif
90 end
91 end
92
93 ok1:
94
95 chmod u+w w*/* # in case w* comes from CVS without write access
96
97 if (-d wspec) then # put wspec from source distribution into wspec.source
98 if (-d wspec.source) then
99 \rm -r wspec.source
100 endif
101 mv wspec wspec.source
102 endif
103
104 foreach i ( 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 )
105 if (-e doc.4_$i.tar.Z) then
106 echo -n ' Restoring files from '
107 echo doc.4_$i.tar.Z
108 zcat doc.4_$i.tar.Z | tar xf -
109 break
110 endif
111 end
112
113 chmod u+w w*/* # in case w* comes from CVS without write access
114
115 setenv ace_version 4
116 foreach i ( 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0b4 0 )
117 foreach a ( z y x w v u t s r q p o n m l k j i h g f e d c b a '')
118 foreach ff (`ls bin.*.4_$i$a.tar.Z |& grep -v match`)
119 if (-e $ff) then # use * to name all versions
120 echo " Restoring files from $ff "
121 if (-e bin) \rm -r bin
122 zcat $ff | tar xf -
123 setenv ace_version 4_$i$a
124 goto ok2
125 endif
126 end
127 end
128 end
129
130 ok2:
131
132 chmod u+w w*/* # in case w* comes from CVS without write access
133
134 if (-d wspec) then # put wspec from bin distribution into wspec.bin
135 if (-d wspec.bin) then
136 \rm -r wspec.bin
137 endif
138 mv wspec wspec.bin
139 endif
140
141 if (-d wspec.save) then # restore active database wspec
142 mv wspec.save wspec
143 endif
144
145 foreach i ( 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 \
146 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 )
147 if (-e update.4-$i.tar.Z && ! -e rawdata/update.4-$i) then
148 echo -n ' Restoring files from '
149 echo update.4-$i.tar.Z
150 ( zcat update.4-$i.tar.Z | tar xf - ) && \rm update.4-$i.tar.Z
151 endif
152 foreach a (WS12 WS11 WS10 WS9 WS8 WS7 WG6 WS6 WG5 WS5 WG4 WS4 WG3 WS3 )
153 if (-e database.$a.4-$i.tar.Z && ! -e rawdata/update.$a.4-$i) then
154 echo -n ' Restoring files from '
155 echo database.$a.4-$i.tar.Z
156 ( zcat database.$a.4-$i.tar.Z | tar xf - ) && \rm database.$a.4-$i.tar.Z
157 goto ok3
158 endif
159 if (-e update.$a.4-$i.tar.Z && ! -e rawdata/update.$a.4-$i) then
160 echo -n ' Restoring files from '
161 echo update.$a.4-$i.tar.Z
162 ( zcat update.$a.4-$i.tar.Z | tar xf - ) && \rm update.$a.4-$i.tar.Z
163 endif
164 end
165 ok3:
166 end
167
168 chmod u+w w*/* # in case w* comes from CVS without write access
169
170 echo ' '
171 echo -n ' All files have been restored. Hit return to proceed'
172 switch("$<")
173 default:
174 breaksw
175 endsw
176
177 ### extra files, directories etc.
178
179 if (! -d database) mkdir database
180 touch database/log.wrm
181 echo -n "ACEDB installed " >> database/log.wrm
182 echo `date` >> database/log.wrm
183
184 if (-e 'wspec/passwd.old' ) then
185 echo ' '
186 echo ' I restore the old passwd file'
187 \mv wspec/passwd.old wspec/passwd.wrm
188 endif
189
190 # Add administrator to the passwd file
191
192 if (-e wspec/passwd.wrm) then
193 setenv ADMIN `whoami`
194 grep ^${ADMIN}$ wspec/passwd.wrm >! /dev/null
195 if ($status) then
196 echo ' '
197 echo " I add $ADMIN to the password file"
198 echo ' ' >> wspec/passwd.wrm
199 echo -n $ADMIN >> wspec/passwd.wrm
200 echo ' // Login name of the administrator installing acedb' >> wspec/passwd.wrm
201 endif
202 endif
203
204 if (-d bin) chmod 755 bin
205 if (-d database) chmod 755 database
206 foreach i (w*)
207 chmod 755 $i
208 end
209
210 # next lines remove SCCS stuff, and unlock any locked files
211 foreach i (w*)
212 if (-e $i/SCCS) \rm -r $i/SCCS
213 if (-e $i/CVS) \rm -r $i/CVS
214 end
215 foreach i (w*) # by directory so glob list not too large
216 if (-d $i) chmod u+w $i/*
217 end
218
219 # old possible subdirectories of w* (not in ace4)
220 if (-d wdoc/code) chmod 755 wdoc/code
221 if (-d wmake/others) chmod 755 wmake/others
222
223 if (-e 'bin/xace') chmod 755 bin/xace
224 if (-e 'bin/tace') chmod 755 bin/tace
225 if (-e 'bin/fetch') chmod 755 bin/fetch
226 if (-d wscripts) chmod 755 wscripts/*
227 if (-e INSTALL) chmod 755 INSTALL
228
229 if (-e xace) \rm xace
230 if (-e tace) \rm tace
231 if (-e makefile) \rm makefile
232 if (-d wmake && -e wmake/makefile) ln -s wmake/makefile makefile
233
234 # Prepare shell scripts that should eventually be moved into /usr/local/bin
235
236 echo '#\!/bin/csh' >! acedb
237 echo "setenv ACEDB $cwd" >> acedb
238 echo "setenv DBDIR $cwd/database/" >> acedb
239 echo "set path = ($cwd/bin"' $path)' >> acedb
240 echo "xace" >> acedb
241 chmod 755 acedb
242
243 echo '#\!/bin/csh' >! textace
244 echo "setenv ACEDB $cwd" >> textace
245 echo '$ACEDB/bin/tace' >> textace
246 chmod 755 textace
247
248 echo ' '
249 echo ' I have just created the files "acedb" and "textace" to run the'
250 echo ' graphical and command-line versions of acedb respectively.'
251 echo " These commands should be placed in each user's path. To do this"
252 echo ' either the users can add the following to the end of their .cshrc file:'
253 echo -n ' set path = ($path '
254 echo "`pwd`)"
255 echo ' or preferably root should move them to /usr/local/bin by:'
256 echo ' mv acedb textace /usr/local/bin'
257 echo ' '
258 echo ' If you added update.* files, when you first run acedb you should choose the'
259 echo ' "Add Update" option from the main menu to load the updates into the database.'
260 echo ' '
261
262 if (-d wspec.source) then
263 echo ' If you want to recompile you must set two environment variables:'
264 echo -n " setenv ACEDB_SRC "
265 echo `pwd`
266 echo ' setenv ACEDB_MACHINE one of SUN_4, SGI_4 etc, see wmake/truemake'
267 echo ' then type "make all". More details in the manual.'
268 endif
269 if (! -e 'bin/xace') then
270 echo " No executables - you will have to recompile."
271 endif
272
273 echo ' '
274 echo ' If users other than yourself need write access, add their'
275 echo ' login names into wspec/passwd.wrm.'
276 echo ' '
277 echo ' For more information :'
278 echo ' a) Use the on-line help (help key or F1 or F10), while running acedb'
279 echo ' b) Read the manuals in directory doc if you have it'
280 echo ' c) Look at the WWW site: http://www.acedb.org
281 echo ' d) Use e-mail : [email protected] or [email protected]'
282 echo ' '
283
284 ## Report attempt to Acedb authors
285
286 echo " If you do not object, a report of the installation will now be mailed"
287 echo ' to the developers of ACEDB. This lets us track installations, which'
288 echo ' helps give you a better service.'
289 echo -n ' Should we mail this report (default yes)? '
290 switch("$<")
291 case "no":
292 case "n":
293 case "NO":
294 case "N":
295 goto finis
296 breaksw
297 default:
298 breaksw
299 endsw
300
301 ## did not go to finis - mail
302
303 echo "acedb $ace_version install attempt" > ! toto
304 echo `uname -a` >> toto
305 echo `date` >> toto
306 echo `whoami` >> toto
307 echo `pwd` >> toto
308 ls bin.*.Z source.*.Z update.*.Z >> toto
309
310 if (-x Mail) then
311 Mail -s install.$ace_version [email protected] < toto
312 Mail -s install.$ace_version [email protected] < toto
313 else
314 mail -s install.$ace_version [email protected] < toto
315 mail -s install.$ace_version [email protected] < toto
316 endif
317
318 echo 'This is an automatically generated report of the installation of' >! toto1
319 echo 'the ACEDB database and software.' >> toto1
320 echo ' ' >> toto1
321
322 cat toto >> toto1
323
324 echo ' ' >> toto1
325 echo 'With the permission of the installer, this report was also sent to' >> toto1
326 echo 'the developers of ACEDB, so that they can track installations to help' >> toto1
327 echo 'support users.' >> toto1
328
329 mail root < toto1
330
331 \rm toto toto1
332
333 finis:
334
335 echo ' '
336 echo ' The installation is complete.'
337 echo ' After testing the program, you can archive and remove the tar.Z files.'
338 echo ' Please let us know if this installation script does not work.'
339 echo ' '
340 echo ' Au revoir'
341
342 ## end of Installation script ##