2 # --------------------------------------------------------------------
3 # Copyright (C) 2005 Georgia Public Library Service
4 # Bill Erickson <highfalutin@gmail.com>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 # --------------------------------------------------------------------
18 CONFIG_FILE="install.conf";
19 DEFAULT_CONFIG_FILE="install.conf.default";
21 function buildConfig {
23 if [ -f "$DEFAULT_CONFIG_FILE" ]; then
24 source "$DEFAULT_CONFIG_FILE";
29 echo "-----------------------------------------------------------------------";
30 echo "Type Enter to select the default"
31 echo "-----------------------------------------------------------------------";
33 prompt "Install prefix [$PREFIX] ";
35 if [ ! -z "$X" ]; then PREFIX="$X"; fi;
37 prompt "Temporary files directory [$TMP] "
39 if [ ! -z "$X" ]; then TMP="$X"; fi;
41 prompt "Apache2 apxs binary [$APXS2] "
43 if [ ! -z "$X" ]; then APXS2="$X"; fi;
45 prompt "Apache2 headers directory [$APACHE2_HEADERS] "
47 if [ ! -z "$X" ]; then APACHE2_HEADERS="$X"; fi;
49 prompt "Libxml2 headers directory [$LIBXML2_HEADERS] "
51 if [ ! -z "$X" ]; then LIBXML2_HEADERS="$X"; fi;
53 prompt "Build targets [${TARGETS[@]:0}] "
55 if [ ! -z "$X" ]; then TARGETS=("$X"); fi;
60 -----------------------------------------------------------------------
61 Verify the following install directories are sane.
62 Note: * indicates that you must have write privelages for the location
63 -----------------------------------------------------------------------
65 -----------------------------------------------------------------------
66 Install prefix [$PREFIX]*
67 Temporary files directory [$TMP]*
68 Apache2 apxs binary [$APXS2]
69 Apache2 headers directory [$APACHE2_HEADERS]
70 Libxml2 headers directory [$LIBXML2_HEADERS]
71 Build targets [${TARGETS[@]:0}]
72 -----------------------------------------------------------------------
74 If these are not OK, use control-c to break out rerun this script.
75 Otherwise, type enter.
84 function prompt { echo ""; echo -n "$*"; }
86 function writeConfig {
89 echo "Writing config to $CONFIG_FILE...";
91 _write "PREFIX=\"$PREFIX\"";
92 _write "TMP=\"$TMP\"";
93 _write "APXS2=\"$APXS2\"";
94 _write "APACHE2_HEADERS=\"$APACHE2_HEADERS\"";
95 _write "LIBXML2_HEADERS=\"$LIBXML2_HEADERS\"";
97 # print out the targets
99 for target in ${TARGETS[@]:0}; do
100 STR="$STR \"$target\"";
105 _write "OPENSRF_DIR=\"OpenSRF/src/\"";
106 _write "OPENILS_DIR=\"Open-ILS/src/\"";
107 _write "EVERGREEN_DIR=\"Evergreen/\"";
112 echo "$*" >> "$CONFIG_FILE";