database creation stuff -- untested
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 Jul 2005 21:43:15 +0000 (21:43 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sun, 24 Jul 2005 21:43:15 +0000 (21:43 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1398 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/Makefile
Open-ILS/src/extras/import/build-oils-db.sh
Open-ILS/src/sql/Pg/build-db-Postgres.sh [deleted file]
Open-ILS/src/sql/Pg/build-db.sh [new file with mode: 0755]
config.sh

index 2d02e12..11db99e 100644 (file)
@@ -21,6 +21,7 @@ javascript-install:
 storage-bootstrap:
        mkdir -p $(CGIDIR)
        cp -r cgi-bin/* $(CGIDIR)
+       ./extras/import/build-oils-db.sh $(DBDRVR) $(DBHOST) $(DBNAME) $(DBUSER) $(DBPW)
 
 web-templates-install:
        mkdir -p $(TEMPLATEDIR)
index 844f5b3..da58b16 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 if [ "_$3" == "_" ]; then
        echo "Usage:"
-       echo "  $0 {db-user} {Open-ILS-driver} {db-name}"
+       echo "  $0 {Open-ILS-driver} {db-host} {db-name} {db-user} {db-password}"
        exit 1;
 fi
 
@@ -9,8 +9,8 @@ PWD=`pwd`
 WD=`dirname $0`
 
 (
-       echo "cd $WD/../../sql/$2/;"
-       cd $WD/../../sql/$2/;
+       echo "cd $WD/../../sql/$1/;"
+       cd $WD/../../sql/$1/;
        pwd
-       ./build-db-$2.sh $1 $3 $4
+       ./build-db.sh $2 $3 $4 $5
 )
diff --git a/Open-ILS/src/sql/Pg/build-db-Postgres.sh b/Open-ILS/src/sql/Pg/build-db-Postgres.sh
deleted file mode 100755 (executable)
index 74a63f9..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-psql -U $1 -d $2 -f 002.schema.config.sql
-psql -U $1 -d $2 -f 005.schema.actors.sql
-psql -U $1 -d $2 -f 010.schema.biblio.sql
-psql -U $1 -d $2 -f 020.schema.functions.sql
-psql -U $1 -d $2 -f 030.schema.metabib.sql
-psql -U $1 -d $2 -f 040.schema.asset.sql
-psql -U $1 -d $2 -f 080.schema.money.sql
-psql -U $1 -d $2 -f 090.schema.action.sql
-
-psql -U $1 -d $2 -f 800.fkeys.sql
-psql -U $1 -d $2 -f 900.audit-tables.sql
diff --git a/Open-ILS/src/sql/Pg/build-db.sh b/Open-ILS/src/sql/Pg/build-db.sh
new file mode 100755 (executable)
index 0000000..54a2b2b
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+# args: {db-host} {db-name} {db-user} {db-password}
+
+echo "You may be prompted several times for your database password..."
+
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 002.schema.config.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 005.schema.actors.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 010.schema.biblio.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 020.schema.functions.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 030.schema.metabib.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 040.schema.asset.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 080.schema.money.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 090.schema.action.sql
+
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 800.fkeys.sql
+PGUSER=$3 PGHOST=$1 PGDATABASE=$2 psql -f 900.audit-tables.sql
index 935cdd5..ece9789 100755 (executable)
--- a/config.sh
+++ b/config.sh
@@ -123,7 +123,7 @@ function prompt { echo ""; echo -n "$*"; }
 function writeConfig {
 
        rm -f "$CONFIG_FILE";
-       echo "Writing config to $CONFIG_FILE...";
+       echo "Writing installation config to $CONFIG_FILE...";
 
        _write "PREFIX=\"$PREFIX\"";
        _write "BINDIR=\"$BINDIR\"";
@@ -156,6 +156,7 @@ function writeConfig {
        # Now we'll write out the DB bootstrapping config
        CONFIG_FILE='Open-ILS/src/cgi-bin/setup.pl';
        rm -f "$CONFIG_FILE";
+       echo "Writing bootstrapping config to $CONFIG_FILE...";
 
        STR='$main::config{dsn} =';
                STR="$STR 'dbi:${DBDRVR}:host=";
@@ -174,6 +175,18 @@ function writeConfig {
        _write '$main::config{index} = "config.html";';
 
 
+       prompt "";
+       prompt "";
+       prompt "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+       prompt "!! Before running 'make install' you MUST !!";
+       prompt "!! create a database for Open-ILS.  Use   !!";
+       prompt "!! the settings that you listed above and !!";
+       prompt "!! the install scripts will create the    !!";
+       prompt "!! database for you.  -miker              !!";
+       prompt "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!";
+       prompt "";
+       prompt "";
+
        prompt "To write a new config, run 'make config'";
        prompt "";