making the install script break out opensrf, openils, and evergreen a little
[Evergreen.git] / config.sh
index 6b4cdfe..d662698 100755 (executable)
--- a/config.sh
+++ b/config.sh
 # --------------------------------------------------------------------
 
 
+# --------------------------------------------------------------------
+# Prompts the user for config settings and writes a custom config
+# file based on these settings
+# --------------------------------------------------------------------
+
+
 CONFIG_FILE="install.conf";
 DEFAULT_CONFIG_FILE="install.conf.default";
 
 function buildConfig {
 
+#      if [ -f "$CONFIG_FILE" ]; then
+#              echo "";
+#              echo "Using existing config file \"$CONFIG_FILE\""; 
+#              echo "To generate a new config, remove \"$CONFIG_FILE\"";
+#              echo "";
+#              sleep 3;        
+#              exit 0;
+#      fi
+
+
        if [ -f "$DEFAULT_CONFIG_FILE" ]; then
                source "$DEFAULT_CONFIG_FILE";
        fi;
@@ -30,14 +46,45 @@ function buildConfig {
        echo "Type Enter to select the default"
        echo "-----------------------------------------------------------------------";
 
+       prompt "Temporary files directory [$TMP] "
+       read X;
+       if [ ! -z "$X" ]; then TMP="$X"; fi;
+
        prompt "Install prefix [$PREFIX] ";
        read X;
-       if [ ! -z "$X" ]; then PREFIX="$X"; fi;
+       if [ ! -z "$X" ]; then 
+               PREFIX="$X"; 
+               BINDIR="$PREFIX/bin/";
+               LIBDIR="$PREFIX/lib/";
+               PERLDIR="$LIBDIR/perl5/";
+               INCLUDEDIR="$PREFIX/include/";
+       fi
+
+       prompt "Executables directory [$BINDIR] "
+       read X;
+       if [ ! -z "$X" ]; then BINDIR="$X"; fi;
 
-       prompt "Temporary files directory [$TMP] "
+       prompt "Lib directory [$LIBDIR] "
        read X;
-       if [ ! -z "$X" ]; then TMP="$X"; fi;
+       if [ ! -z "$X" ]; then LIBDIR="$X"; fi;
+
+       prompt "Perl directory [$PERLDIR] "
+       read X;
+       if [ ! -z "$X" ]; then PERLDIR="$X"; fi;
+
+       prompt "Include files directory [$INCLUDEDIR] "
+       read X;
+       if [ ! -z "$X" ]; then INCLUDEDIR="$X"; fi;
 
+       prompt "Config files directory [$ETCDIR] "
+       read X;
+       if [ ! -z "$X" ]; then ETCDIR="$X"; fi;
+
+       prompt "Web Root Directory [$WEB] "
+       read X;
+       if [ ! -z "$X" ]; then WEB="$X"; fi;
+
+       
        prompt "Apache2 apxs binary [$APXS2] "
        read X;
        if [ ! -z "$X" ]; then APXS2="$X"; fi;
@@ -89,6 +136,11 @@ function writeConfig {
        echo "Writing config to $CONFIG_FILE...";
 
        _write "PREFIX=\"$PREFIX\"";
+       _write "BINDIR=\"$BINDIR\"";
+       _write "LIBDIR=\"$LIBDIR\"";
+       _write "PERLDIR=\"$PERLDIR\"";
+       _write "INCLUDEDIR=\"$INCLUDEDIR\"";
+
        _write "TMP=\"$TMP\"";
        _write "APXS2=\"$APXS2\"";
        _write "APACHE2_HEADERS=\"$APACHE2_HEADERS\"";