--- /dev/null
+#!/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.
+# --------------------------------------------------------------------
+
+all: config install
+
+config:
+ ./config.sh
+
+install:
+ ./install.sh
+
+clean:
+ ./install.sh clean
+
--- /dev/null
+#!/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.
+# --------------------------------------------------------------------
+
+
+CONFIG_FILE="install.conf";
+DEFAULT_CONFIG_FILE="install.conf.default";
+
+function buildConfig {
+
+ if [ -f "$DEFAULT_CONFIG_FILE" ]; then
+ source "$DEFAULT_CONFIG_FILE";
+ fi;
+
+
+ echo "";
+ echo "-----------------------------------------------------------------------";
+ echo "Type Enter to select the default"
+ echo "-----------------------------------------------------------------------";
+
+ prompt "Install prefix [$PREFIX] ";
+ read X;
+ if [ ! -z "$X" ]; then PREFIX="$X"; fi;
+
+ prompt "Temporary files directory [$TMP] "
+ read X;
+ if [ ! -z "$X" ]; then TMP="$X"; fi;
+
+ prompt "Apache2 apxs binary [$APXS2] "
+ read X;
+ if [ ! -z "$X" ]; then APXS2="$X"; fi;
+
+ prompt "Apache2 headers directory [$APACHE2_HEADERS] "
+ read X;
+ if [ ! -z "$X" ]; then APACHE2_HEADERS="$X"; fi;
+
+ prompt "Libxml2 headers directory [$LIBXML2_HEADERS] "
+ read X;
+ if [ ! -z "$X" ]; then LIBXML2_HEADERS="$X"; fi;
+
+ prompt "Build targets [${TARGETS[@]:0}] "
+ read X;
+ if [ ! -z "$X" ]; then TARGETS=("$X"); fi;
+
+
+ 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 headers directory [$APACHE2_HEADERS]
+ Libxml2 headers directory [$LIBXML2_HEADERS]
+ Build targets [${TARGETS[@]:0}]
+ -----------------------------------------------------------------------
+
+ If these are not OK, use control-c to break out rerun this script.
+ Otherwise, type enter.
+
+ WORDS
+
+ read OK;
+
+ writeConfig;
+}
+
+function prompt { echo ""; echo -n "$*"; }
+
+function writeConfig {
+
+ rm -f "$CONFIG_FILE";
+ echo "Writing config to $CONFIG_FILE...";
+
+ _write "PREFIX=\"$PREFIX\"";
+ _write "TMP=\"$TMP\"";
+ _write "APXS2=\"$APXS2\"";
+ _write "APACHE2_HEADERS=\"$APACHE2_HEADERS\"";
+ _write "LIBXML2_HEADERS=\"$LIBXML2_HEADERS\"";
+
+ # print out the targets
+ STR="TARGETS=(";
+ for target in ${TARGETS[@]:0}; do
+ STR="$STR \"$target\"";
+ done;
+ STR="$STR)";
+ _write "$STR";
+
+ _write "OPENSRF_DIR=\"OpenSRF/src/\"";
+ _write "OPENILS_DIR=\"Open-ILS/src/\"";
+ _write "EVERGREEN_DIR=\"Evergreen/\"";
+
+}
+
+function _write {
+ echo "$*" >> "$CONFIG_FILE";
+}
+
+
+
+buildConfig;
+#!/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.
+# --------------------------------------------------------------------
+
+
+
# --------------------------------------------------------------------
# Build targets. Options include:
#
# running install.sh must have write permissions to PREFIX
# --------------------------------------------------------------------
#PREFIX="/tmp/testinstall/";
-PREFIX="/pines/";
+PREFIX="/tmp/ilsinstall/";
# --------------------------------------------------------------------
# Temporary build files go here. The User running install.sh must
# have write permissions to TMP
# --------------------------------------------------------------------
-TMP="/tmp/ilsinstall/";
+TMP="/tmp/ilstmp/";
# --------------------------------------------------------------------
OPENSRF_DIR="OpenSRF/src/";
OPENILS_DIR="Open-ILS/src/";
EVERGREEN_DIR="Evergreen/";
+
# --------------------------------------------------------------------
function loadConfig {
if [ ! -f "$CONFIG_FILE" ]; then
- if [ -f "$DEFAULT_CONFIG_FILE" ];
- $CONFIG_FILE="$DEFAULT_CONFIG_FILE";
+ if [ -f "$DEFAULT_CONFIG_FILE" ]; then
+ cp "$DEFAULT_CONFIG_FILE" "$CONFIG_FILE";
else
fail "config file \"$CONFIG_FILE\" cannot be found";
+ fi
fi
source "$CONFIG_FILE";
}
loadConfig;
- [ ! -z "$NOFORCE" ] && verifyInstallPaths;
+ #[ -z "$FORCE" ] && verifyInstallPaths;
mkInstallDirs;
# pass the collected variables to make
if [ -z "$1" ]; then return; fi;
- for arg in "$*"; do
+ for arg in "$@"; do
+
+ lastArg="$arg";
case "$arg" in
"clean")
make -C OpenSRF/src clean
make -C Open-ILS/src clean
- make -C Evergreen/src clean
- exit 0;;
+ make -C Evergreen/src clean;;
"force")
FORCE="1";;
*) fail "Unknown command line argument: $arg";;
esac
-
done
+
+ echo "LAST $lastArg";
+ if [ "$lastArg" = "clean" ]; then exit 0; fi;
}
# if user passes in the word 'clean' as the first shell arg, clean all
-checkParams "$*";
+checkParams "$@";
# Kick it off...