bash script for setting up and kicking off the install. Currently,
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Jul 2005 21:24:39 +0000 (21:24 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 1 Jul 2005 21:24:39 +0000 (21:24 +0000)
its main purpose is to verify directories make sense.

It will also need to check for requirements and probably
lots of other things..

git-svn-id: svn://svn.open-ils.org/ILS/trunk@1029 dcc99617-32d9-48b4-a31d-7c20da2025e4

install.sh [new file with mode: 0755]

diff --git a/install.sh b/install.sh
new file mode 100755 (executable)
index 0000000..d6883b0
--- /dev/null
@@ -0,0 +1,130 @@
+#!/bin/bash
+# --------------------------------------------------------------------
+# Copyright (C) 2005  Georgia Public Library Service 
+# Bill Erickson <highfalutin@gmail.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# --------------------------------------------------------------------
+
+
+# --------------------------------------------------------------------
+# ILS install script
+# --------------------------------------------------------------------
+
+# *!*!* EDIT THESE *!*!*
+# --------------------------------------------------------------------
+# Here define all of the necessary install variables 
+# --------------------------------------------------------------------
+APXS2="/pines/apps/apache2/bin/apxs";
+PREFIX="/pines/";
+TMP="/tmp/pines/";
+APACHE2_HEADERS="/pines/apps/apache2/include/";
+LIBXML2_HEADERS="/usr/include/libxml2/";
+TARGETS=("OpenSRF" "Open-ILS" "Evergreen");
+# --------------------------------------------------------------------
+
+# --------------------------------------------------------------------
+# if FORCE is set to any non-empty value, we'll use 
+# the default settings
+FORCE=$1 
+# --------------------------------------------------------------------
+
+
+
+
+
+# --------------------------------------------------------------------
+# Loads all of the path information from the user setting 
+# install variables as it goes
+# --------------------------------------------------------------------
+function verifyInstallPaths {
+
+       cat <<-WORDS
+
+       -----------------------------------------------------------------------
+       Verify the following install directories are sane.
+       Note: * indicates that you must have write privelages for the location
+       -----------------------------------------------------------------------
+
+       -----------------------------------------------------------------------
+       Install prefix            [$PREFIX]*
+       Temporary files directory [$TMP]*
+       Apache2 apxs binary       [$APXS2]
+       Apache2 header directory  [$APACHE2_HEADERS]
+       Libxml2 header directory  [$LIBXML2_HEADERS]
+       Building targets          [${TARGETS[@]:0}];
+       -----------------------------------------------------------------------
+
+       If these are not OK, use control-c to break out and fix the variables 
+       at the top of this script.  Otherwise, type enter.
+
+       WORDS
+       read OK;
+}
+
+# --------------------------------------------------------------------
+# Makes sure the install directories exist and are writable
+# --------------------------------------------------------------------
+function mkInstallDirs {
+
+       mkdir -p "$PREFIX";
+
+       if [ "$?" != "0" ]; then
+               echo "Error creating $PREFIX";
+               exit 99;
+       fi
+
+       mkdir -p "$TMP";
+       if [ "$?" != "0" ]; then
+               echo "Error creating $TMP";
+               exit 99;
+       fi
+
+       if [ ! -w "$PREFIX" ]; then
+               echo "We don't have write access to $PREFIX";
+               exit 99;
+       fi
+
+       if [ ! -w "$TMP" ]; then
+               echo "We don't have write access to $TMP";
+               exit 99;
+       fi
+
+}
+
+
+function runInstall {
+
+       [ -z "$FORCE" ] && verifyInstallPaths;
+       mkInstallDirs;
+
+       # pass the collected variables to make
+       for target in ${TARGETS[@]:0}; do
+
+               target="$target/src";
+
+               make -C "$target" \
+                       APXS2="$APXS2" \
+                       PREFIX="$PREFIX" \
+                       TMP="$TMP" \
+                       APCHE2_HEADERS="$APACHE2_HEADERS" \
+                       LIBXML2_HEADERS="$LIBXML2_HEADERS" \
+                       all;    
+
+       done
+}
+
+
+
+# Kick it off...
+runInstall;
+