initial bootstrapping "install dance" stuff
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 Jul 2005 20:49:07 +0000 (20:49 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 Jul 2005 20:49:07 +0000 (20:49 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1394 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile
Open-ILS/src/cgi-bin/circ-rules.cgi
Open-ILS/src/cgi-bin/copy_statuses.cgi
Open-ILS/src/cgi-bin/lib-setup.cgi
Open-ILS/src/cgi-bin/org_unit_types.cgi
Open-ILS/src/cgi-bin/perms-setup.cgi
Open-ILS/src/cgi-bin/usr_group-setup.cgi
config.sh
install.conf.default
install.sh

index eafd56d..2d02e12 100644 (file)
@@ -1,6 +1,6 @@
 all: 
 
-install:       perl-install javascript-install web-templates-install string-templates-install
+install:       perl-install javascript-install web-templates-install string-templates-install storage-bootstrap
 
 marcdumper:
        make -C extras/marcdumper
@@ -18,6 +18,10 @@ javascript-install:
        cp ../../$(OPENSRFDIR)/javascript/JSON.js $(WEBDIR)/util/
        cp ../../$(OPENSRFDIR)/javascript/md5.js $(WEBDIR)/util/
 
+storage-bootstrap:
+       mkdir -p $(CGIDIR)
+       cp -r cgi-bin/* $(CGIDIR)
+
 web-templates-install:
        mkdir -p $(TEMPLATEDIR)
        cp -r templates/opac $(TEMPLATEDIR)
index 4e9738f..44d7799 100755 (executable)
@@ -12,7 +12,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index bd5e926..eb31534 100755 (executable)
@@ -11,7 +11,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index 4b402cb..ed3b187 100755 (executable)
@@ -11,7 +11,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index 72ae4c8..d536852 100755 (executable)
@@ -12,7 +12,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index 0e58d69..a91342b 100755 (executable)
@@ -12,7 +12,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index 6ec3759..47332dc 100755 (executable)
@@ -12,7 +12,7 @@ use CGI qw/:standard start_*/;
 our %config;
 do '../setup.pl';
 
-OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr});
+OpenILS::Application::Storage::CDBI->connection($config{dsn},$config{usr},$config{pw});
 OpenILS::Application::Storage::CDBI->db_Main->{ AutoCommit } = 1;
 
 my $cgi = new CGI;
index 522aeee..935cdd5 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -2,6 +2,7 @@
 # --------------------------------------------------------------------
 # Copyright (C) 2005  Georgia Public Library Service 
 # Bill Erickson <highfalutin@gmail.com>
+# Mike Rylander <mrylander@gmail.com>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -58,6 +59,7 @@ function buildConfig {
                PERLDIR="$LIBDIR/perl5/";
                INCLUDEDIR="$PREFIX/include/";
                WEBDIR="$PREFIX/web";
+               CGIDIR="$PREFIX/cgi-bin";
                ETCDIR="$PREFIX/etc";
                TEMPLATEDIR="$PREFIX/templates";
        fi
@@ -80,6 +82,9 @@ function buildConfig {
        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;
 
@@ -95,6 +100,21 @@ function buildConfig {
        prompt "Build targets [${TARGETS[@]:0}] "
        read X; if [ ! -z "$X" ]; then TARGETS=("$X"); fi;
 
+       prompt "Bootstrapping Database Driver [$DBDRVR] "
+       read X; if [ ! -z "$X" ]; then DBDRVR="$X"; fi;
+
+       prompt "Bootstrapping Database Host [$DBHOST] "
+       read X; if [ ! -z "$X" ]; then DBHOST="$X"; fi;
+
+       prompt "Bootstrapping Database Name [$DBNAME] "
+       read X; if [ ! -z "$X" ]; then DBNAME="$X"; fi;
+
+       prompt "Bootstrapping Database User [$DBUSER] "
+       read X; if [ ! -z "$X" ]; then DBUSER="$X"; fi;
+
+       prompt "Bootstrapping Database Password [$DBPW] "
+       read X; if [ ! -z "$X" ]; then DBPW="$X"; fi;
+
        writeConfig;
 }
 
@@ -132,6 +152,28 @@ function writeConfig {
        _write "OPENILSDIR=\"Open-ILS/src/\"";
        _write "EVERGREENDIR=\"Evergreen/\"";
 
+
+       # Now we'll write out the DB bootstrapping config
+       CONFIG_FILE='Open-ILS/src/cgi-bin/setup.pl';
+       rm -f "$CONFIG_FILE";
+
+       STR='$main::config{dsn} =';
+               STR="$STR 'dbi:${DBDRVR}:host=";
+               STR="${STR}${DBHOST};dbname=";
+               STR="${STR}${DBNAME}';";
+       _write "$STR"
+
+       STR='$main::config{usr} =';
+               STR="$STR '$DBUSER';";
+       _write "$STR"
+       
+       STR='$main::config{pw} =';
+               STR="$STR '$DBPW';";
+       _write "$STR"
+       
+       _write '$main::config{index} = "config.html";';
+
+
        prompt "To write a new config, run 'make config'";
        prompt "";
 
index d503b64..83ba8a5 100644 (file)
@@ -56,6 +56,7 @@ PERLDIR="$LIBDIR/perl5/";
 INCLUDEDIR="$PREFIX/include/";
 ETCDIR="$PREFIX/etc/";
 WEBDIR="$PREFIX/web/";
+CGIDIR="$PREFIX/cgi-bin/";
 TEMPLATEDIR="$PREFIX/templates";
 
 
@@ -98,3 +99,16 @@ OPENSRFDIR="OpenSRF/src/";
 OPENILSDIR="Open-ILS/src/";
 EVERGREENDIR="Evergreen/";
 
+
+
+
+# --------------------------------------------------------------------
+# These are used to create the perl DBI DSN for the bootstrapping
+# scripts.
+# --------------------------------------------------------------------
+DBDRVR="Pg";
+DBHOST="127.0.0.1";
+DBNAME="demo-dev";
+DBUSER="postgres";
+DBPW="";
+
index 08234d2..e6bf5de 100755 (executable)
@@ -190,6 +190,12 @@ function runInstall {
                                if installing; then $MAKE -C "$OPENILSDIR" "marcdumper-install"; fi;
                                ;;
 
+                       "openils_db" )
+                               if installing; then 
+                                       $MAKE -C "$OPENILSDIR" "storage-bootstrap"; 
+                               fi;
+                               ;;
+
 
                        # Evergreen ---