initial "report class" xml and schema generator script
[Evergreen.git] / config.sh
index 2d5eebf..4e5b6b4 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -27,16 +27,6 @@ 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;
@@ -47,46 +37,29 @@ 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"; 
-               BINDIR="$PREFIX/bin/";
-               LIBDIR="$PREFIX/lib/";
-               PERLDIR="$LIBDIR/perl5/";
-               INCLUDEDIR="$PREFIX/include/";
-               WEBDIR="$PREFIX/web";
-               CGIDIR="$PREFIX/cgi-bin";
-               ETCDIR="$PREFIX/etc";
-               TEMPLATEDIR="$PREFIX/templates";
-       fi
-
-       prompt "Executables directory [$BINDIR] "
-       read X; if [ ! -z "$X" ]; then BINDIR="$X"; fi;
-
-       prompt "Lib directory [$LIBDIR] "
-       read X; if [ ! -z "$X" ]; then LIBDIR="$X"; fi;
+       read X; if [ ! -z "$X" ]; then PREFIX="$X"; fi
 
-       prompt "Perl directory [$PERLDIR] "
-       read X; if [ ! -z "$X" ]; then PERLDIR="$X"; fi;
+       BINDIR="$PREFIX/bin/";
+       LIBDIR="$PREFIX/lib/";
+       PERLDIR="$LIBDIR/perl5/";
+       INCLUDEDIR="$PREFIX/include/";
+       ETCDIR="$PREFIX/conf";
+       WEBDIR="$PREFIX/var/web";
+       CGIDIR="$PREFIX/var/cgi-bin";
+       TEMPLATEDIR="$PREFIX/var/templates";
+       CIRCRULESDIR="$PREFIX/var/circ";
+       XSLDIR="$PREFIX/var/xsl";
+       TMP="$(pwd)/.tmp";
 
-       prompt "Include files directory [$INCLUDEDIR] "
-       read X; if [ ! -z "$X" ]; then INCLUDEDIR="$X"; fi;
+       prompt "Web domain for OPAC in Staff Client [$NEW_OPAC_URL] "
+       read X; if [ ! -z "$X" ]; then NEW_OPAC_URL="$X"; fi;
 
-       prompt "Config files directory [$ETCDIR] "
-       read X; if [ ! -z "$X" ]; then ETCDIR="$X"; fi;
+       prompt "Package Name for Staff Client [$NEW_XUL_PACKAGE_NAME] "
+       read X; if [ ! -z "$X" ]; then NEW_XUL_PACKAGE_NAME="$X"; fi;
 
-       prompt "Web Root Directory [$WEBDIR] "
-       read X; if [ ! -z "$X" ]; then WEBDIR="$X"; fi;
-
-       prompt "Web CGI Directory [$CGIDIR] "
-       read X; if [ ! -z "$X" ]; then CGIDIR="$X"; fi;
-
-       prompt "Templates directory [$TEMPLATEDIR] "
-       read X; if [ ! -z "$X" ]; then TEMPLATEDIR="$X"; fi;
+       prompt "Package Label for Staff Client [$NEW_XUL_PACKAGE_LABEL] "
+       read X; if [ ! -z "$X" ]; then NEW_XUL_PACKAGE_LABEL="$X"; fi;
 
        prompt "Apache2 apxs binary [$APXS2] "
        read X; if [ ! -z "$X" ]; then APXS2="$X"; fi;
@@ -139,6 +112,12 @@ function writeConfig {
        _write "WEBDIR=\"$WEBDIR\"";
        _write "TEMPLATEDIR=\"$TEMPLATEDIR\"";
        _write "ETCDIR=\"$ETCDIR\"";
+       _write "CIRCRULESDIR=\"$CIRCRULESDIR\"";
+       _write "XSLDIR=\"$XSLDIR\"";
+
+       _write "NEW_OPAC_URL=\"$NEW_OPAC_URL\"";
+       _write "NEW_XUL_PACKAGE_NAME=\"$NEW_XUL_PACKAGE_NAME\"";
+       _write "NEW_XUL_PACKAGE_LABEL=\"$NEW_XUL_PACKAGE_LABEL\"";
 
        # print out the targets
        STR="TARGETS=(";
@@ -163,7 +142,6 @@ function writeConfig {
        _write "DBPW=\"$DBPW\"";
 
 
-
        # Now we'll write out the DB bootstrapping config
        CONFIG_FILE='Open-ILS/src/cgi-bin/setup.pl';
        rm -f "$CONFIG_FILE";
@@ -189,6 +167,7 @@ function writeConfig {
        prompt "";
        prompt "";
        prompt "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+       prompt "!! If installing openils_all / openils_db !!";
        prompt "!! Before running 'make install' you MUST !!";
        prompt "!! create a database for Open-ILS.  Use   !!";
        prompt "!! the settings that you listed above and !!";
@@ -200,6 +179,8 @@ function writeConfig {
 
        prompt "To write a new config, run 'make config'";
        prompt "";
+       prompt "To edit individual install locations (e.g. changing the lib directory),"
+       prompt "edit the install.conf file generated from this script"
 
 }