1 | #!/bin/sh
|
---|
2 |
|
---|
3 | ## Install.sh -- Install Greenstone
|
---|
4 |
|
---|
5 |
|
---|
6 | # set iscdrom variable to "yes" for a cdrom installation
|
---|
7 | iscdrom="yes"
|
---|
8 |
|
---|
9 |
|
---|
10 | cmd_cp="cp"
|
---|
11 | cmd_cpr="cp -r"
|
---|
12 | cmd_chmod="chmod"
|
---|
13 | cmd_mkdir="mkdir -p"
|
---|
14 | cmd_ln="ln -s"
|
---|
15 | cmd_mv="mv"
|
---|
16 | cmd_rm="rm -i"
|
---|
17 | cmd_rmr="rm -r"
|
---|
18 |
|
---|
19 | thisdir=`pwd`
|
---|
20 | cd ..
|
---|
21 | cd_dir=`pwd`
|
---|
22 | cd "$thisdir"
|
---|
23 |
|
---|
24 | # script must be run from within cdrom/unix directory
|
---|
25 | if [ ! -f "${thisdir}/Install.sh" ]; then
|
---|
26 | echo "$itext1"
|
---|
27 | echo "$itext0"
|
---|
28 | exit 1
|
---|
29 | fi
|
---|
30 |
|
---|
31 | # check that various important directories are on the cd
|
---|
32 | if [ ! -d "${cd_dir}/gsdl" ]; then
|
---|
33 | echo
|
---|
34 | echo "${itext2}${cd_dir}/gsdl"
|
---|
35 | echo "$itext0"
|
---|
36 | exit 1
|
---|
37 | fi
|
---|
38 | if [ ! -d "${cd_dir}/Unix/bin/linux" ]; then
|
---|
39 | echo
|
---|
40 | echo "${itext2}${cd_dir}/Unix/bin/linux"
|
---|
41 | echo "$itext0"
|
---|
42 | exit 1
|
---|
43 | fi
|
---|
44 |
|
---|
45 | # install to /usr/local by default if user is "root", otherwise
|
---|
46 | # default to users home directory
|
---|
47 | gsdlos=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
|
---|
48 | if [ "$gsdlos" = "linux" ]; then
|
---|
49 | logname=`whoami`
|
---|
50 | else
|
---|
51 | logname=""
|
---|
52 | fi
|
---|
53 | if [ "$logname" = "" ]; then
|
---|
54 | logname=`logname`
|
---|
55 | fi
|
---|
56 | gsdlhome="/home/${logname}"
|
---|
57 | if [ "$logname" = "root" ]; then
|
---|
58 | gsdlhome="/usr/local"
|
---|
59 | fi
|
---|
60 |
|
---|
61 |
|
---|
62 | itext0="Greenstone was not installed"
|
---|
63 |
|
---|
64 | itext1="Install.sh must be run from the directory in which it resides"
|
---|
65 |
|
---|
66 | itext2="ERROR: Could not locate "
|
---|
67 |
|
---|
68 | itext3="This script will install Greenstone on your system. You may want
|
---|
69 | to skim through the Install.pdf document that resides in the docs
|
---|
70 | directory on this cd-rom before continuing with the installation."
|
---|
71 |
|
---|
72 | if [ $iscdrom = "no" ]; then
|
---|
73 | itext3="This script will install Greenstone on your system. You may
|
---|
74 | want to download and skim through the Greenstone Installer's Guide
|
---|
75 | (Install.pdf) before continuing with the installation"
|
---|
76 | fi
|
---|
77 |
|
---|
78 | itext3="$itext3
|
---|
79 | Note that when prompted for input, hitting \"enter\" will select
|
---|
80 | the default (given in square brackets [] at the end of each question).
|
---|
81 | If you're unsure which option to select, use the default.
|
---|
82 |
|
---|
83 | Note also that Install.sh prints out information on any commands
|
---|
84 | it runs on your system in the form \"--> Install.sh: [command]\".
|
---|
85 |
|
---|
86 | It is assumed throughout this installation procedure that you
|
---|
87 | have a webserver installed on your system.
|
---|
88 |
|
---|
89 | For later reference the output of this install script will be
|
---|
90 | recorded in a file called INSTALL_RECORD in the directory into
|
---|
91 | which you choose to install Greenstone.
|
---|
92 |
|
---|
93 | Continue? [y]"
|
---|
94 |
|
---|
95 | itext4="
|
---|
96 | Which directory should Greenstone be installed to?
|
---|
97 | Make sure that this directory is on a partition with sufficient
|
---|
98 | free disk space for the installation options you intend selecting."
|
---|
99 |
|
---|
100 | itext5="
|
---|
101 | * A linux binary installation requires approximately
|
---|
102 | 40Mb."
|
---|
103 |
|
---|
104 | itext6="
|
---|
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.
|
---|
113 | Enter directory to install Greenstone into. A gsdl directory
|
---|
114 | will be created in this directory. [${gsdlhome}]"
|
---|
115 |
|
---|
116 | itext34="
|
---|
117 | Enter existing cgi executable directory [/usr/local/apache/cgi-bin]"
|
---|
118 |
|
---|
119 | itext59="
|
---|
120 | This installation requires GNU make which could not be detected
|
---|
121 | on your system. Please enter the path to gnu make"
|
---|
122 |
|
---|
123 | echo "$itext3"
|
---|
124 | printf "%s" "> "
|
---|
125 | read ans
|
---|
126 | log="${log}${itext3}
|
---|
127 | > $ans
|
---|
128 | "
|
---|
129 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
130 | echo "$itext0"
|
---|
131 | exit 0
|
---|
132 | fi
|
---|
133 |
|
---|
134 | # check we've got gnu make (we assume gnu make will always be used on linux)
|
---|
135 | make="make"
|
---|
136 | if [ "$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
|
---|
152 | fi
|
---|
153 |
|
---|
154 | # get gsdlhome
|
---|
155 | msg="$itext4"
|
---|
156 | if [ "$gsdlos" = "linux" ]; then
|
---|
157 | msg="${msg}$itext5"
|
---|
158 | fi
|
---|
159 | msg="${msg}$itext6"
|
---|
160 | echo "$msg"
|
---|
161 | printf "%s" "> "
|
---|
162 | read ans
|
---|
163 | log="${log}${msg}
|
---|
164 | > $ans
|
---|
165 | "
|
---|
166 | if [ "$ans" != "" ]; then
|
---|
167 | gsdlhome="$ans"
|
---|
168 | fi
|
---|
169 |
|
---|
170 | itext7="
|
---|
171 | Warning: The ${gsdlhome} directory does not exist.
|
---|
172 | Create it? [y]"
|
---|
173 |
|
---|
174 | itext8="ERROR: failed to create $gsdlhome directory"
|
---|
175 |
|
---|
176 | if [ ! -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
|
---|
201 | fi
|
---|
202 |
|
---|
203 | # from now on $gsdlhome includes the "/gsdl"
|
---|
204 | gsdlhome="${gsdlhome}/gsdl"
|
---|
205 |
|
---|
206 | itext9="
|
---|
207 | If this installation fails or is cancelled, run the uninstall
|
---|
208 | script (${gsdlhome}/Uninstall.sh) to clean up the partial
|
---|
209 | installation.
|
---|
210 | Continue? [y]"
|
---|
211 |
|
---|
212 | itext10="
|
---|
213 | Installing Greenstone directory structure to ${gsdlhome}"
|
---|
214 |
|
---|
215 | itext11="
|
---|
216 | Would you like to install the Greenstone documentation to your
|
---|
217 | hard drive? The docs will use about 4Mb of space. If you choose
|
---|
218 | not to install them you can still access them from within the
|
---|
219 | docs directory of the cd-rom) [y]"
|
---|
220 |
|
---|
221 | itext12="
|
---|
222 | Would you like to install support for Greenstone's \"CD exporting\"
|
---|
223 | function? This function allows you to export a Greenstone collection
|
---|
224 | in a form suitable for writing to a self-installing Windows cd-rom.
|
---|
225 | This package will use approximately 23Mb of disk space [n]"
|
---|
226 |
|
---|
227 | itext13="
|
---|
228 | The Greenstone demonstration collection has been installed. Would you
|
---|
229 | like to install any other collections from the installation cd-rom? [y]
|
---|
230 | (note that only the built indexes will be installed for these
|
---|
231 | collections - if you require the original source documents you may
|
---|
232 | manually copy them from the \"collect\" directory of the cd-rom)"
|
---|
233 |
|
---|
234 | itext14="
|
---|
235 | Install the Greenstone mailing list archive (gsarch) - 3Mb? [y]"
|
---|
236 |
|
---|
237 | itext15="
|
---|
238 | Install the MSWord/PDF/RTF/Postscript demonstration collection (wordpdf) - 4Mb? [y]"
|
---|
239 |
|
---|
240 | itext16="
|
---|
241 | Install the Chinese demonstration collection (chinese) - 6Mb? [y]"
|
---|
242 |
|
---|
243 | itext17="
|
---|
244 | Install the Development Library subset (dls) - 130 Mb? [y]"
|
---|
245 |
|
---|
246 | itext18="Setting permissions ..."
|
---|
247 |
|
---|
248 | itext19="
|
---|
249 | In order for end-user collection building to be enabled the
|
---|
250 | Greenstone cgi program must be able to write to the
|
---|
251 | ${gsdlhome}/collect and ${gsdlhome}/tmp directories.
|
---|
252 | On most systems this means they must be globally writable.
|
---|
253 | Make these directories globally writable? [y]"
|
---|
254 |
|
---|
255 | itext20="
|
---|
256 | You may either install pre-compiled, statically linked linux [b]inaries
|
---|
257 | (i386 only) or install and [c]ompile the Greenstone source code"
|
---|
258 |
|
---|
259 | itext21="Enter \"[b]\" or \"c\""
|
---|
260 |
|
---|
261 | itext22="Installing linux binaries"
|
---|
262 |
|
---|
263 | itext23="Installing source code"
|
---|
264 |
|
---|
265 | itext24="configuring ..."
|
---|
266 |
|
---|
267 | itext25="compiling ..."
|
---|
268 |
|
---|
269 | itext26="installing ..."
|
---|
270 |
|
---|
271 | itext27="ERROR: Compilation failed"
|
---|
272 |
|
---|
273 | itext28="
|
---|
274 |
|
---|
275 | Greenstone needs a valid cgi executable directory (normally called
|
---|
276 | cgi-bin on unix systems) from which to run.
|
---|
277 | This 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 |
|
---|
285 | itext29=" Note that you will probably need help from your system
|
---|
286 | administrator to reconfigure your webserver."
|
---|
287 |
|
---|
288 | itext30=" 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 |
|
---|
293 | itext31=" Many systems also allow individual users to have their own
|
---|
294 | cgi-bin in /home/username/public_html/cgi-bin."
|
---|
295 |
|
---|
296 | itext32="Enter \"[1]\" or \"2\""
|
---|
297 |
|
---|
298 | itext33="
|
---|
299 | Don't forget to configure your webserver to treat ${gsdlhome}/cgi-bin
|
---|
300 | as a cgi executable directory. Don't worry, you'll be
|
---|
301 | reminded of this again at the end of the installation
|
---|
302 | procedure"
|
---|
303 |
|
---|
304 | itext37="Run the uninstall script (${gsdlhome}/Uninstall.sh)
|
---|
305 | to clean up the partial installation."
|
---|
306 |
|
---|
307 | itext42="
|
---|
308 |
|
---|
309 | In order for Greenstone to run, the $gsdlhome
|
---|
310 | directory and all it contains must be accessible from the web.
|
---|
311 | To make this happen you may either:
|
---|
312 | 1. Configure your webserver so that $gsdlhome
|
---|
313 | is itself accessible from the web."
|
---|
314 |
|
---|
315 | itext43=" 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 |
|
---|
323 | itext44=" Many systems also allow individual users to have their own
|
---|
324 | web accessible directory in /home/username/public_html."
|
---|
325 |
|
---|
326 | itext45=" 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 |
|
---|
332 | itext46="
|
---|
333 | Don't forget to configure your webserver to make $gsdlhome
|
---|
334 | accessible from the web. You'll be reminded of this again
|
---|
335 | at the end of this installation procedure."
|
---|
336 |
|
---|
337 |
|
---|
338 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}\"]"
|
---|
339 | echo "$msg"
|
---|
340 | log="${log}${msg}
|
---|
341 | "
|
---|
342 | $cmd_mkdir "$gsdlhome"
|
---|
343 | if [ ! -d "$gsdlhome" ]; then
|
---|
344 | echo "$itext8"
|
---|
345 | echo "$itext0"
|
---|
346 | exit 1
|
---|
347 | fi
|
---|
348 | # set permissions on gsdlhome directory
|
---|
349 | msg="--> Install.sh: [$cmd_chmod u+rwx \"${gsdlhome}\"]"
|
---|
350 | echo "$msg"
|
---|
351 | log="${log}${msg}
|
---|
352 | "
|
---|
353 | $cmd_chmod u+rwx "$gsdlhome"
|
---|
354 |
|
---|
355 | # create initial Uninstall.sh
|
---|
356 | cd "$gsdlhome"
|
---|
357 | echo "#!/bin/sh" > Uninstall.sh
|
---|
358 | echo "" >> Uninstall.sh
|
---|
359 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
360 | echo "read ans" >> Uninstall.sh
|
---|
361 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
362 | echo " $cmd_chmod -R u+rwx \"$gsdlhome\"" >> Uninstall.sh
|
---|
363 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
364 | echo "fi" >> Uninstall.sh
|
---|
365 | $cmd_chmod u+x Uninstall.sh
|
---|
366 | cd "$thisdir"
|
---|
367 |
|
---|
368 | # create initial INSTALL_RECORD
|
---|
369 | echo "$log" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
370 |
|
---|
371 | echo "$itext9"
|
---|
372 | echo "$itext9" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
373 | printf "%s" "> "
|
---|
374 | read ans
|
---|
375 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
376 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
377 | msg="$itext0"
|
---|
378 | echo "$msg"
|
---|
379 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
380 | exit 0
|
---|
381 | fi
|
---|
382 |
|
---|
383 | echo "$itext10"
|
---|
384 | echo "$itext10" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
385 |
|
---|
386 | # copy gsdl directory across
|
---|
387 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/gsdl/\"* \"$gsdlhome\"]"
|
---|
388 | echo "$msg"
|
---|
389 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
390 | $cmd_cpr "${cd_dir}/gsdl/"* "$gsdlhome"
|
---|
391 |
|
---|
392 | # copy setup shell scripts across too
|
---|
393 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Unix/setup.\"* \"$gsdlhome\"]"
|
---|
394 | echo "$msg"
|
---|
395 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
396 | $cmd_cp "${cd_dir}/src/Unix/setup."* "$gsdlhome"
|
---|
397 |
|
---|
398 | # make sure we have a tmp directory
|
---|
399 | if [ ! -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"
|
---|
404 | fi
|
---|
405 |
|
---|
406 | # make collect directory writable so we can install collections
|
---|
407 | msg="--> Install.sh: [$cmd_chmod u+rwx \"$gsdlhome/collect\"]"
|
---|
408 | echo "$msg"
|
---|
409 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
410 | $cmd_chmod u+rwx "$gsdlhome/collect"
|
---|
411 |
|
---|
412 | if [ $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
|
---|
610 | fi
|
---|
611 |
|
---|
612 | # set permissions
|
---|
613 | msg="
|
---|
614 | $itext18
|
---|
615 | --> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]
|
---|
616 | --> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/script/\"*]"
|
---|
617 | echo "$msg"
|
---|
618 | echo "$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
|
---|
623 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/error.txt\"]"
|
---|
624 | echo "$msg"
|
---|
625 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
626 | $cmd_chmod a+w "$gsdlhome/etc/error.txt"
|
---|
627 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/key.db\"]"
|
---|
628 | echo "$msg"
|
---|
629 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
630 | $cmd_chmod a+w "$gsdlhome/etc/key.db"
|
---|
631 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/users.db\"]"
|
---|
632 | echo "$msg"
|
---|
633 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
634 | $cmd_chmod a+w "$gsdlhome/etc/users.db"
|
---|
635 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/main.cfg\"]"
|
---|
636 | echo "$msg"
|
---|
637 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
638 | $cmd_chmod a+w "$gsdlhome/etc/main.cfg"
|
---|
639 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/history.db\"]"
|
---|
640 | echo "$msg"
|
---|
641 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
642 | $cmd_chmod a+w "$gsdlhome/etc/history.db"
|
---|
643 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/usage.txt\"]"
|
---|
644 | echo "$msg"
|
---|
645 | echo "$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?
|
---|
650 | echo "$itext19"
|
---|
651 | echo "$itext19" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
652 | printf "%s" "> "
|
---|
653 | read ans
|
---|
654 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
655 | if [ "$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"
|
---|
664 | fi
|
---|
665 |
|
---|
666 | # binaries or source code?
|
---|
667 | compile="yes"
|
---|
668 | if [ "$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_tgz}" "${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
|
---|
727 | fi
|
---|
728 |
|
---|
729 | if [ "$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
|
---|
803 | fi
|
---|
804 |
|
---|
805 |
|
---|
806 | # try to find out hostname
|
---|
807 | if [ "$gsdlos" = "linux" ]; then
|
---|
808 | hostname=`hostname -f`
|
---|
809 | if [ "$hostname" = "" ]; then
|
---|
810 | hostname=`hostname -i`
|
---|
811 | fi
|
---|
812 | fi
|
---|
813 | if [ "$hostname" = "" ]; then
|
---|
814 | hostname=`hostname`
|
---|
815 | fi
|
---|
816 | if [ "$hostname" = "" ]; then
|
---|
817 | hostname="your-computer-name"
|
---|
818 | fi
|
---|
819 |
|
---|
820 |
|
---|
821 | # get cgi-bin directory
|
---|
822 | echo "$itext28"
|
---|
823 | echo "$itext28" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
824 | if [ "$logname" != "root" ]; then
|
---|
825 | echo "$itext29"
|
---|
826 | echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
827 | fi
|
---|
828 | echo "$itext30"
|
---|
829 | echo "$itext30" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
830 | if [ "$logname" != "root" ]; then
|
---|
831 | echo "$itext31"
|
---|
832 | echo "$itext31" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
833 | fi
|
---|
834 | found=no
|
---|
835 | remind_cgi="no"
|
---|
836 | remind_cgi_nomove="no"
|
---|
837 | while [ "$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 |
|
---|
866 | itext35="Warning: The ${cgi_bin} directory does not exist.
|
---|
867 | Create it? [y]"
|
---|
868 |
|
---|
869 | itext36="Don't forget to configure your webserver to treat $cgi_bin
|
---|
870 | as a cgi executable directory. Don't worry, you'll be
|
---|
871 | reminded of this again at the end of the installation
|
---|
872 | procedure"
|
---|
873 |
|
---|
874 | itext38="ERROR: failed to create $cgi_bin directory"
|
---|
875 |
|
---|
876 | itext39="
|
---|
877 | Unable to write to $cgi_bin directory. You will need
|
---|
878 | to copy the contents of ${gsdlhome}/cgi-bin
|
---|
879 | to $cgi_bin after this installation is completed.
|
---|
880 | You'll be reminded of this again at the end of the
|
---|
881 | installation procedure."
|
---|
882 |
|
---|
883 | itext40="
|
---|
884 | Installing 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
|
---|
943 | done
|
---|
944 |
|
---|
945 | # web address of cgi-bin
|
---|
946 | web_cgi="http://${hostname}/cgi-bin"
|
---|
947 | if [ "$found" = "option1" ]; then
|
---|
948 | web_cgi="http://${hostname}/gsdl/cgi-bin"
|
---|
949 | fi
|
---|
950 |
|
---|
951 | itext41="
|
---|
952 | Please enter the web address of the $cgi_bin
|
---|
953 | directory. Typically this might be http://localhost/cgi-bin,
|
---|
954 | or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,
|
---|
955 | or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
|
---|
956 |
|
---|
957 | echo "$itext41"
|
---|
958 | echo "$itext41" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
959 | printf "%s" "> "
|
---|
960 | read ans
|
---|
961 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
962 | if [ "$ans" != "" ]; then
|
---|
963 | web_cgi="$ans"
|
---|
964 | fi
|
---|
965 |
|
---|
966 | # get public_html directory
|
---|
967 | echo "$itext42"
|
---|
968 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
969 | if [ "$logname" != "root" ]; then
|
---|
970 | echo "$itext29"
|
---|
971 | echo "$itext29" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
972 | fi
|
---|
973 | echo "$itext43"
|
---|
974 | echo "$itext43" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
975 | if [ "$logname" != "root" ]; then
|
---|
976 | echo "$itext44"
|
---|
977 | echo "$itext44" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
978 | fi
|
---|
979 | echo "$itext45"
|
---|
980 | echo "$itext45" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
981 | found="no"
|
---|
982 | remind_ph="no"
|
---|
983 | remind_ph_nolink="no"
|
---|
984 | while [ "$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 |
|
---|
1006 | itext47="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 |
|
---|
1017 | itext48="
|
---|
1018 | Unable to write to $public_html directory. You will need
|
---|
1019 | to create a link called gsdl from $public_html to
|
---|
1020 | $gsdlhome after this installation is completed. You'll be
|
---|
1021 | reminded of this again at the end of the installation
|
---|
1022 | procedure."
|
---|
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
|
---|
1060 | done
|
---|
1061 |
|
---|
1062 | itext49="
|
---|
1063 | Enter the web address of the $public_html directory.
|
---|
1064 | This may be a relative url (e.g. \"/gsdl\") or a
|
---|
1065 | complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
|
---|
1066 |
|
---|
1067 | itext50="
|
---|
1068 | In order to use end-user collection building or to access certain
|
---|
1069 | parts of the administration pages you must have a password.
|
---|
1070 | A user with the username \"admin\" will be created for you with
|
---|
1071 | the password you provide (i.e. to enter any pages requiring user
|
---|
1072 | authentication enter the \"admin\" username and the password you
|
---|
1073 | set here).
|
---|
1074 | "
|
---|
1075 |
|
---|
1076 | itext51="
|
---|
1077 |
|
---|
1078 | Greenstone installation completed successfully."
|
---|
1079 |
|
---|
1080 | itext52=" * Don't forget to configure your webserver to treat
|
---|
1081 | $cgi_bin as a cgi executable directory."
|
---|
1082 |
|
---|
1083 | itext53=" For the Apache webserver this means adding the following
|
---|
1084 | ScriptAlias directive to your httpd.conf configuration file."
|
---|
1085 |
|
---|
1086 | itext54=" * Don't forget to move the contents of ${gsdlhome}/cgi-bin
|
---|
1087 | to $cgi_bin
|
---|
1088 | "
|
---|
1089 |
|
---|
1090 | itext55=" * Don't forget to configure your webserver to treat
|
---|
1091 | $gsdlhome as a web accessible directory."
|
---|
1092 |
|
---|
1093 | itext56=" For the Apache webserver this means adding the following
|
---|
1094 | Alias directive to your httpd.conf configuration file."
|
---|
1095 |
|
---|
1096 | itext57=" * Don't forget to create a link called gsdl from $old_ph
|
---|
1097 | to ${gsdlhome}.
|
---|
1098 | "
|
---|
1099 |
|
---|
1100 | itext58="The output of this script has been recorded for you at
|
---|
1101 | ${gsdlhome}/INSTALL_RECORD.
|
---|
1102 | You may remove Greenstone from your system at any time by running
|
---|
1103 | the ${gsdlhome}/Uninstall.sh script.
|
---|
1104 | Access Greenstone by pointing a web browser at
|
---|
1105 | ${web_cgi}/library
|
---|
1106 | "
|
---|
1107 |
|
---|
1108 | # get httpprefix
|
---|
1109 | echo "$itext49"
|
---|
1110 | echo "$itext49" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1111 | printf "%s" ">"
|
---|
1112 | httpprefix="/gsdl"
|
---|
1113 | read ans
|
---|
1114 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1115 | if [ "$ans" != "" ]; then
|
---|
1116 | httpprefix="$ans"
|
---|
1117 | fi
|
---|
1118 |
|
---|
1119 | # get initial password
|
---|
1120 | echo "$itext50"
|
---|
1121 | echo "$itext50" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1122 | pw=`"${gsdlhome}/bin/${gsdlos}/getpw"`
|
---|
1123 | tmp="[admin]
|
---|
1124 | <comment>
|
---|
1125 | <enabled>true
|
---|
1126 | <groups>administrator,colbuilder
|
---|
1127 | <password>${pw}
|
---|
1128 | <username>admin
|
---|
1129 | ----------------------------------------------------------------------"
|
---|
1130 | echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
|
---|
1131 | $cmd_chmod a+rw "${gsdlhome}/etc/users.db"
|
---|
1132 |
|
---|
1133 | # edit gsdlsite.cfg
|
---|
1134 | cd "$cgi_bin"
|
---|
1135 | sed "s|\(gsdlhome *\)[^ ]*|\1\"${gsdlhome}\"|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1136 | sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1137 | sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
1138 |
|
---|
1139 | # success
|
---|
1140 | echo "$itext51"
|
---|
1141 | echo "$itext51" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1142 | if [ "$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"
|
---|
1162 | fi
|
---|
1163 | if [ "$remind_cgi_nomove" = "yes" ]; then
|
---|
1164 | echo "$itext54"
|
---|
1165 | echo "$itext54" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1166 | fi
|
---|
1167 | if [ "$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"
|
---|
1187 | fi
|
---|
1188 | if [ "$remind_ph_nolink" = "yes" ]; then
|
---|
1189 | echo "$itext57"
|
---|
1190 | echo "$itext57" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1191 | fi
|
---|
1192 | echo "$itext58"
|
---|
1193 | echo "$itext58" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
1194 |
|
---|
1195 | exit 0
|
---|