source: trunk/gsdl/Install.sh@ 3777

Last change on this file since 3777 was 3777, checked in by sjboddie, 21 years ago

Install.sh now attempts to detect the version of perl when installing
linux binaries and installs an alternative XML-Parser module if the
version is 5.8 or newer. We do this because modules compiled for older
perls are not binary compatible with 5.8.

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