| 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 "Install.sh must be run from the directory in which it resides"
|
---|
| 22 | echo "Greenstone was not installed"
|
---|
| 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 "ERROR: Could not locate ${cd_dir}/gsdl"
|
---|
| 30 | echo "Greenstone was not installed"
|
---|
| 31 | exit 1
|
---|
| 32 | fi
|
---|
| 33 | if [ ! -d "${cd_dir}/Unix/bin/linux" ]; then
|
---|
| 34 | echo
|
---|
| 35 | echo "ERROR: Could not locate ${cd_dir}/Unix/bin/linux"
|
---|
| 36 | echo "Greenstone was not installed"
|
---|
| 37 | exit 1
|
---|
| 38 | fi
|
---|
| 39 |
|
---|
| 40 |
|
---|
| 41 | # install to /usr/local by default if user is "root", otherwise
|
---|
| 42 | # default to users home directory
|
---|
| 43 | gsdlos=`uname | tr A-Z a-z`
|
---|
| 44 | if [ "$gsdlos" = "linux" ]; then
|
---|
| 45 | logname=`whoami`
|
---|
| 46 | else
|
---|
| 47 | logname=""
|
---|
| 48 | fi
|
---|
| 49 | if [ "$logname" = "" ]; then
|
---|
| 50 | logname=`logname`
|
---|
| 51 | fi
|
---|
| 52 | gsdlhome="/home/${logname}"
|
---|
| 53 | if [ "$logname" = "root" ]; then
|
---|
| 54 | gsdlhome="/usr/local"
|
---|
| 55 | fi
|
---|
| 56 |
|
---|
| 57 | # get gsdlhome
|
---|
| 58 | msg="This script will install Greenstone on your system. You may want
|
---|
| 59 | to skim through the Install.pdf document that resides in the docs
|
---|
| 60 | directory on this cd-rom before continuing with the installation.
|
---|
| 61 |
|
---|
| 62 | Note that when prompted for input, hitting \"enter\" will select
|
---|
| 63 | the default (given in square brackets [] at the end of each question).
|
---|
| 64 | If you're unsure which option to select, use the default.
|
---|
| 65 |
|
---|
| 66 | Note also that Install.sh prints out information on any commands
|
---|
| 67 | it runs on your system in the form \"--> Install.sh: [command]\".
|
---|
| 68 |
|
---|
| 69 | It is assumed throughout this installation procedure that you
|
---|
| 70 | have a webserver installed on your system.
|
---|
| 71 |
|
---|
| 72 | For later reference the output of this install script will be
|
---|
| 73 | recorded in a file called INSTALL_RECORD in the directory into
|
---|
| 74 | which you choose to install Greenstone.
|
---|
| 75 |
|
---|
| 76 | Continue? [y]"
|
---|
| 77 | echo "$msg"
|
---|
| 78 | printf "%s" "> "
|
---|
| 79 | read ans
|
---|
| 80 | log="${log}${msg}
|
---|
| 81 | > $ans
|
---|
| 82 | "
|
---|
| 83 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
| 84 | echo "Greenstone was not installed"
|
---|
| 85 | exit 0
|
---|
| 86 | fi
|
---|
| 87 |
|
---|
| 88 | msg="
|
---|
| 89 | Which directory should Greenstone be installed to?
|
---|
| 90 | Make sure that this directory is on a partition with sufficient
|
---|
| 91 | free disk space for the installation option you intend
|
---|
| 92 | selecting.
|
---|
| 93 | "
|
---|
| 94 | if [ "$gsdlos" = "linux" ]; then
|
---|
| 95 | msg="${msg}--A standard linux binary installation requires approximately
|
---|
| 96 | 50Mb of free disk space (not including additional collections).
|
---|
| 97 | "
|
---|
| 98 | fi
|
---|
| 99 | msg="${msg}--Compiling Greenstone from source code requires approximately
|
---|
| 100 | 155Mb of free disk space (not including additional collections).
|
---|
| 101 | --Optional Greenstone demonstration collections may require up
|
---|
| 102 | to 200Mb of free disk space (you'll be told the size of
|
---|
| 103 | individual collections before you install them)
|
---|
| 104 | Enter directory to install Greenstone into. A gsdl directory
|
---|
| 105 | will be created in this directory. [${gsdlhome}]"
|
---|
| 106 | echo "$msg"
|
---|
| 107 | printf "%s" "> "
|
---|
| 108 | read ans
|
---|
| 109 | log="${log}${msg}
|
---|
| 110 | > $ans
|
---|
| 111 | "
|
---|
| 112 | if [ "$ans" != "" ]; then
|
---|
| 113 | gsdlhome="$ans"
|
---|
| 114 | fi
|
---|
| 115 |
|
---|
| 116 | if [ ! -d "$gsdlhome" ]; then
|
---|
| 117 | msg="
|
---|
| 118 | Warning: The ${gsdlhome} directory does not exist.
|
---|
| 119 | Create it? [y]"
|
---|
| 120 | echo "$msg"
|
---|
| 121 | printf "%s" "> "
|
---|
| 122 | read ans
|
---|
| 123 | log="${log}${msg}
|
---|
| 124 | > $ans
|
---|
| 125 | "
|
---|
| 126 | if [ "$ans" = "" ]; then
|
---|
| 127 | ans="y"
|
---|
| 128 | fi
|
---|
| 129 | if [ "$ans" = "y" ]; then
|
---|
| 130 | msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome\"]"
|
---|
| 131 | echo "$msg"
|
---|
| 132 | log="${log}${msg}
|
---|
| 133 | "
|
---|
| 134 | $cmd_mkdir "$gsdlhome"
|
---|
| 135 | if [ ! -d "$gsdlhome" ]; then
|
---|
| 136 | echo "ERROR: failed to create $gsdlhome directory"
|
---|
| 137 | echo "Greenstone was not installed"
|
---|
| 138 | exit 1
|
---|
| 139 | fi
|
---|
| 140 | else
|
---|
| 141 | echo "Greenstone was not installed"
|
---|
| 142 | exit 0
|
---|
| 143 | fi
|
---|
| 144 | fi
|
---|
| 145 |
|
---|
| 146 | # from now on $gsdlhome includes the "/gsdl"
|
---|
| 147 | gsdlhome="${gsdlhome}/gsdl"
|
---|
| 148 | msg="--> Install.sh: [$cmd_mkdir \"${gsdlhome}\"]"
|
---|
| 149 | echo "$msg"
|
---|
| 150 | log="${log}${msg}
|
---|
| 151 | "
|
---|
| 152 | $cmd_mkdir "$gsdlhome"
|
---|
| 153 | if [ ! -d "$gsdlhome" ]; then
|
---|
| 154 | echo "ERROR: failed to create $gsdlhome directory"
|
---|
| 155 | echo "Greenstone was not installed"
|
---|
| 156 | exit 1
|
---|
| 157 | fi
|
---|
| 158 | # set permissions on gsdlhome directory
|
---|
| 159 | msg="--> Install.sh: [$cmd_chmod u+rwx \"${gsdlhome}\"]"
|
---|
| 160 | echo "$msg"
|
---|
| 161 | log="${log}${msg}
|
---|
| 162 | "
|
---|
| 163 | $cmd_chmod u+rwx "$gsdlhome"
|
---|
| 164 |
|
---|
| 165 | # create initial Uninstall.sh
|
---|
| 166 | cd "$gsdlhome"
|
---|
| 167 | echo "#!/bin/sh" > Uninstall.sh
|
---|
| 168 | echo "" >> Uninstall.sh
|
---|
| 169 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
| 170 | echo "read ans" >> Uninstall.sh
|
---|
| 171 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
| 172 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
| 173 | echo "fi" >> Uninstall.sh
|
---|
| 174 | $cmd_chmod u+x Uninstall.sh
|
---|
| 175 | cd "$thisdir"
|
---|
| 176 |
|
---|
| 177 | # create initial INSTALL_RECORD
|
---|
| 178 | echo "$log" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 179 |
|
---|
| 180 | msg="
|
---|
| 181 | If this installation fails or is cancelled, run the uninstall
|
---|
| 182 | script (${gsdlhome}/Uninstall.sh) to clean up the partial
|
---|
| 183 | installation.
|
---|
| 184 | Continue? [y]"
|
---|
| 185 | echo "$msg"
|
---|
| 186 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 187 | printf "%s" "> "
|
---|
| 188 | read ans
|
---|
| 189 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 190 | if [ "$ans" != "" ] && [ "$ans" != "y" ]; then
|
---|
| 191 | msg="Greenstone was not installed"
|
---|
| 192 | echo "$msg"
|
---|
| 193 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 194 | exit 0
|
---|
| 195 | fi
|
---|
| 196 |
|
---|
| 197 | msg="
|
---|
| 198 | Installing Greenstone directory structure to ${gsdlhome}"
|
---|
| 199 | echo "$msg"
|
---|
| 200 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 201 |
|
---|
| 202 | # copy gsdl directory across
|
---|
| 203 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/gsdl/\"* \"$gsdlhome\"]"
|
---|
| 204 | echo "$msg"
|
---|
| 205 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 206 | $cmd_cpr "${cd_dir}/gsdl/"* "$gsdlhome"
|
---|
| 207 |
|
---|
| 208 | # copy setup shell scripts across too
|
---|
| 209 | msg="--> Install.sh: [$cmd_cp \"${cd_dir}/src/Unix/setup.\"* \"$gsdlhome\"]"
|
---|
| 210 | echo "$msg"
|
---|
| 211 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 212 | $cmd_cp "${cd_dir}/src/Unix/setup."* "$gsdlhome"
|
---|
| 213 |
|
---|
| 214 | # and docs directory
|
---|
| 215 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/docs\" \"$gsdlhome\"]"
|
---|
| 216 | echo "$msg"
|
---|
| 217 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 218 | $cmd_cpr "${cd_dir}/docs" "$gsdlhome"
|
---|
| 219 |
|
---|
| 220 | # make sure we have a tmp directory
|
---|
| 221 | if [ ! -d "$gsdlhome/tmp" ]; then
|
---|
| 222 | msg="--> Install.sh: [$cmd_mkdir \"$gsdlhome/tmp\"]"
|
---|
| 223 | echo "$msg"
|
---|
| 224 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 225 | $cmd_mkdir "$gsdlhome/tmp"
|
---|
| 226 | fi
|
---|
| 227 |
|
---|
| 228 | # make collect directory writable so we can install collections
|
---|
| 229 | msg="--> Install.sh: [$cmd_chmod u+rwx \"$gsdlhome/collect\"]"
|
---|
| 230 | echo "$msg"
|
---|
| 231 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 232 | $cmd_chmod u+rwx "$gsdlhome/collect"
|
---|
| 233 |
|
---|
| 234 | # which collections do we want
|
---|
| 235 | cd "${cd_dir}/collect"
|
---|
| 236 |
|
---|
| 237 | msg="
|
---|
| 238 | The Greenstone demonstration collection has been installed. Would you
|
---|
| 239 | like to install any other collections from the installation cd-rom? [y]"
|
---|
| 240 | echo "$msg"
|
---|
| 241 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 242 | printf "%s" "> "
|
---|
| 243 | read ans
|
---|
| 244 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 245 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 246 |
|
---|
| 247 | msg="
|
---|
| 248 | Install the greenstone archive (gsarch) - 1Mb? [y]"
|
---|
| 249 | echo "$msg"
|
---|
| 250 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 251 | printf "%s" "> "
|
---|
| 252 | read ans
|
---|
| 253 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 254 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 255 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/gsarch\" \"${gsdlhome}/collect\"]"
|
---|
| 256 | echo "$msg"
|
---|
| 257 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 258 | $cmd_cpr "${cd_dir}/collect/gsarch" "${gsdlhome}/collect"
|
---|
| 259 | fi
|
---|
| 260 |
|
---|
| 261 | msg="
|
---|
| 262 | Install the MSWord and PDF demonstration collection (wordpdf) - 3Mb? [y]"
|
---|
| 263 | echo "$msg"
|
---|
| 264 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 265 | printf "%s" "> "
|
---|
| 266 | read ans
|
---|
| 267 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 268 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 269 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/wordpdf\" \"${gsdlhome}/collect\"]"
|
---|
| 270 | echo "$msg"
|
---|
| 271 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 272 | $cmd_cpr "${cd_dir}/collect/wordpdf" "${gsdlhome}/collect"
|
---|
| 273 | fi
|
---|
| 274 |
|
---|
| 275 | msg="
|
---|
| 276 | Install the Chinese demonstration collection (chinese) - 1Mb? [y]"
|
---|
| 277 | echo "$msg"
|
---|
| 278 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 279 | printf "%s" "> "
|
---|
| 280 | read ans
|
---|
| 281 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 282 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 283 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/chinese\" \"${gsdlhome}/collect\"]"
|
---|
| 284 | echo "$msg"
|
---|
| 285 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 286 | $cmd_cpr "${cd_dir}/collect/chinese" "${gsdlhome}/collect"
|
---|
| 287 | fi
|
---|
| 288 |
|
---|
| 289 | msg="
|
---|
| 290 | Install the food and nutrition library (fnl) - 175 Mb? [y]"
|
---|
| 291 | echo "$msg"
|
---|
| 292 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 293 | printf "%s" "> "
|
---|
| 294 | read ans
|
---|
| 295 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 296 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 297 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/fnl\" \"${gsdlhome}/collect\"]"
|
---|
| 298 | echo "$msg"
|
---|
| 299 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 300 | $cmd_cpr "${cd_dir}/collect/fnl" "${gsdlhome}/collect"
|
---|
| 301 | fi
|
---|
| 302 |
|
---|
| 303 | msg="
|
---|
| 304 | Install the language extraction demonstration collection (folktale) - 2Mb? [y]"
|
---|
| 305 | echo "$msg"
|
---|
| 306 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 307 | printf "%s" "> "
|
---|
| 308 | read ans
|
---|
| 309 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 310 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 311 | msg="--> Install.sh: [$cmd_cpr \"${cd_dir}/collect/folktale\" \"${gsdlhome}/collect\"]"
|
---|
| 312 | echo "$msg"
|
---|
| 313 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 314 | $cmd_cpr "${cd_dir}/collect/folktale" "${gsdlhome}/collect"
|
---|
| 315 | fi
|
---|
| 316 | fi
|
---|
| 317 |
|
---|
| 318 | # set permissions
|
---|
| 319 | msg="
|
---|
| 320 | Setting permissions ...
|
---|
| 321 | --> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
|
---|
| 322 | --> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/script/\"*]"
|
---|
| 323 | echo "$msg"
|
---|
| 324 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 325 | $cmd_chmod -R u+rw "$gsdlhome"
|
---|
| 326 | $cmd_chmod a+x "${gsdlhome}/bin/script/"*
|
---|
| 327 |
|
---|
| 328 | # certain files in gsdl/etc need to be globally writable
|
---|
| 329 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/errout.txt\"]"
|
---|
| 330 | echo "$msg"
|
---|
| 331 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 332 | $cmd_chmod a+w "$gsdlhome/etc/errout.txt"
|
---|
| 333 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/initout.txt\"]"
|
---|
| 334 | echo "$msg"
|
---|
| 335 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 336 | $cmd_chmod a+w "$gsdlhome/etc/initout.txt"
|
---|
| 337 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/key.db\"]"
|
---|
| 338 | echo "$msg"
|
---|
| 339 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 340 | $cmd_chmod a+w "$gsdlhome/etc/key.db"
|
---|
| 341 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/users.db\"]"
|
---|
| 342 | echo "$msg"
|
---|
| 343 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 344 | $cmd_chmod a+w "$gsdlhome/etc/users.db"
|
---|
| 345 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/main.cfg\"]"
|
---|
| 346 | echo "$msg"
|
---|
| 347 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 348 | $cmd_chmod a+w "$gsdlhome/etc/main.cfg"
|
---|
| 349 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/history.db\"]"
|
---|
| 350 | echo "$msg"
|
---|
| 351 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 352 | $cmd_chmod a+w "$gsdlhome/etc/history.db"
|
---|
| 353 | msg="--> Install.sh: [$cmd_chmod a+w \"$gsdlhome/etc/usage.txt\"]"
|
---|
| 354 | echo "$msg"
|
---|
| 355 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 356 | $cmd_chmod a+w "$gsdlhome/etc/usage.txt"
|
---|
| 357 |
|
---|
| 358 |
|
---|
| 359 | # should gsdl/collect and gsdl/tmp be globally writable?
|
---|
| 360 | msg="
|
---|
| 361 | In order for end-user collection building to be enabled the
|
---|
| 362 | Greenstone cgi program must be able to write to the
|
---|
| 363 | ${gsdlhome}/collect and ${gsdlhome}/tmp directories.
|
---|
| 364 | On most systems this means they must be globally writable.
|
---|
| 365 | Make these directories globally writable? [y]"
|
---|
| 366 | echo "$msg"
|
---|
| 367 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 368 | printf "%s" "> "
|
---|
| 369 | read ans
|
---|
| 370 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 371 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 372 | msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/collect\"]"
|
---|
| 373 | echo "$msg"
|
---|
| 374 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 375 | $cmd_chmod -R a+w "$gsdlhome/collect"
|
---|
| 376 | msg="--> Install.sh: [$cmd_chmod -R a+w \"$gsdlhome/tmp\"]"
|
---|
| 377 | echo "$msg"
|
---|
| 378 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 379 | $cmd_chmod -R a+w "$gsdlhome/tmp"
|
---|
| 380 | fi
|
---|
| 381 |
|
---|
| 382 | # binaries or source code?
|
---|
| 383 | compile="yes"
|
---|
| 384 | if [ "$gsdlos" = "linux" ]; then
|
---|
| 385 | msg="
|
---|
| 386 | You may either install pre-compiled, statically linked linux [b]inaries
|
---|
| 387 | (i386 only) or install and [c]ompile the Greenstone source code"
|
---|
| 388 | echo "$msg"
|
---|
| 389 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 390 |
|
---|
| 391 | found=no
|
---|
| 392 | while [ "$found" = "no" ]; do
|
---|
| 393 | msg="Enter \"[b]\" or \"c\""
|
---|
| 394 | echo "$msg"
|
---|
| 395 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 396 | printf "%s" "> "
|
---|
| 397 | read ans
|
---|
| 398 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 399 | if [ "$ans" = "" ] || [ "$ans" = "b" ]; then
|
---|
| 400 | compile="no"
|
---|
| 401 | # install binaries
|
---|
| 402 | msg="
|
---|
| 403 | Installing linux binaries
|
---|
| 404 | --> Install.sh: [$cmd_cpr \"${cd_dir}/Unix/bin/linux\" \"${gsdlhome}/bin\" ]"
|
---|
| 405 | echo "$msg"
|
---|
| 406 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 407 | $cmd_cpr "${cd_dir}/Unix/bin/linux" "${gsdlhome}/bin"
|
---|
| 408 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/bin/linux/\"*]"
|
---|
| 409 | echo "$msg"
|
---|
| 410 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 411 | $cmd_chmod a+x "${gsdlhome}/bin/linux/"*
|
---|
| 412 | msg="--> Install.sh: [$cmd_chmod -R u+rw \"${gsdlhome}/bin/linux\"]"
|
---|
| 413 | echo "$msg"
|
---|
| 414 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 415 | $cmd_chmod -R u+rw "${gsdlhome}/bin/linux"
|
---|
| 416 |
|
---|
| 417 | # move library executable to cgi-bin
|
---|
| 418 | msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/bin/linux/library\" \"${gsdlhome}/cgi-bin\"]"
|
---|
| 419 | echo "$msg"
|
---|
| 420 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 421 | $cmd_mv "${gsdlhome}/bin/linux/library" "${gsdlhome}/cgi-bin"
|
---|
| 422 |
|
---|
| 423 | found="yes"
|
---|
| 424 | elif [ "$ans" = "c" ]; then
|
---|
| 425 | found="yes"
|
---|
| 426 | fi
|
---|
| 427 | done
|
---|
| 428 | fi
|
---|
| 429 |
|
---|
| 430 | if [ "$compile" = "yes" ]; then
|
---|
| 431 | # install source
|
---|
| 432 | msg="
|
---|
| 433 | Installing source code
|
---|
| 434 | --> Install.sh [$cmd_cpr \"${cd_dir}/src/lib\" \"$gsdlhome\"]"
|
---|
| 435 | echo "$msg"
|
---|
| 436 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 437 | $cmd_cpr "${cd_dir}/src/lib" "$gsdlhome"
|
---|
| 438 | msg="--> Install.sh [$cmd_cpr \"${cd_dir}/src/packages\" \"$gsdlhome\"]"
|
---|
| 439 | echo "$msg"
|
---|
| 440 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 441 | $cmd_cpr "${cd_dir}/src/packages" "$gsdlhome"
|
---|
| 442 | msg="--> Install.sh [$cmd_cpr \"${cd_dir}/src/src\" \"$gsdlhome\"]"
|
---|
| 443 | echo "$msg"
|
---|
| 444 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 445 | $cmd_cpr "${cd_dir}/src/src" "$gsdlhome"
|
---|
| 446 | msg="--> Install.sh [$cmd_cpr \"${cd_dir}/src/Unix/\"* \"$gsdlhome\"]"
|
---|
| 447 | echo "$msg"
|
---|
| 448 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 449 | $cmd_cpr "${cd_dir}/src/Unix/"* "$gsdlhome"
|
---|
| 450 | msg="--> Install.sh [$cmd_cp \"${cd_dir}/src/Install.txt\" \"$gsdlhome\"]"
|
---|
| 451 | echo "$msg"
|
---|
| 452 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 453 | $cmd_cp "${cd_dir}/src/Install.txt" "$gsdlhome"
|
---|
| 454 | msg="--> Install.sh: [$cmd_chmod -R u+rw \"$gsdlhome\"]"
|
---|
| 455 | echo "$msg"
|
---|
| 456 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 457 | $cmd_chmod -R u+rw "$gsdlhome"
|
---|
| 458 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/configure\"]"
|
---|
| 459 | echo "$msg"
|
---|
| 460 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 461 | $cmd_chmod a+x "${gsdlhome}/configure"
|
---|
| 462 | msg="--> Install.sh: [$cmd_chmod a+x \"${gsdlhome}/packages/yaz/configure\"]"
|
---|
| 463 | echo "$msg"
|
---|
| 464 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 465 | $cmd_chmod a+x "${gsdlhome}/packages/yaz/configure"
|
---|
| 466 |
|
---|
| 467 | # compile it
|
---|
| 468 | msg="--> Install.sh: [cd $gsdlhome]"
|
---|
| 469 | echo "$msg"
|
---|
| 470 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 471 | cd "$gsdlhome"
|
---|
| 472 | msg="configuring ...
|
---|
| 473 |
|
---|
| 474 | --> Install.sh: [./configure]"
|
---|
| 475 | echo "$msg"
|
---|
| 476 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 477 | ./configure
|
---|
| 478 | msg="compiling ...
|
---|
| 479 |
|
---|
| 480 | --> Install.sh: [make]"
|
---|
| 481 | echo "$msg"
|
---|
| 482 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 483 | make
|
---|
| 484 | msg="installing ...
|
---|
| 485 |
|
---|
| 486 | --> Install.sh: [make install]"
|
---|
| 487 | echo "$msg"
|
---|
| 488 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 489 | make install
|
---|
| 490 | msg="--> Install.sh: [cd $thisdir]"
|
---|
| 491 | echo "$msg"
|
---|
| 492 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 493 | cd "$thisdir"
|
---|
| 494 |
|
---|
| 495 | # check that things compiled ok
|
---|
| 496 | if [ ! -f "${gsdlhome}/cgi-bin/library" ]; then
|
---|
| 497 | msg="
|
---|
| 498 | ERROR: Compilation failed
|
---|
| 499 | Greenstone was not installed successfully
|
---|
| 500 | Run the uninstall script (${gsdlhome}/Uninstall.sh)
|
---|
| 501 | to clean up the partial installation."
|
---|
| 502 | echo "$msg"
|
---|
| 503 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 504 | exit 1
|
---|
| 505 | fi
|
---|
| 506 | fi
|
---|
| 507 |
|
---|
| 508 |
|
---|
| 509 | # try to find out hostname
|
---|
| 510 | if [ "$gsdlos" = "linux" ]; then
|
---|
| 511 | hostname=`hostname -f`
|
---|
| 512 | if [ "$hostname" = "" ]; then
|
---|
| 513 | hostname=`hostname -i`
|
---|
| 514 | fi
|
---|
| 515 | fi
|
---|
| 516 | if [ "$hostname" = "" ]; then
|
---|
| 517 | hostname=`hostname`
|
---|
| 518 | fi
|
---|
| 519 | if [ "$hostname" = "" ]; then
|
---|
| 520 | hostname="your-computer-name"
|
---|
| 521 | fi
|
---|
| 522 |
|
---|
| 523 |
|
---|
| 524 | # get cgi-bin directory
|
---|
| 525 | msg="
|
---|
| 526 |
|
---|
| 527 | Greenstone needs a valid cgi executable directory (normally called
|
---|
| 528 | cgi-bin on unix systems) from which to run.
|
---|
| 529 | This may be either:
|
---|
| 530 | 1. The default Greenstone cgi-bin directory (${gsdlhome}/cgi-bin).
|
---|
| 531 | If you use the Greenstone default you will need to configure
|
---|
| 532 | your webserver to treat this directory as a cgi executable
|
---|
| 533 | directory. For the Apache webserver you use the ScriptAlias
|
---|
| 534 | directive to do this (details of how to configure your webserver
|
---|
| 535 | will be displayed at the end of this installation procedure)."
|
---|
| 536 | echo "$msg"
|
---|
| 537 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 538 | if [ "$logname" != "root" ]; then
|
---|
| 539 | msg=" Note that you will probably need help from your system
|
---|
| 540 | administrator to reconfigure your webserver."
|
---|
| 541 | echo "$msg"
|
---|
| 542 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 543 | fi
|
---|
| 544 | msg=" 2. An existing cgi-bin directory. Normally a cgi-bin directory
|
---|
| 545 | is created when your webserver is installed. Typically, this
|
---|
| 546 | might be /home/httpd/cgi-bin, or /usr/local/apache/cgi-bin, or
|
---|
| 547 | /var/lib/apache/cgi-bin."
|
---|
| 548 | echo "$msg"
|
---|
| 549 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 550 | if [ "$logname" != "root" ]; then
|
---|
| 551 | msg=" Many systems also allow individual users to have their own
|
---|
| 552 | cgi-bin in /home/username/public_html/cgi-bin."
|
---|
| 553 | echo "$msg"
|
---|
| 554 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 555 | fi
|
---|
| 556 | found=no
|
---|
| 557 | remind_cgi="no"
|
---|
| 558 | remind_cgi_nomove="no"
|
---|
| 559 | while [ "$found" = "no" ]; do
|
---|
| 560 | msg="Enter \"[1]\" or \"2\""
|
---|
| 561 | echo "$msg"
|
---|
| 562 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 563 | printf "%s" "> "
|
---|
| 564 | read ans
|
---|
| 565 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 566 | if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
|
---|
| 567 | found="option1"
|
---|
| 568 | cgi_bin="${gsdlhome}/cgi-bin"
|
---|
| 569 | # default gsdl cgi-bin, do nothing
|
---|
| 570 | msg="
|
---|
| 571 | Don't forget to configure your webserver to treat $cgi_bin
|
---|
| 572 | as a cgi executable directory. Don't worry, you'll be
|
---|
| 573 | reminded of this again at the end of the installation
|
---|
| 574 | procedure"
|
---|
| 575 | echo "$msg"
|
---|
| 576 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 577 | remind_cgi="yes"
|
---|
| 578 | elif [ "$ans" = "2" ]; then
|
---|
| 579 | found="option2"
|
---|
| 580 | # external cgi-bin
|
---|
| 581 | msg="
|
---|
| 582 | Enter existing cgi executable directory [/usr/local/apache/cgi-bin]"
|
---|
| 583 | echo "$msg"
|
---|
| 584 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 585 | printf "%s" "> "
|
---|
| 586 | read ans
|
---|
| 587 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 588 | if [ "$ans" = "" ]; then
|
---|
| 589 | cgi_bin="/usr/local/apache/cgi-bin"
|
---|
| 590 | else
|
---|
| 591 | cgi_bin="$ans"
|
---|
| 592 | fi
|
---|
| 593 | if [ ! -d "$cgi_bin" ]; then
|
---|
| 594 | msg="Warning: The ${cgi_bin} directory does not exist.
|
---|
| 595 | Create it? [y]"
|
---|
| 596 | echo "$msg"
|
---|
| 597 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 598 | printf "%s" "> "
|
---|
| 599 | read ans
|
---|
| 600 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 601 | if [ "$ans" = "" ] || [ "$ans" = "y" ]; then
|
---|
| 602 | msg="--> Install.sh: [$cmd_mkdir \"$cgi_bin\"]"
|
---|
| 603 | echo "$msg"
|
---|
| 604 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 605 | $cmd_mkdir "$cgi_bin"
|
---|
| 606 | if [ -d "$cgi_bin" ]; then
|
---|
| 607 | msg="Don't forget to configure your webserver to treat $cgi_bin
|
---|
| 608 | as a cgi executable directory. Don't worry, you'll be
|
---|
| 609 | reminded of this again at the end of the installation
|
---|
| 610 | procedure"
|
---|
| 611 | echo "$msg"
|
---|
| 612 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 613 | remind_cgi="yes"
|
---|
| 614 | else
|
---|
| 615 | msg="ERROR: failed to create $cgi_bin directory
|
---|
| 616 | Greenstone installation failed.
|
---|
| 617 | Run the uninstall script (${gsdlhome}/Uninstall.sh)
|
---|
| 618 | to clean up the partial installation."
|
---|
| 619 | echo "$msg"
|
---|
| 620 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 621 | exit 1
|
---|
| 622 | fi
|
---|
| 623 | fi
|
---|
| 624 | fi
|
---|
| 625 |
|
---|
| 626 | if [ ! -w "$cgi_bin" ]; then
|
---|
| 627 | msg="
|
---|
| 628 | Unable to write to $cgi_bin directory. You will need
|
---|
| 629 | to copy the contents of ${gsdlhome}/cgi-bin
|
---|
| 630 | to $cgi_bin after this installation is completed.
|
---|
| 631 | You'll be reminded of this again at the end of the
|
---|
| 632 | installation procedure."
|
---|
| 633 | echo "$msg"
|
---|
| 634 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 635 | remind_cgi_nomove="yes"
|
---|
| 636 | else
|
---|
| 637 | # install cgi-bin stuff (update the uninstall script first)
|
---|
| 638 | cd "$gsdlhome"
|
---|
| 639 | echo "#!/bin/sh" > Uninstall.sh
|
---|
| 640 | echo "" >> Uninstall.sh
|
---|
| 641 | echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
|
---|
| 642 | echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
|
---|
| 643 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
| 644 | echo "read ans" >> Uninstall.sh
|
---|
| 645 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
| 646 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
| 647 | echo "fi" >> Uninstall.sh
|
---|
| 648 | $cmd_chmod u+x Uninstall.sh
|
---|
| 649 | cd "$thisdir"
|
---|
| 650 |
|
---|
| 651 | msg="
|
---|
| 652 | Installing Greenstone cgi programs in $cgi_bin
|
---|
| 653 | --> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/gsdlsite.cfg\" \"$cgi_bin\"]"
|
---|
| 654 | echo "$msg"
|
---|
| 655 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 656 | $cmd_mv "${gsdlhome}/cgi-bin/gsdlsite.cfg" "$cgi_bin"
|
---|
| 657 | msg="--> Install.sh: [$cmd_mv \"${gsdlhome}/cgi-bin/library\" \"$cgi_bin\"]"
|
---|
| 658 | echo "$msg"
|
---|
| 659 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 660 | $cmd_mv "${gsdlhome}/cgi-bin/library" "$cgi_bin"
|
---|
| 661 | fi
|
---|
| 662 | fi
|
---|
| 663 | done
|
---|
| 664 |
|
---|
| 665 | # web address of cgi-bin
|
---|
| 666 | web_cgi="http://${hostname}/cgi-bin"
|
---|
| 667 | if [ "$found" = "option1" ]; then
|
---|
| 668 | web_cgi="http://${hostname}/gsdl/cgi-bin"
|
---|
| 669 | fi
|
---|
| 670 | msg="
|
---|
| 671 | Please enter the web address of the $cgi_bin
|
---|
| 672 | directory. Typically this might be http://localhost/cgi-bin,
|
---|
| 673 | or http://127.0.0.1/cgi-bin, or http://your-computer-name/cgi-bin,
|
---|
| 674 | or http://nnn.nnn.nnn.nn/cgi-bin. [$web_cgi]"
|
---|
| 675 | echo "$msg"
|
---|
| 676 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 677 | printf "%s" "> "
|
---|
| 678 | read ans
|
---|
| 679 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 680 | if [ "$ans" != "" ]; then
|
---|
| 681 | web_cgi="$ans"
|
---|
| 682 | fi
|
---|
| 683 |
|
---|
| 684 | # get public_html directory
|
---|
| 685 | msg="
|
---|
| 686 |
|
---|
| 687 | In order for Greenstone to run, the $gsdlhome
|
---|
| 688 | directory and all it contains must be accessible from the web.
|
---|
| 689 | To make this happen you may either:
|
---|
| 690 | 1. Configure your webserver so that $gsdlhome
|
---|
| 691 | is itself accessible from the web."
|
---|
| 692 | echo "$msg"
|
---|
| 693 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 694 | if [ "$logname" != "root" ]; then
|
---|
| 695 | msg=" Note that you will probably need help from your system
|
---|
| 696 | administrator to reconfigure your webserver."
|
---|
| 697 | echo "$msg"
|
---|
| 698 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 699 | fi
|
---|
| 700 | msg=" 2. Provide an existing web accessible directory from which
|
---|
| 701 | a symbolic link (ln -s) will be made to $gsdlhome.
|
---|
| 702 | When your server was installed a web accessible directory
|
---|
| 703 | will have been created (the Apache webserver uses the
|
---|
| 704 | DocumentRoot directive to define this directory). Typically
|
---|
| 705 | this directory might be /home/httpd/html, or /usr/local/apache/htdocs,
|
---|
| 706 | or /var/lib/apache/htdocs."
|
---|
| 707 | echo "$msg"
|
---|
| 708 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 709 | if [ "$logname" != "root" ]; then
|
---|
| 710 | msg=" Many systems also allow individual users to have their own
|
---|
| 711 | web accessible directory in /home/username/public_html."
|
---|
| 712 | echo "$msg"
|
---|
| 713 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 714 | fi
|
---|
| 715 | msg=" Note that your web server will need to be configured to allow
|
---|
| 716 | symbolic links from within this directory. For the Apache
|
---|
| 717 | server that means this directory must be configured with
|
---|
| 718 | the SymLinksIfOwnerMatch or FollowSymLinks option (most Apache
|
---|
| 719 | installations are configured this way by default)."
|
---|
| 720 | echo "$msg"
|
---|
| 721 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 722 | found="no"
|
---|
| 723 | remind_ph="no"
|
---|
| 724 | remind_ph_nolink="no"
|
---|
| 725 | while [ "$found" = "no" ]; do
|
---|
| 726 | msg="Enter \"[1]\" or \"2\""
|
---|
| 727 | echo "$msg"
|
---|
| 728 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 729 | printf "%s" "> "
|
---|
| 730 | read ans
|
---|
| 731 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 732 | if [ "$ans" = "" ] || [ "$ans" = "1" ]; then
|
---|
| 733 | found="yes"
|
---|
| 734 | public_html="$gsdlhome"
|
---|
| 735 | # no link
|
---|
| 736 | msg="
|
---|
| 737 | Don't forget to configure your webserver to make $gsdlhome
|
---|
| 738 | accessible from the web. You'll be reminded of this again
|
---|
| 739 | at the end of this installation procedure."
|
---|
| 740 | echo "$msg"
|
---|
| 741 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 742 | remind_ph="yes"
|
---|
| 743 | elif [ "$ans" = "2" ]; then
|
---|
| 744 | found="yes"
|
---|
| 745 | # external public_html
|
---|
| 746 | echo
|
---|
| 747 | public_html="/home/${logname}/public_html"
|
---|
| 748 | if [ "$logname" = "root" ]; then
|
---|
| 749 | public_html="/usr/local/apache/htdocs"
|
---|
| 750 | fi
|
---|
| 751 | msg="Enter directory that is also accessible from the web [${public_html}]"
|
---|
| 752 | echo "$msg"
|
---|
| 753 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 754 | printf "%s" "> "
|
---|
| 755 | read ans
|
---|
| 756 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 757 | if [ "$ans" != "" ]; then
|
---|
| 758 | public_html="$ans"
|
---|
| 759 | fi
|
---|
| 760 | # create link to gsdl (and update Uninstall.sh)
|
---|
| 761 | if [ -w "$public_html" ]; then
|
---|
| 762 | cd "$gsdlhome"
|
---|
| 763 | echo "#!/bin/sh" > Uninstall.sh
|
---|
| 764 | echo "" >> Uninstall.sh
|
---|
| 765 | echo "$cmd_rm \"$public_html/gsdl\"" >> Uninstall.sh
|
---|
| 766 | echo "$cmd_rm \"${cgi_bin}/gsdlsite.cfg\"" >> Uninstall.sh
|
---|
| 767 | echo "$cmd_rm \"${cgi_bin}/library\"" >> Uninstall.sh
|
---|
| 768 | echo "echo \"remove ${gsdlhome} directory? [y]\"" >> Uninstall.sh
|
---|
| 769 | echo "read ans" >> Uninstall.sh
|
---|
| 770 | echo "if [ \"\$ans\" = \"\" ] || [ \"\$ans\" = \"y\" ]; then" >> Uninstall.sh
|
---|
| 771 | echo " $cmd_rmr \"$gsdlhome\"" >> Uninstall.sh
|
---|
| 772 | echo "fi" >> Uninstall.sh
|
---|
| 773 | $cmd_chmod u+x Uninstall.sh
|
---|
| 774 | cd "$thisdir"
|
---|
| 775 |
|
---|
| 776 | msg="--> Install.sh: [cd \"$public_html\"]"
|
---|
| 777 | echo "$msg"
|
---|
| 778 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 779 | cd "$public_html"
|
---|
| 780 | msg="--> Install.sh: [$cmd_ln \"$gsdlhome\" gsdl]"
|
---|
| 781 | echo "$msg"
|
---|
| 782 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 783 | $cmd_ln "$gsdlhome" gsdl
|
---|
| 784 | msg="--> Install.sh: [cd \"$thisdir\"]"
|
---|
| 785 | echo "$msg"
|
---|
| 786 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 787 | cd "$thisdir"
|
---|
| 788 | else
|
---|
| 789 | msg="
|
---|
| 790 | Unable to write to $public_html directory. You will need
|
---|
| 791 | to create a link called gsdl from $public_html to
|
---|
| 792 | $gsdlhome after this installation is completed. You'll be
|
---|
| 793 | reminded of this again at the end of the installation
|
---|
| 794 | procedure."
|
---|
| 795 | echo "$msg"
|
---|
| 796 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 797 | old_ph=$public_html
|
---|
| 798 | remind_ph_nolink="yes"
|
---|
| 799 | fi
|
---|
| 800 | public_html="${public_html}/gsdl"
|
---|
| 801 | fi
|
---|
| 802 | done
|
---|
| 803 |
|
---|
| 804 |
|
---|
| 805 | # get httpprefix
|
---|
| 806 | msg="
|
---|
| 807 | Enter the web address of the $public_html directory.
|
---|
| 808 | This may be a relative url (e.g. \"/gsdl\") or a
|
---|
| 809 | complete url (e.g. \"http://${hostname}/gsdl\") [/gsdl]"
|
---|
| 810 | echo "$msg"
|
---|
| 811 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 812 | printf "%s" ">"
|
---|
| 813 | httpprefix="/gsdl"
|
---|
| 814 | read ans
|
---|
| 815 | echo "> $ans" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 816 | if [ "$ans" != "" ]; then
|
---|
| 817 | httpprefix="$ans"
|
---|
| 818 | fi
|
---|
| 819 |
|
---|
| 820 | # get initial password
|
---|
| 821 | msg="
|
---|
| 822 | In order to use end-user collection building or to access certain
|
---|
| 823 | parts of the administration pages you must have a password.
|
---|
| 824 | A user with the username \"admin\" will be created for you with
|
---|
| 825 | the password you provide (i.e. to enter any pages requiring user
|
---|
| 826 | authentication enter the \"admin\" username and the password you
|
---|
| 827 | set here).
|
---|
| 828 | ";
|
---|
| 829 | echo "$msg"
|
---|
| 830 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 831 | pw=`${gsdlhome}/bin/${gsdlos}/getpw`
|
---|
| 832 | tmp="[admin]
|
---|
| 833 | <comment>
|
---|
| 834 | <enabled>true
|
---|
| 835 | <groups>administrator,colbuilder
|
---|
| 836 | <password>${pw}
|
---|
| 837 | <username>admin
|
---|
| 838 | ----------------------------------------------------------------------"
|
---|
| 839 | echo "$tmp" | ${gsdlhome}/bin/${gsdlos}/txt2db "${gsdlhome}/etc/users.db"
|
---|
| 840 | $cmd_chmod a+rw "${gsdlhome}/etc/users.db"
|
---|
| 841 |
|
---|
| 842 | # edit gsdlsite.cfg
|
---|
| 843 | cd "$cgi_bin"
|
---|
| 844 | sed "s|\(gsdlhome *\)[^ ]*|\1${gsdlhome}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
| 845 | sed "s|#*\(httpprefix *\)[^ ]*|\1${httpprefix}|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
| 846 | sed "s|\(httpimg *\)[^ ]*|\1${httpprefix}/images|" gsdlsite.cfg > tmp123.txt && $cmd_mv tmp123.txt gsdlsite.cfg
|
---|
| 847 |
|
---|
| 848 | msg="
|
---|
| 849 |
|
---|
| 850 | Greenstone installation completed successfully."
|
---|
| 851 | echo "$msg"
|
---|
| 852 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 853 | if [ "$remind_cgi" = "yes" ]; then
|
---|
| 854 | msg=" * Don't forget to configure your webserver to treat
|
---|
| 855 | $cgi_bin as a cgi executable directory."
|
---|
| 856 | echo "$msg"
|
---|
| 857 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 858 |
|
---|
| 859 | apache_web_cgi=`echo "$web_cgi" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
|
---|
| 860 | cgi_bin_slash=`echo "$cgi_bin" | sed "s|/*$|/|"`
|
---|
| 861 | cgi_bin_noslash=`echo "$cgi_bin" | sed "s|/*$||"`
|
---|
| 862 |
|
---|
| 863 | msg=" For the Apache webserver this means adding the following
|
---|
| 864 | ScriptAlias directive to your httpd.conf configuration file.
|
---|
| 865 |
|
---|
| 866 | ScriptAlias ${apache_web_cgi} \"${cgi_bin_slash}\"
|
---|
| 867 | <Directory \"${cgi_bin_noslash}\">
|
---|
| 868 | AllowOverride None
|
---|
| 869 | Options None
|
---|
| 870 | Order allow,deny
|
---|
| 871 | Allow from all
|
---|
| 872 | </Directory>
|
---|
| 873 | "
|
---|
| 874 | echo "$msg"
|
---|
| 875 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 876 | fi
|
---|
| 877 | if [ "$remind_cgi_nomove" = "yes" ]; then
|
---|
| 878 | msg=" * Don't forget to move the contents of ${gsdlhome}/cgi-bin
|
---|
| 879 | to $cgi_bin
|
---|
| 880 | "
|
---|
| 881 | echo "$msg"
|
---|
| 882 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 883 | fi
|
---|
| 884 | if [ "$remind_ph" = "yes" ]; then
|
---|
| 885 | msg=" * Don't forget to configure your webserver to treat
|
---|
| 886 | $gsdlhome as a web accessible directory."
|
---|
| 887 | echo "$msg"
|
---|
| 888 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 889 |
|
---|
| 890 | apache_httpprefix=`echo "$httpprefix" | sed "s|[^/]*//[^/]*||" | sed "s|/*$|/|"`
|
---|
| 891 | public_html_slash=`echo "$public_html" | sed "s|/*$|/|"`
|
---|
| 892 | public_html_noslash=`echo "$public_html" | sed "s|/*$||"`
|
---|
| 893 |
|
---|
| 894 | msg=" For the Apache webserver this means adding the following
|
---|
| 895 | Alias directive to your httpd.conf configuration file.
|
---|
| 896 |
|
---|
| 897 | Alias ${apache_httpprefix} \"${public_html_slash}\"
|
---|
| 898 | <Directory \"${public_html_noslash}\">
|
---|
| 899 | Options Indexes MultiViews FollowSymLinks
|
---|
| 900 | AllowOverride None
|
---|
| 901 | Order allow,deny
|
---|
| 902 | Allow from all
|
---|
| 903 | </Directory>
|
---|
| 904 | "
|
---|
| 905 | echo "$msg"
|
---|
| 906 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 907 | fi
|
---|
| 908 | if [ "$remind_ph_nolink" = "yes" ]; then
|
---|
| 909 | msg=" * Don't forget to create a link called gsdl from $old_ph
|
---|
| 910 | to ${gsdlhome}.
|
---|
| 911 | "
|
---|
| 912 | echo "$msg"
|
---|
| 913 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 914 | fi
|
---|
| 915 | msg="The output of this script has been recorded for you at
|
---|
| 916 | ${gsdlhome}/INSTALL_RECORD.
|
---|
| 917 | You may remove Greenstone from your system at any time by running
|
---|
| 918 | the ${gsdlhome}/Uninstall.sh script.
|
---|
| 919 | Access Greenstone by pointing a web browser at
|
---|
| 920 | ${web_cgi}/library
|
---|
| 921 | "
|
---|
| 922 | echo "$msg"
|
---|
| 923 | echo "$msg" >> "${gsdlhome}/INSTALL_RECORD"
|
---|
| 924 |
|
---|
| 925 | exit 0
|
---|