1 | #!/bin/sh
|
---|
2 |
|
---|
3 | ## Install.sh -- Install Greenstone
|
---|
4 |
|
---|
5 | cmd_cp="cp"
|
---|
6 | cmd_cpr="cp -r"
|
---|
7 | cmd_chmod="chmod"
|
---|
8 | cmd_mkdir="mkdir -p"
|
---|
9 | cmd_ln="ln -s"
|
---|
10 | cmd_mv="mv"
|
---|
11 | cmd_rm="rm -i"
|
---|
12 | cmd_rmr="rm -r"
|
---|
13 |
|
---|
14 | thisdir=`pwd`
|
---|
15 | cd ..
|
---|
16 | cd_dir=`pwd`
|
---|
17 | cd "$thisdir"
|
---|
18 |
|
---|
19 | # script must be run from within cdrom/unix directory
|
---|
20 | if [ ! -f "${thisdir}/Install.sh" ]; then
|
---|
21 | echo "$itext1"
|
---|
22 | echo "$itext0"
|
---|
23 | exit 1
|
---|
24 | fi
|
---|
25 |
|
---|
26 | # check that various important directories are on the cd
|
---|
27 | if [ ! -d "${cd_dir}/gsdl" ]; then
|
---|
28 | echo
|
---|
29 | echo "${itext2}${cd_dir}/gsdl"
|
---|
30 | echo "$itext0"
|
---|
31 | exit 1
|
---|
32 | fi
|
---|
33 | if [ ! -d "${cd_dir}/Unix/bin/linux" ]; then
|
---|
34 | echo
|
---|
35 | echo "${itext2}${cd_dir}/Unix/bin/linux"
|
---|
36 | echo "$itext0"
|
---|
37 | exit 1
|
---|
38 | fi
|
---|
39 |
|
---|
40 | # install to /usr/local by default if user is "root", otherwise
|
---|
41 | # default to users home directory
|
---|
42 | gsdlos=`uname | tr A-Z a-z`
|
---|
43 | if [ "$gsdlos" = "linux" ]; then
|
---|
44 | logname=`whoami`
|
---|
45 | else
|
---|
46 | logname=""
|
---|
47 | fi
|
---|
48 | if [ "$logname" = "" ]; then
|
---|
49 | logname=`logname`
|
---|
50 | fi
|
---|
51 | gsdlhome="/home/${logname}"
|
---|
52 | if [ "$logname" = "root" ]; then
|
---|
53 | gsdlhome="/usr/local"
|
---|
54 | fi
|
---|
55 |
|
---|
56 |
|
---|
57 | itext0="Greenstone was not installed"
|
---|
58 |
|
---|
59 | itext1="Install.sh must be run from the directory in which it resides"
|
---|
60 |
|
---|
61 | itext2="ERROR: Could not locate "
|
---|
62 |
|
---|
63 | itext3="This script will install Greenstone on your system. You may want
|
---|
64 | to skim through the Install.pdf document that resides in the docs
|
---|
65 | directory on this cd-rom before continuing with the installation.
|
---|
66 |
|
---|
67 | Note that when prompted for input, hitting \"enter\" will select
|
---|
68 | the default (given in square brackets [] at the end of each question).
|
---|
69 | If you're unsure which option to select, use the default.
|
---|
70 |
|
---|
71 | Note also that Install.sh prints out information on any commands
|
---|
72 | it runs on your system in the form \"--> Install.sh: [command]\".
|
---|
73 |
|
---|
74 | It is assumed throughout this installation procedure that you
|
---|
75 | have a webserver installed on your system.
|
---|
76 |
|
---|
77 | For later reference the output of this install script will be
|
---|
78 | recorded in a file called INSTALL_RECORD in the directory into
|
---|
79 | which you choose to install Greenstone.
|
---|
80 |
|
---|
81 | Continue? [y]"
|
---|
82 |
|
---|
83 | itext4="
|
---|
84 | Which directory should Greenstone be installed to?
|
---|
85 | Make sure that this directory is on a partition with sufficient
|
---|
86 | free disk space for the installation options you intend selecting."
|
---|
87 |
|
---|
88 | itext5="
|
---|
89 | * A linux binary installation requires approximately
|
---|
90 | 40Mb."
|
---|
91 |
|
---|
92 | itext6="
|
---|
93 | * Compiling Greenstone from source code requires
|
---|
94 | approximately 155Mb.
|
---|
95 | * Optional Greenstone demonstration collections may use up
|
---|
96 | to a further 200Mb (you'll be told the size of each individual
|
---|
97 | collection before you install it).
|
---|
98 | * Online documentation requires a further 4Mb.
|
---|
99 | * Enabling Greenstone's \"CD exporting\" function requires a
|
---|
100 | further 24Mb.
|
---|
101 | Enter directory to install Greenstone into. A gsdl directory
|
---|
102 | will be created in this directory. [${gsdlhome}]"
|
---|
103 |
|
---|
104 | itext34="
|
---|
105 | Enter existing cgi executable directory [/usr/local/apache/cgi-bin]"
|
---|
106 |
|
---|
107 |
|
---|
108 | # get gsdlhome
|
---|
109 | echo "$itext3"
|
---|
110 | printf "%s" "> "
|
---|
111 | read ans
|
---|
112 | log="${log}${itext3}
|
---|
113 | > $ans
|
---|
114 | "
|
---|
115 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
116 | echo "$itext0"
|
---|
117 | exit 0
|
---|
118 | fi
|
---|
119 |
|
---|
120 | msg="$itext4"
|
---|
121 | if [ "$gsdlos" = "linux" ]; then
|
---|
122 | msg="${msg}$itext5"
|
---|
123 | fi
|
---|
124 | msg="${msg}$itext6"
|
---|
125 | echo "$msg"
|
---|
126 | printf "%s" "> "
|
---|
127 | read ans
|
---|
128 | log="${log}${msg}
|
---|
129 | > $ans
|
---|
130 | "
|
---|
131 | if [ "$ans" != "" ]; then
|
---|
132 | gsdlhome="$ans"
|
---|
133 | fi
|
---|
134 |
|
---|
135 | itext7="
|
---|
136 | Warning: The ${gsdlhome} directory does not exist.
|
---|
137 | Create it? [y]"
|
---|
138 |
|
---|
139 | itext8="ERROR: failed to create $gsdlhome directory"
|
---|
140 |
|
---|
141 | if [ ! -d "$gsdlhome" ]; then
|
---|
142 | echo "$itext7"
|
---|
143 | printf "%s" "> "
|
---|
144 | read ans
|
---|
145 | log="${log}${itext7}
|
---|
146 | > $ans
|
---|
147 | "
|
---|
148 | if [ "$ans" = "" ]; then
|
---|
149 | ans="y"
|
---|
150 | fi
|
---|
151 | if [ "$ans" = "y" ]; then
|
---|
152 | msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome\"]"
|
---|
153 | echo "$msg"
|
---|
154 | log="${log}${msg}
|
---|
155 | "
|
---|
156 | $cmd_mkdir "$gsdlhome"
|
---|
157 | if [ ! -d "$gsdlhome" ]; then
|
---|
158 | echo "$itext8"
|
---|
159 | echo "$itext0"
|
---|
160 | exit 1
|
---|
161 | fi
|
---|
162 | else
|
---|
163 | echo "$itext0"
|
---|
164 | exit 0
|
---|
165 | fi
|
---|
166 | fi
|
---|
167 |
|
---|
168 | # from now on $gsdlhome includes the "/gsdl"
|
---|
169 | gsdlhome="${gsdlhome}/gsdl"
|
---|
170 |
|
---|
171 | itext9="
|
---|
172 | If this installation fails or is cancelled, run the uninstall
|
---|
173 | script (${gsdlhome}/Uninstall.sh) to clean up the partial
|
---|
174 | installation.
|
---|
175 | Continue? [y]"
|
---|
176 |
|
---|
177 | itext10="
|
---|
178 | Installing Greenstone directory structure to ${gsdlhome}"
|
---|
179 |
|
---|
180 | itext11="
|
---|
181 | Would you like to install the Greenstone documentation to your
|
---|
182 | hard drive? The docs will use about 4Mb of space. If you choose
|
---|
183 | not to install them you can still access them from within the
|
---|
184 | docs directory of the cd-rom) [y]"
|
---|
185 |
|
---|
186 | itext12="
|
---|
187 | Would you like to install support for Greenstone's \"CD exporting\"
|
---|
188 | function? This function allows you to export a Greenstone collection
|
---|
189 | in a form suitable for writing to a self-installing Windows cd-rom.
|
---|
190 | This package will use approximately 23Mb of disk space [n]"
|
---|
191 |
|
---|
192 | itext13="
|
---|
193 | The Greenstone demonstration collection has been installed. Would you
|
---|
194 | like to install any other collections from the installation cd-rom? [y]
|
---|
195 | (note that only the built indexes will be installed for these
|
---|
196 | collections - if you require the original source documents you may
|
---|
197 | manually copy them from the \"collect\" directory of the cd-rom)"
|
---|
198 |
|
---|
199 | itext14="
|
---|
200 | Install the Greenstone mailing list archive (gsarch) - 3Mb? [y]"
|
---|
201 |
|
---|
202 | itext15="
|
---|
203 | Install the MSWord/PDF/RTF/Postscript demonstration collection (wordpdf) - 4Mb? [y]"
|
---|
204 |
|
---|
205 | itext16="
|
---|
206 | Install the Chinese demonstration collection (chinese) - 6Mb? [y]"
|
---|
207 |
|
---|
208 | itext17="
|
---|
209 | Install the Humanity Development Library subset (hdlsub) - 130 Mb? [y]"
|
---|
210 |
|
---|
211 | itext18="Setting permissions ..."
|
---|
212 |
|
---|
213 | itext19="
|
---|
214 | In order for end-user collection building to be enabled the
|
---|
215 | Greenstone cgi program must be able to write to the
|
---|
216 | ${gsdlhome}/collect and ${gsdlhome}/tmp directories.
|
---|
217 | On most systems this means they must be globally writable.
|
---|
218 | Make these directories globally writable? [y]"
|
---|
219 |
|
---|
220 | itext20="
|
---|
221 | You may either install pre-compiled, statically linked linux [b]inaries
|
---|
222 | (i386 only) or install and [c]ompile the Greenstone source code"
|
---|
223 |
|
---|
224 | itext21="Enter \"[b]\" or \"c\""
|
---|
225 |
|
---|
226 | itext22="Installing linux binaries"
|
---|
227 |
|
---|
228 | itext23="Installing source code"
|
---|
229 |
|
---|
230 | itext24="configuring ..."
|
---|
231 |
|
---|
232 | itext25="compiling ..."
|
---|
233 |
|
---|
234 | itext26="installing ..."
|
---|
235 |
|
---|
236 | itext27="ERROR: Compilation failed"
|
---|
237 |
|
---|
238 | itext28="
|
---|
239 |
|
---|
240 | Greenstone needs a valid cgi executable directory (normally called
|
---|
241 | cgi-bin on unix systems) from which to run.
|
---|
242 | This may be either:
|
---|
243 | 1. The default Greenstone cgi-bin directory (${gsdlhome}/cgi-bin).
|
---|
244 | If you use the Greenstone default you will need to configure
|
---|
245 | your webserver to treat this directory as a cgi executable
|
---|
246 | directory. For the Apache webserver you use the ScriptAlias
|
---|
247 | directive to do this (details of how to configure your webserver
|
---|
248 | will be displayed at the end of this installation procedure)."
|
---|
249 |
|
---|
250 | itext29=" Note that you will probably need help from your system
|
---|
251 | administrator to reconfigure your webserver."
|
---|
252 |
|
---|
253 | itext30=" 2. An existing cgi-bin directory. Normally a cgi-bin directory
|
---|
254 | is created when your webserver is installed. Typically, this
|
---|
255 | might be /home/httpd/cgi-bin, or /usr/local/apache/cgi-bin, or
|
---|
256 | /var/lib/apache/cgi-bin."
|
---|
257 |
|
---|
258 | itext31=" Many systems also allow individual users to have their own
|
---|
259 | cgi-bin in /home/username/public_html/cgi-bin."
|
---|
260 |
|
---|
261 | itext32="Enter \"[1]\" or \"2\""
|
---|
262 |
|
---|
263 | itext33="
|
---|
264 | Don't forget to configure your webserver to treat ${gsdlhome}/cgi-bin
|
---|
265 | as a cgi executable directory. Don't worry, you'll be
|
---|
266 | reminded of this again at the end of the installation
|
---|
267 | procedure"
|
---|
268 |
|
---|
269 | itext37="Run the uninstall script (${gsdlhome}/Uninstall.sh)
|
---|
270 | to clean up the partial installation."
|
---|
271 |
|
---|
272 | itext42="
|
---|
273 |
|
---|
274 | In order for Greenstone to run, the $gsdlhome
|
---|
275 | directory and all it contains must be accessible from the web.
|
---|
276 | To make this happen you may either:
|
---|
277 | 1. Configure your webserver so that $gsdlhome
|
---|
278 | is itself accessible from the web."
|
---|
279 |
|
---|
280 | itext43=" 2. Provide an existing web accessible directory from which
|
---|
281 | a symbolic link (ln -s) will be made to $gsdlhome.
|
---|
282 | When your server was installed a web accessible directory
|
---|
283 | will have been created (the Apache webserver uses the
|
---|
284 | DocumentRoot directive to define this directory). Typically
|
---|
285 | this directory might be /home/httpd/html, or /usr/local/apache/htdocs,
|
---|
286 | or /var/lib/apache/htdocs."
|
---|
287 |
|
---|
288 | itext44=" Many systems also allow individual users to have their own
|
---|
289 | web accessible directory in /home/username/public_html."
|
---|
290 |
|
---|
291 | itext45=" Note that your web server will need to be configured to allow
|
---|
292 | symbolic links from within this directory. For the Apache
|
---|
293 | server that means this directory must be configured with
|
---|
294 | the SymLinksIfOwnerMatch or FollowSymLinks option (most Apache
|
---|
295 | installations are configured this way by default)."
|
---|
296 |
|
---|
297 | itext46="
|
---|
298 | Don't forget to configure your webserver to make $gsdlhome
|
---|
299 | accessible from the web. You'll be reminded of this again
|
---|
300 | at the end of this installation procedure."
|
---|
301 |
|
---|
302 |
|
---|
303 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}\"]"
|
---|
304 | echo "$msg"
|
---|
305 | log="${log}${msg}
|
---|
306 | "
|
---|
307 | $cmd_mkdir "$gsdlhome"
|
---|
308 | if [ ! -d "$gsdlhome" ]; then
|
---|
309 | echo "$itext8"
|
---|
310 | echo "$itext0"
|
---|
311 | exit 1
|
---|
312 | fi
|
---|
313 | # set permissions on gsdlhome directory
|
---|
314 | msg="--> Install.sh: [$cmd_chmod u+rwx \"${gsdlhome}\"]"
|
---|
315 | echo "$msg"
|
---|
316 | log="${log}${msg}
|
---|
317 | "
|
---|
318 | $cmd_chmod u+rwx "$gsdlhome"
|
---|
319 |
|
---|
320 | # create initial Uninstall.sh
|
---|
321 | cd "$gsdlhome"
|
---|
322 | echo "#!/bin/sh" > Uninstall.sh
|
---|
323 | echo "" >> Uninstall.sh
|
---|
324 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
325 | echo "read ans" >> Uninstall.sh
|
---|
326 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
327 | echo " $cmd_chmod -R u+rwx \"$gsdlhome\"" >> Uninstall.sh
|
---|
328 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
329 | echo "fi" >> Uninstall.sh
|
---|
330 | $cmd_chmod u+x Uninstall.sh
|
---|
331 | cd "$thisdir"
|
---|
332 |
|
---|
333 | # create initial INSTALL_RECORD
|
---|
334 | echo "$log" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
335 |
|
---|
336 | echo "$itext9"
|
---|
337 | echo "$itext9" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
338 | printf "%s" "> "
|
---|
339 | read ans
|
---|
340 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
341 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
342 | msg="$itext0"
|
---|
343 | echo "$msg"
|
---|
344 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
345 | exit 0
|
---|
346 | fi
|
---|
347 |
|
---|
348 | echo "$itext10"
|
---|
349 | echo "$itext10" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
350 |
|
---|
351 | # copy gsdl directory across
|
---|
352 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/gsdl/\"* \"$gsdlhome\"]"
|
---|
353 | echo "$msg"
|
---|
354 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
355 | $cmd_cpr "${cd_dir}/gsdl/"* "$gsdlhome"
|
---|
356 |
|
---|
357 | # copy setup shell scripts across too
|
---|
358 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Unix/setup.\"* \"$gsdlhome\"]"
|
---|
359 | echo "$msg"
|
---|
360 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
361 | $cmd_cp "${cd_dir}/src/Unix/setup."* "$gsdlhome"
|
---|
362 |
|
---|
363 | # make sure we have a tmp directory
|
---|
364 | if [ ! -d "$gsdlhome/tmp" ]; then
|
---|
365 | msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome/tmp\"]"
|
---|
366 | echo "$msg"
|
---|
367 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
368 | $cmd_mkdir "${gsdlhome}/tmp"
|
---|
369 | fi
|
---|
370 |
|
---|
371 | # make collect directory writable so we can install collections
|
---|
372 | msg="--> Install.sh: [$cmd_chmod u+rwx \"$gsdlhome/collect\"]"
|
---|
373 | echo "$msg"
|
---|
374 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
375 | $cmd_chmod u+rwx "$gsdlhome/collect"
|
---|
376 |
|
---|
377 | # do we want docs directory?
|
---|
378 | echo "$itext11"
|
---|
379 | echo "$itext11" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
380 | printf "%s" "> "
|
---|
381 | read ans
|
---|
382 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
383 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
384 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/docs\" \"$gsdlhome\"]"
|
---|
385 | echo "$msg"
|
---|
386 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
387 | $cmd_cpr "${cd_dir}/docs" "$gsdlhome"
|
---|
388 | fi
|
---|
389 |
|
---|
390 | # do we want the "CD exporting" stuff?
|
---|
391 | echo "$itext12"
|
---|
392 | echo "$itext12" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
393 | printf "%s" "> "
|
---|
394 | read ans
|
---|
395 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
396 | if [ "$ans" = "Y" ] || [ "$ans" = "y" ]; then
|
---|
397 | msg="--> Install.sh: [$cmd_chmod u+rw \"${gsdlhome}/bin\"]"
|
---|
398 | echo "$msg"
|
---|
399 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
400 | $cmd_chmod u+rw "${gsdlhome}/bin"
|
---|
401 |
|
---|
402 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/bin/windows\"]"
|
---|
403 | echo "$msg"
|
---|
404 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
405 | $cmd_mkdir "${gsdlhome}/bin/windows"
|
---|
406 |
|
---|
407 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/netscape\" \"${gsdlhome}/bin/windows\"]"
|
---|
408 | echo "$msg"
|
---|
409 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
410 | $cmd_cpr "${cd_dir}/Windows/bin/windows/netscape" "${gsdlhome}/bin/windows"
|
---|
411 |
|
---|
412 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/Win32s\" \"${gsdlhome}/bin/windows\"]"
|
---|
413 | echo "$msg"
|
---|
414 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
415 | $cmd_cpr "${cd_dir}/Windows/bin/windows/Win32s" "${gsdlhome}/bin/windows"
|
---|
416 |
|
---|
417 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/net16\" \"${gsdlhome}/bin/windows\"]"
|
---|
418 | echo "$msg"
|
---|
419 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
420 | $cmd_cpr "${cd_dir}/Windows/bin/windows/net16" "${gsdlhome}/bin/windows"
|
---|
421 |
|
---|
422 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/Windows/bin/windows/net32\" \"${gsdlhome}/bin/windows\"]"
|
---|
423 | echo "$msg"
|
---|
424 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
425 | $cmd_cpr "${cd_dir}/Windows/bin/windows/net32" "${gsdlhome}/bin/windows"
|
---|
426 |
|
---|
427 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/server.exe\" \"${gsdlhome}/bin/windows\"]"
|
---|
428 | echo "$msg"
|
---|
429 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
430 | $cmd_cp "${cd_dir}/Windows/bin/windows/server.exe" "${gsdlhome}/bin/windows"
|
---|
431 |
|
---|
432 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/gssetup.exe\" \"${gsdlhome}/bin/windows\"]"
|
---|
433 | echo "$msg"
|
---|
434 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
435 | $cmd_cp "${cd_dir}/Windows/bin/windows/gssetup.exe" "${gsdlhome}/bin/windows"
|
---|
436 |
|
---|
437 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/setpw.exe\" \"${gsdlhome}/bin/windows\"]"
|
---|
438 | echo "$msg"
|
---|
439 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
440 | $cmd_cp "${cd_dir}/Windows/bin/windows/setpw.exe" "${gsdlhome}/bin/windows"
|
---|
441 |
|
---|
442 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/Windows/bin/windows/Setup.exe\" \"${gsdlhome}/bin/windows\"]"
|
---|
443 | echo "$msg"
|
---|
444 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
445 | $cmd_cp "${cd_dir}/Windows/bin/windows/Setup.exe" "${gsdlhome}/bin/windows"
|
---|
446 | fi
|
---|
447 |
|
---|
448 |
|
---|
449 | # which collections do we want
|
---|
450 | cd "${cd_dir}/collect"
|
---|
451 | echo "$itext13"
|
---|
452 | echo "$itext13" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
453 | printf "%s" "> "
|
---|
454 | read ans
|
---|
455 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
456 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
457 |
|
---|
458 | # gsarch
|
---|
459 | echo "$itext14"
|
---|
460 | echo "$itext14" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
461 | printf "%s" "> "
|
---|
462 | read ans
|
---|
463 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
464 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
465 |
|
---|
466 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/gsarch\"]"
|
---|
467 | echo "$msg"
|
---|
468 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
469 | $cmd_mkdir "${gsdlhome}/collect/gsarch"
|
---|
470 |
|
---|
471 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/etc\" \"${gsdlhome}/collect/gsarch\"]"
|
---|
472 | echo "$msg"
|
---|
473 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
474 | $cmd_cpr "${cd_dir}/collect/gsarch/etc" "${gsdlhome}/collect/gsarch"
|
---|
475 |
|
---|
476 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/images\" \"${gsdlhome}/collect/gsarch\"]"
|
---|
477 | echo "$msg"
|
---|
478 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
479 | $cmd_cpr "${cd_dir}/collect/gsarch/images" "${gsdlhome}/collect/gsarch"
|
---|
480 |
|
---|
481 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch/index\" \"${gsdlhome}/collect/gsarch\"]"
|
---|
482 | echo "$msg"
|
---|
483 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
484 | $cmd_cpr "${cd_dir}/collect/gsarch/index" "${gsdlhome}/collect/gsarch"
|
---|
485 | fi
|
---|
486 |
|
---|
487 | # wordpdf
|
---|
488 | echo "$itext15"
|
---|
489 | echo "$itext15" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
490 | printf "%s" "> "
|
---|
491 | read ans
|
---|
492 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
493 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
494 |
|
---|
495 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/wordpdf\"]"
|
---|
496 | echo "$msg"
|
---|
497 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
498 | $cmd_mkdir "${gsdlhome}/collect/wordpdf"
|
---|
499 |
|
---|
500 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/etc\" \"${gsdlhome}/collect/wordpdf\"]"
|
---|
501 | echo "$msg"
|
---|
502 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
503 | $cmd_cpr "${cd_dir}/collect/wordpdf/etc" "${gsdlhome}/collect/wordpdf"
|
---|
504 |
|
---|
505 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/images\" \"${gsdlhome}/collect/wordpdf\"]"
|
---|
506 | echo "$msg"
|
---|
507 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
508 | $cmd_cpr "${cd_dir}/collect/wordpdf/images" "${gsdlhome}/collect/wordpdf"
|
---|
509 |
|
---|
510 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf/index\" \"${gsdlhome}/collect/wordpdf\"]"
|
---|
511 | echo "$msg"
|
---|
512 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
513 | $cmd_cpr "${cd_dir}/collect/wordpdf/index" "${gsdlhome}/collect/wordpdf"
|
---|
514 | fi
|
---|
515 |
|
---|
516 | # chinese
|
---|
517 | echo "$itext16"
|
---|
518 | echo "$itext16" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
519 | printf "%s" "> "
|
---|
520 | read ans
|
---|
521 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
522 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
523 |
|
---|
524 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/chinese\"]"
|
---|
525 | echo "$msg"
|
---|
526 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
527 | $cmd_mkdir "${gsdlhome}/collect/chinese"
|
---|
528 |
|
---|
529 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/etc\" \"${gsdlhome}/collect/chinese\"]"
|
---|
530 | echo "$msg"
|
---|
531 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
532 | $cmd_cpr "${cd_dir}/collect/chinese/etc" "${gsdlhome}/collect/chinese"
|
---|
533 |
|
---|
534 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/images\" \"${gsdlhome}/collect/chinese\"]"
|
---|
535 | echo "$msg"
|
---|
536 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
537 | $cmd_cpr "${cd_dir}/collect/chinese/images" "${gsdlhome}/collect/chinese"
|
---|
538 |
|
---|
539 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese/index\" \"${gsdlhome}/collect/chinese\"]"
|
---|
540 | echo "$msg"
|
---|
541 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
542 | $cmd_cpr "${cd_dir}/collect/chinese/index" "${gsdlhome}/collect/chinese"
|
---|
543 | fi
|
---|
544 |
|
---|
545 | # hdlsub
|
---|
546 | echo "$itext17"
|
---|
547 | echo "$itext17" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
548 | printf "%s" "> "
|
---|
549 | read ans
|
---|
550 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
551 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
552 |
|
---|
553 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}/collect/hdlsub\"]"
|
---|
554 | echo "$msg"
|
---|
555 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
556 | $cmd_mkdir "${gsdlhome}/collect/hdlsub"
|
---|
557 |
|
---|
558 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/etc\" \"${gsdlhome}/collect/hdlsub\"]"
|
---|
559 | echo "$msg"
|
---|
560 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
561 | $cmd_cpr "${cd_dir}/collect/hdlsub/etc" "${gsdlhome}/collect/hdlsub"
|
---|
562 |
|
---|
563 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/images\" \"${gsdlhome}/collect/hdlsub\"]"
|
---|
564 | echo "$msg"
|
---|
565 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
566 | $cmd_cpr "${cd_dir}/collect/hdlsub/images" "${gsdlhome}/collect/hdlsub"
|
---|
567 |
|
---|
568 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/hdlsub/index\" \"${gsdlhome}/collect/hdlsub\"]"
|
---|
569 | echo "$msg"
|
---|
570 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
571 | $cmd_cpr "${cd_dir}/collect/hdlsub/index" "${gsdlhome}/collect/hdlsub"
|
---|
572 | fi
|
---|
573 | fi
|
---|
574 |
|
---|
575 | # set permissions
|
---|
576 | msg="
|
---|
577 | $itext18
|
---|
578 | --> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]
|
---|
579 | --> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/script/\"*]"
|
---|
580 | echo "$msg"
|
---|
581 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
582 | $cmd_chmod -R u+rw "$gsdlhome"
|
---|
583 | $cmd_chmod a+x "${gsdlhome}/bin/script/"*
|
---|
584 |
|
---|
585 | # certain files in gsdl/etc need to be globally writable
|
---|
586 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/errout.txt\"]"
|
---|
587 | echo "$msg"
|
---|
588 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
589 | $cmd_chmod a+w "$gsdlhome/etc/errout.txt"
|
---|
590 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/initout.txt\"]"
|
---|
591 | echo "$msg"
|
---|
592 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
593 | $cmd_chmod a+w "$gsdlhome/etc/initout.txt"
|
---|
594 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/key.db\"]"
|
---|
595 | echo "$msg"
|
---|
596 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
597 | $cmd_chmod a+w "$gsdlhome/etc/key.db"
|
---|
598 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/users.db\"]"
|
---|
599 | echo "$msg"
|
---|
600 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
601 | $cmd_chmod a+w "$gsdlhome/etc/users.db"
|
---|
602 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/main.cfg\"]"
|
---|
603 | echo "$msg"
|
---|
604 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
605 | $cmd_chmod a+w "$gsdlhome/etc/main.cfg"
|
---|
606 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/history.db\"]"
|
---|
607 | echo "$msg"
|
---|
608 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
609 | $cmd_chmod a+w "$gsdlhome/etc/history.db"
|
---|
610 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/usage.txt\"]"
|
---|
611 | echo "$msg"
|
---|
612 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
613 | $cmd_chmod a+w "$gsdlhome/etc/usage.txt"
|
---|
614 |
|
---|
615 |
|
---|
616 | # should gsdl/collect and gsdl/tmp be globally writable?
|
---|
617 | echo "$itext19"
|
---|
618 | echo "$itext19" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
619 | printf "%s" "> "
|
---|
620 | read ans
|
---|
621 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
622 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
623 | msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/collect\"]"
|
---|
624 | echo "$msg"
|
---|
625 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
626 | $cmd_chmod -R a+w "$gsdlhome/collect"
|
---|
627 | msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/tmp\"]"
|
---|
628 | echo "$msg"
|
---|
629 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
630 | $cmd_chmod -R a+w "$gsdlhome/tmp"
|
---|
631 | fi
|
---|
632 |
|
---|
633 | # binaries or source code?
|
---|
634 | compile="yes"
|
---|
635 | if [ "$gsdlos" = "linux" ]; then
|
---|
636 | echo "$itext20"
|
---|
637 | echo "$itext20" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
638 |
|
---|
639 | found=no
|
---|
640 | while [ "$found" = "no" ]; do
|
---|
641 | echo "$itext21"
|
---|
642 | echo "$itext21" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
643 | printf "%s" "> "
|
---|
644 | read ans
|
---|
645 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
646 | if [ "$ans" = "" ] || [ "$ans" = "b" ]; then
|
---|
647 | compile="no"
|
---|
648 | # install binaries
|
---|
649 | msg="
|
---|
650 | $itext22
|
---|
651 | --> Install.sh: [$cmd_cpr \"${cd_dir}/Unix/bin/linux\" \"${gsdlhome}/bin\"]"
|
---|
652 | echo "$msg"
|
---|
653 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
654 | $cmd_cpr "${cd_dir}/Unix/bin/linux" "${gsdlhome}/bin"
|
---|
655 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/linux/\"*]"
|
---|
656 | echo "$msg"
|
---|
657 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
658 | $cmd_chmod a+x "${gsdlhome}/bin/linux/"*
|
---|
659 | msg="--> Install.sh: [$cmd_chmod -R u+rw \"${gsdlhome}/bin/linux\"]"
|
---|
660 | echo "$msg"
|
---|
661 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
662 | $cmd_chmod -R u+rw "${gsdlhome}/bin/linux"
|
---|
663 |
|
---|
664 | # move library executable to cgi-bin
|
---|
665 | msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/library\" \"${gsdlhome}/cgi-bin\"]"
|
---|
666 | echo "$msg"
|
---|
667 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
668 | $cmd_mv "${gsdlhome}/bin/linux/library" "${gsdlhome}/cgi-bin"
|
---|
669 |
|
---|
670 | # move XML.tgz to perllib/cpan and untar it
|
---|
671 | msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/XML.tgz\" \"${gsdlhome}/perllib/cpan\"]"
|
---|
672 | echo "$msg"
|
---|
673 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
674 | $cmd_mv "${gsdlhome}/bin/linux/XML.tgz" "${gsdlhome}/perllib/cpan"
|
---|
675 | cd "${gsdlhome}/perllib/cpan"
|
---|
676 | msg="--> Install.sh: [gzip -dc XML.tgz | tar -xf -]"
|
---|
677 | echo "$msg"
|
---|
678 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
679 | gzip -dc XML.tgz | tar -xf -
|
---|
680 |
|
---|
681 | found="yes"
|
---|
682 | elif [ "$ans" = "c" ]; then
|
---|
683 | found="yes"
|
---|
684 | fi
|
---|
685 | done
|
---|
686 | fi
|
---|
687 |
|
---|
688 | if [ "$compile" = "yes" ]; then
|
---|
689 | # install source
|
---|
690 | msg="
|
---|
691 | $itext23
|
---|
692 | --> Install.sh: [$cmd_cpr \"${cd_dir}/src/lib\" \"$gsdlhome\"]"
|
---|
693 | echo "$msg"
|
---|
694 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
695 | $cmd_cpr "${cd_dir}/src/lib" "$gsdlhome"
|
---|
696 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/packages\" \"$gsdlhome\"]"
|
---|
697 | echo "$msg"
|
---|
698 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
699 | $cmd_cpr "${cd_dir}/src/packages" "$gsdlhome"
|
---|
700 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/src\" \"$gsdlhome\"]"
|
---|
701 | echo "$msg"
|
---|
702 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
703 | $cmd_cpr "${cd_dir}/src/src" "$gsdlhome"
|
---|
704 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/src/Unix/\"* \"$gsdlhome\"]"
|
---|
705 | echo "$msg"
|
---|
706 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
707 | $cmd_cpr "${cd_dir}/src/Unix/"* "$gsdlhome"
|
---|
708 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Install.txt\" \"$gsdlhome\"]"
|
---|
709 | echo "$msg"
|
---|
710 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
711 | $cmd_cp "${cd_dir}/src/Install.txt" "$gsdlhome"
|
---|
712 | msg="--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
|
---|
713 | echo "$msg"
|
---|
714 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
715 | $cmd_chmod -R u+rw "$gsdlhome"
|
---|
716 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/configure\"]"
|
---|
717 | echo "$msg"
|
---|
718 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
719 | $cmd_chmod a+x "${gsdlhome}/configure"
|
---|
720 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/packages/yaz/configure\"]"
|
---|
721 | echo "$msg"
|
---|
722 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
723 | $cmd_chmod a+x "${gsdlhome}/packages/yaz/configure"
|
---|
724 |
|
---|
725 | # compile it
|
---|
726 | msg="--> Install.sh: [cd $gsdlhome]"
|
---|
727 | echo "$msg"
|
---|
728 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
729 | cd "$gsdlhome"
|
---|
730 | msg="$itext24
|
---|
731 |
|
---|
732 | --> Install.sh: [./configure]"
|
---|
733 | echo "$msg"
|
---|
734 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
735 | ./configure
|
---|
736 | msg="$itext25
|
---|
737 |
|
---|
738 | --> Install.sh: [make]"
|
---|
739 | echo "$msg"
|
---|
740 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
741 | make
|
---|
742 | msg="$itext26
|
---|
743 |
|
---|
744 | --> Install.sh: [make install]"
|
---|
745 | echo "$msg"
|
---|
746 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
747 | make install
|
---|
748 | msg="--> Install.sh: [cd $thisdir]"
|
---|
749 | echo "$msg"
|
---|
750 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
751 | cd "$thisdir"
|
---|
752 |
|
---|
753 | # check that things compiled ok
|
---|
754 | if [ ! -f "${gsdlhome}/cgi-bin/library" ]; then
|
---|
755 | msg="$itext27
|
---|
756 | $itext0
|
---|
757 | $itext37"
|
---|
758 | echo "$msg"
|
---|
759 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
760 | exit 1
|
---|
761 | fi
|
---|
762 | fi
|
---|
763 |
|
---|
764 |
|
---|
765 | # try to find out hostname
|
---|
766 | if [ "$gsdlos" = "linux" ]; then
|
---|
767 | hostname=`hostname -f`
|
---|
768 | if [ "$hostname" = "" ]; then
|
---|
769 | hostname=`hostname -i`
|
---|
770 | fi
|
---|
771 | fi
|
---|
772 | if [ "$hostname" = "" ]; then
|
---|
773 | hostname=`hostname`
|
---|
774 | fi
|
---|
775 | if [ "$hostname" = "" ]; then
|
---|
776 | hostname="your-computer-name"
|
---|
777 | fi
|
---|
778 |
|
---|
779 |
|
---|
780 | # get cgi-bin directory
|
---|
781 | echo "$itext28"
|
---|
782 | echo "$itext28" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
783 | if [ "$logname" != "root" ]; then
|
---|
784 | echo "$itext29"
|
---|
785 | echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
786 | fi
|
---|
787 | echo "$itext30"
|
---|
788 | echo "$itext30" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
789 | if [ "$logname" != "root" ]; then
|
---|
790 | echo "$itext31"
|
---|
791 | echo "$itext31" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
792 | fi
|
---|
793 | found=no
|
---|
794 | remind_cgi="no"
|
---|
795 | remind_cgi_nomove="no"
|
---|
796 | while [ "$found" = "no" ]; do
|
---|
797 | echo "$itext32"
|
---|
798 | echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
799 | printf "%s" "> "
|
---|
800 | read ans
|
---|
801 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
802 | if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
|
---|
803 | found="option1"
|
---|
804 | cgi_bin="${gsdlhome}/cgi-bin"
|
---|
805 | # default gsdl cgi-bin, do nothing
|
---|
806 |
|
---|
807 | echo "$itext33"
|
---|
808 | echo "$itext33" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
809 | remind_cgi="yes"
|
---|
810 | elif [ "$ans" = "2" ]; then
|
---|
811 | found="option2"
|
---|
812 | # external cgi-bin
|
---|
813 |
|
---|
814 | echo "$itext34"
|
---|
815 | echo "$itext34" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
816 | printf "%s" "> "
|
---|
817 | read ans
|
---|
818 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
819 | if [ "$ans" = "" ]; then
|
---|
820 | cgi_bin="/usr/local/apache/cgi-bin"
|
---|
821 | else
|
---|
822 | cgi_bin="$ans"
|
---|
823 | fi
|
---|
824 |
|
---|
825 | itext35="Warning: The ${cgi_bin} directory does not exist.
|
---|
826 | Create it? [y]"
|
---|
827 |
|
---|
828 | itext36="Don't forget to configure your webserver to treat $cgi_bin
|
---|
829 | as a cgi executable directory. Don't worry, you'll be
|
---|
830 | reminded of this again at the end of the installation
|
---|
831 | procedure"
|
---|
832 |
|
---|
833 | itext38="ERROR: failed to create $cgi_bin directory"
|
---|
834 |
|
---|
835 | itext39="
|
---|
836 | Unable to write to $cgi_bin directory. You will need
|
---|
837 | to copy the contents of ${gsdlhome}/cgi-bin
|
---|
838 | to $cgi_bin after this installation is completed.
|
---|
839 | You'll be reminded of this again at the end of the
|
---|
840 | installation procedure."
|
---|
841 |
|
---|
842 | itext40="
|
---|
843 | Installing Greenstone cgi programs in $cgi_bin"
|
---|
844 |
|
---|
845 | if [ ! -d "$cgi_bin" ]; then
|
---|
846 |
|
---|
847 | echo "$itext35"
|
---|
848 | echo "$itext35" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
849 | printf "%s" "> "
|
---|
850 | read ans
|
---|
851 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
852 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
853 | msg="--> Install.sh: [$cmd_mkdir \"$cgi_bin\"]"
|
---|
854 | echo "$msg"
|
---|
855 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
856 | $cmd_mkdir "$cgi_bin"
|
---|
857 | if [ -d "$cgi_bin" ]; then
|
---|
858 | echo "$itext36"
|
---|
859 | echo "$itext36" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
860 | remind_cgi="yes"
|
---|
861 | else
|
---|
862 | msg="$itext38
|
---|
863 | $itext0
|
---|
864 | $itext37"
|
---|
865 | echo "$msg"
|
---|
866 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
867 | exit 1
|
---|
868 | fi
|
---|
869 | fi
|
---|
870 | fi
|
---|
871 |
|
---|
872 | if [ ! -w "$cgi_bin" ]; then
|
---|
873 | echo "$itext39"
|
---|
874 | echo "$itext39" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
875 | remind_cgi_nomove="yes"
|
---|
876 | else
|
---|
877 | # install cgi-bin stuff (update the uninstall script first)
|
---|
878 | cd "$gsdlhome"
|
---|
879 | echo "#!/bin/sh" > Uninstall.sh
|
---|
880 | echo "" >> Uninstall.sh
|
---|
881 | echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
|
---|
882 | echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
|
---|
883 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
884 | echo "read ans" >> Uninstall.sh
|
---|
885 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
886 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
887 | echo "fi" >> Uninstall.sh
|
---|
888 | $cmd_chmod u+x Uninstall.sh
|
---|
889 | cd "$thisdir"
|
---|
890 |
|
---|
891 | msg="$itext40
|
---|
892 | --> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/gsdlsite.cfg\" \"$cgi_bin\"]"
|
---|
893 | echo "$msg"
|
---|
894 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
895 | $cmd_mv "${gsdlhome}/cgi-bin/gsdlsite.cfg" "$cgi_bin"
|
---|
896 | msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/library\" \"$cgi_bin\"]"
|
---|
897 | echo "$msg"
|
---|
898 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
899 | $cmd_mv "${gsdlhome}/cgi-bin/library" "$cgi_bin"
|
---|
900 | fi
|
---|
901 | fi
|
---|
902 | done
|
---|
903 |
|
---|
904 | # web address of cgi-bin
|
---|
905 | web_cgi="http://${hostname}/cgi-bin"
|
---|
906 | if [ "$found" = "option1" ]; then
|
---|
907 | web_cgi="http://${hostname}/gsdl/cgi-bin"
|
---|
908 | fi
|
---|
909 |
|
---|
910 | itext41="
|
---|
911 | Please enter the web address of the $cgi_bin
|
---|
912 | directory. Typically this might be http://localhost/cgi-bin,
|
---|
913 | or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,
|
---|
914 | or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
|
---|
915 |
|
---|
916 | echo "$itext41"
|
---|
917 | echo "$itext41" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
918 | printf "%s" "> "
|
---|
919 | read ans
|
---|
920 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
921 | if [ "$ans" != "" ]; then
|
---|
922 | web_cgi="$ans"
|
---|
923 | fi
|
---|
924 |
|
---|
925 | # get public_html directory
|
---|
926 | echo "$itext42"
|
---|
927 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
928 | if [ "$logname" != "root" ]; then
|
---|
929 | echo "$itext29"
|
---|
930 | echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
931 | fi
|
---|
932 | echo "$itext43"
|
---|
933 | echo "$itext43" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
934 | if [ "$logname" != "root" ]; then
|
---|
935 | echo "$itext44"
|
---|
936 | echo "$itext44" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
937 | fi
|
---|
938 | echo "$itext45"
|
---|
939 | echo "$itext45" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
940 | found="no"
|
---|
941 | remind_ph="no"
|
---|
942 | remind_ph_nolink="no"
|
---|
943 | while [ "$found" = "no" ]; do
|
---|
944 | echo "$itext32"
|
---|
945 | echo "$itext32" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
946 | printf "%s" "> "
|
---|
947 | read ans
|
---|
948 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
949 | if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
|
---|
950 | found="yes"
|
---|
951 | public_html="$gsdlhome"
|
---|
952 | # no link
|
---|
953 | echo "$itext46"
|
---|
954 | echo "$itext46" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
955 | remind_ph="yes"
|
---|
956 | elif [ "$ans" = "2" ]; then
|
---|
957 | found="yes"
|
---|
958 | # external public_html
|
---|
959 | echo
|
---|
960 | public_html="/home/${logname}/public_html"
|
---|
961 | if [ "$logname" = "root" ]; then
|
---|
962 | public_html="/usr/local/apache/htdocs"
|
---|
963 | fi
|
---|
964 |
|
---|
965 | itext47="Enter directory that is also accessible from the web [${public_html}]"
|
---|
966 |
|
---|
967 | echo "$itext47"
|
---|
968 | echo "$itext47" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
969 | printf "%s" "> "
|
---|
970 | read ans
|
---|
971 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
972 | if [ "$ans" != "" ]; then
|
---|
973 | public_html="$ans"
|
---|
974 | fi
|
---|
975 |
|
---|
976 | itext48="
|
---|
977 | Unable to write to $public_html directory. You will need
|
---|
978 | to create a link called gsdl from $public_html to
|
---|
979 | $gsdlhome after this installation is completed. You'll be
|
---|
980 | reminded of this again at the end of the installation
|
---|
981 | procedure."
|
---|
982 |
|
---|
983 | # create link to gsdl (and update Uninstall.sh)
|
---|
984 | if [ -w "$public_html" ]; then
|
---|
985 | cd "$gsdlhome"
|
---|
986 | echo "#!/bin/sh" > Uninstall.sh
|
---|
987 | echo "" >> Uninstall.sh
|
---|
988 | echo "$cmd_rm \"$public_html/gsdl\"" >> Uninstall.sh
|
---|
989 | echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
|
---|
990 | echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
|
---|
991 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
992 | echo "read ans" >> Uninstall.sh
|
---|
993 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
994 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
995 | echo "fi" >> Uninstall.sh
|
---|
996 | $cmd_chmod u+x Uninstall.sh
|
---|
997 | cd "$thisdir"
|
---|
998 |
|
---|
999 | msg="--> Install.sh: [cd \"$public_html\"]"
|
---|
1000 | echo "$msg"
|
---|
1001 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1002 | cd "$public_html"
|
---|
1003 | msg="--> Install.sh: [$cmd_ln \"$gsdlhome\" gsdl]"
|
---|
1004 | echo "$msg"
|
---|
1005 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1006 | $cmd_ln "$gsdlhome" gsdl
|
---|
1007 | msg="--> Install.sh: [cd \"$thisdir\"]"
|
---|
1008 | echo "$msg"
|
---|
1009 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1010 | cd "$thisdir"
|
---|
1011 | else
|
---|
1012 | echo "$itext48"
|
---|
1013 | echo "$itext48" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1014 | old_ph=$public_html
|
---|
1015 | remind_ph_nolink="yes"
|
---|
1016 | fi
|
---|
1017 | public_html="${public_html}/gsdl"
|
---|
1018 | fi
|
---|
1019 | done
|
---|
1020 |
|
---|
1021 | itext49="
|
---|
1022 | Enter the web address of the $public_html directory.
|
---|
1023 | This may be a relative url (e.g. \"/gsdl\") or a
|
---|
1024 | complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
|
---|
1025 |
|
---|
1026 | itext50="
|
---|
1027 | In order to use end-user collection building or to access certain
|
---|
1028 | parts of the administration pages you must have a password.
|
---|
1029 | A user with the username \"admin\" will be created for you with
|
---|
1030 | the password you provide (i.e. to enter any pages requiring user
|
---|
1031 | authentication enter the \"admin\" username and the password you
|
---|
1032 | set here).
|
---|
1033 | "
|
---|
1034 |
|
---|
1035 | itext51="
|
---|
1036 |
|
---|
1037 | Greenstone installation completed successfully."
|
---|
1038 |
|
---|
1039 | itext52=" * Don't forget to configure your webserver to treat
|
---|
1040 | $cgi_bin as a cgi executable directory."
|
---|
1041 |
|
---|
1042 | itext53=" For the Apache webserver this means adding the following
|
---|
1043 | ScriptAlias directive to your httpd.conf configuration file."
|
---|
1044 |
|
---|
1045 | itext54=" * Don't forget to move the contents of ${gsdlhome}/cgi-bin
|
---|
1046 | to $cgi_bin
|
---|
1047 | "
|
---|
1048 |
|
---|
1049 | itext55=" * Don't forget to configure your webserver to treat
|
---|
1050 | $gsdlhome as a web accessible directory."
|
---|
1051 |
|
---|
1052 | itext56=" For the Apache webserver this means adding the following
|
---|
1053 | Alias directive to your httpd.conf configuration file."
|
---|
1054 |
|
---|
1055 | itext57=" * Don't forget to create a link called gsdl from $old_ph
|
---|
1056 | to ${gsdlhome}.
|
---|
1057 | "
|
---|
1058 |
|
---|
1059 | itext58="The output of this script has been recorded for you at
|
---|
1060 | ${gsdlhome}/INSTALL_RECORD.
|
---|
1061 | You may remove Greenstone from your system at any time by running
|
---|
1062 | the ${gsdlhome}/Uninstall.sh script.
|
---|
1063 | Access Greenstone by pointing a web browser at
|
---|
1064 | ${web_cgi}/library
|
---|
1065 | "
|
---|
1066 |
|
---|
1067 | # get httpprefix
|
---|
1068 | echo "$itext49"
|
---|
1069 | echo "$itext49" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1070 | printf "%s" ">"
|
---|
1071 | httpprefix="/gsdl"
|
---|
1072 | read ans
|
---|
1073 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1074 | if [ "$ans" != "" ]; then
|
---|
1075 | httpprefix="$ans"
|
---|
1076 | fi
|
---|
1077 |
|
---|
1078 | # get initial password
|
---|
1079 | echo "$itext50"
|
---|
1080 | echo "$itext50" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1081 | pw=`"${gsdlhome}/bin/${gsdlos}/getpw"`
|
---|
1082 | tmp="[admin]
|
---|
1083 | <comment>
|
---|
1084 | <enabled>true
|
---|
1085 | <groups>administrator,colbuilder
|
---|
1086 | <password>${pw}
|
---|
1087 | <username>admin
|
---|
1088 | ----------------------------------------------------------------------"
|
---|
1089 | echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
|
---|
1090 | $cmd_chmod a+rw "${gsdlhome}/etc/users.db"
|
---|
1091 |
|
---|
1092 | # edit gsdlsite.cfg
|
---|
1093 | cd "$cgi_bin"
|
---|
1094 | sed "s|\(gsdlhome *\)[^ ]*|\1\"${gsdlhome}\"|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1095 | sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1096 | sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1097 |
|
---|
1098 | # success
|
---|
1099 | echo "$itext51"
|
---|
1100 | echo "$itext51" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1101 | if [ "$remind_cgi" = "yes" ]; then
|
---|
1102 | echo "$itext52"
|
---|
1103 | echo "$itext52" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1104 |
|
---|
1105 | apache_web_cgi=`echo "$web_cgi" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
|
---|
1106 | cgi_bin_slash=`echo "$cgi_bin" | sed "s|/*$|/|"`
|
---|
1107 | cgi_bin_noslash=`echo "$cgi_bin" | sed "s|/*$||"`
|
---|
1108 |
|
---|
1109 | msg="$itext53
|
---|
1110 |
|
---|
1111 | ScriptAlias ${apache_web_cgi} \"${cgi_bin_slash}\"
|
---|
1112 | <Directory \"${cgi_bin_noslash}\">
|
---|
1113 | AllowOverride None
|
---|
1114 | Options None
|
---|
1115 | Order allow,deny
|
---|
1116 | Allow from all
|
---|
1117 | </Directory>
|
---|
1118 | "
|
---|
1119 | echo "$msg"
|
---|
1120 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1121 | fi
|
---|
1122 | if [ "$remind_cgi_nomove" = "yes" ]; then
|
---|
1123 | echo "$itext54"
|
---|
1124 | echo "$itext54" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1125 | fi
|
---|
1126 | if [ "$remind_ph" = "yes" ]; then
|
---|
1127 | echo "$itext55"
|
---|
1128 | echo "$itext55" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1129 |
|
---|
1130 | apache_httpprefix=`echo "$httpprefix" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
|
---|
1131 | public_html_slash=`echo "$public_html" | sed "s|/*$|/|"`
|
---|
1132 | public_html_noslash=`echo "$public_html" | sed "s|/*$||"`
|
---|
1133 |
|
---|
1134 | msg="$itext56
|
---|
1135 |
|
---|
1136 | Alias ${apache_httpprefix} \"${public_html_slash}\"
|
---|
1137 | <Directory \"${public_html_noslash}\">
|
---|
1138 | Options Indexes MultiViews FollowSymLinks
|
---|
1139 | AllowOverride None
|
---|
1140 | Order allow,deny
|
---|
1141 | Allow from all
|
---|
1142 | </Directory>
|
---|
1143 | "
|
---|
1144 | echo "$msg"
|
---|
1145 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1146 | fi
|
---|
1147 | if [ "$remind_ph_nolink" = "yes" ]; then
|
---|
1148 | echo "$itext57"
|
---|
1149 | echo "$itext57" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1150 | fi
|
---|
1151 | echo "$itext58"
|
---|
1152 | echo "$itext58" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1153 |
|
---|
1154 | exit 0
|
---|