making the install script break out opensrf, openils, and evergreen a little
[Evergreen.git] / config.sh
index 971c5cb..d662698 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -26,14 +26,14 @@ 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 "$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
@@ -46,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 "Temporary files directory [$TMP] "
+       prompt "Executables directory [$BINDIR] "
        read X;
-       if [ ! -z "$X" ]; then TMP="$X"; fi;
+       if [ ! -z "$X" ]; then BINDIR="$X"; fi;
+
+       prompt "Lib directory [$LIBDIR] "
+       read X;
+       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;
@@ -105,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\"";