From 93f6463755e3e3b95509ffc3625cc810b188b674 Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 1 Jul 2005 21:24:39 +0000 Subject: [PATCH] bash script for setting up and kicking off the install. Currently, 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 | 130 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000000..d6883b081a --- /dev/null +++ b/install.sh @@ -0,0 +1,130 @@ +#!/bin/bash +# -------------------------------------------------------------------- +# Copyright (C) 2005 Georgia Public Library Service +# Bill Erickson +# +# 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; + -- 2.43.2