[Mapbender-commits] r4074 - branches/2.6/resources/db

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jun 22 13:15:22 EDT 2009


Author: astrid_emde
Date: 2009-06-22 13:15:22 -0400 (Mon, 22 Jun 2009)
New Revision: 4074

Added:
   branches/2.6/resources/db/install_2.6.sh
Removed:
   branches/2.6/resources/db/install_2.6rc1.sh
Log:
Installation of Mapbender via shell-Script

Copied: branches/2.6/resources/db/install_2.6.sh (from rev 4072, branches/2.6/resources/db/install_2.6rc1.sh)
===================================================================
--- branches/2.6/resources/db/install_2.6.sh	                        (rev 0)
+++ branches/2.6/resources/db/install_2.6.sh	2009-06-22 17:15:22 UTC (rev 4074)
@@ -0,0 +1,188 @@
+#!/bin/bash
+#
+
+rm log_*.txt
+
+# Disclaimer
+echo ""
+echo "DISCLAIMER: this Mapbender database setup script is not stable. USE AT YOUR OWN RISK!"
+echo "The script will create a database for you and will import the Mapbender datat to the new database"
+echo "It will also compile the Mapbender.mo files"
+echo ""
+echo "To run this script you have to set the following options"
+echo " * set the right to execute on this install script"
+echo " * set the right to execute on mapbender/tools/i18n_update_mo.sh"
+echo " * write access to mapbender/log"
+echo " * write access to mapbender/http/tmp"
+echo " * write access to mapbender/resources/locale/ and subdirectories"
+echo " * provide a database user that can create a database"
+echo ""
+echo ""
+echo "If everything is prepared you can continue."
+echo ""
+echo "Continue? (y)es or (n)o"
+read disclaimer
+
+if test $disclaimer != "y"
+then
+	exit 1
+fi
+
+# ask for db version
+echo ""
+echo "Database version? (p)ostgresql or (m)ysql?"
+read dbversion
+
+if test $dbversion != "p" -a $dbversion != "m"
+then
+	echo ""
+	echo "Incorrect database type. Terminating the script..."
+	exit 1
+fi
+
+# ask for db character encoding-U $dbuser
+echo ""
+echo "Database character encoding? (i)so-8859-1 or (u)tf-8?"
+read dbenc
+
+if test $dbenc != "i" -a $dbenc != "u"
+then
+	echo ""
+	echo "Incorrect database character encoding. Terminating the script..."
+	exit 1
+fi
+
+# ask for database name
+echo ""
+echo "Name of database?"
+read dbname
+
+
+if test $dbversion = "m"
+then
+
+	echo "Not available!!!"
+	exit 1
+
+	echo ""
+	echo "Enter your MySQL password:"
+	stty -echo
+	read password
+	stty echo
+	echo ""
+
+	if test $dbenc = "i"
+	then
+		echo ""
+		echo "Installing Mapbender with MySQL (ISO-8859-1) in database $dbname";
+		echo ""
+
+		mysql -e "create database $dbname CHARACTER SET latin1 COLLATE latin1_german1_ci;" -p$password
+		mysql $dbname -p$password < mysql/mysql_schema_2.5.sql > log_schema.txt
+		mysql $dbname -p$password < mysql/ISO-8859-1/mysql_data_2.5.sql > log_data.txt
+		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5_to_2.5.1rc1_mysql_ISO-8859-1.sql > log_update.txt
+		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5.1rc1_to_2.5.1_mysql_ISO-8859-1.sql > log_update.txt
+		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5.1_to_2.6rc1_mysql_ISO-8859-1.sql > log_update.txt
+	
+	elif test $dbenc = "u"
+	then
+		echo ""
+		echo "Installing Mapbender with MySQL (UTF-8) in database $dbname";
+		echo ""
+
+		mysql -e "create database $dbname CHARACTER SET utf8 COLLATE utf8_general_ci;" -p$password
+		mysql $dbname -p$password < mysql/mysql_schema_2.5.sql > log_schema.txt
+		mysql $dbname -p$password < mysql/UTF-8/mysql_data_2.5.sql > log_data.txt
+		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5_to_2.5.1rc1_mysql_UTF-8.sql > log_update.txt
+		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5.1rc1_to_2.5.1_mysql_UTF-8.sql > log_update.txt
+		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5.1_to_2.6rc1_mysql_UTF-8.sql > log_update.txt
+	fi
+elif test $dbversion = "p" -a $dbenc = "i"
+then
+    	echo ""
+	    echo "Installing Mapbender with PostgreSQL (ISO-8859-1) in database $dbname";
+	    echo ""
+
+        # ask for database user
+        echo ""
+        echo "Name of database user?"
+        read dbuser
+
+        #ask for database template
+        echo ""
+        echo "Do you want to use a database template? (y)es or (n)o "    
+        read dbtemplateuse
+
+        if test $dbtemplateuse = "y"
+        then
+           #ask for template name
+           echo ""
+           echo "Name of the template?"
+           read dbtemplate
+        fi
+    
+        if test dbtemplate != ""
+        then  
+           createdb -U $dbuser -E ISO-8859-1 $dbname -T $dbtemplate
+        else  
+          createdb -U $dbuser -E ISO-8859-1 $dbname  
+        fi
+
+	psql -U $dbuser -f pgsql/pgsql_schema_2.5.sql $dbname > log_schema.txt
+	psql -U $dbuser -f pgsql/ISO-8859-1/pgsql_data_2.5.sql $dbname > log_data.txt
+	psql -U $dbuser -f pgsql/pgsql_serial_set_sequences_2.5.sql $dbname > log_sequences.txt
+	psql -U $dbuser -f pgsql/ISO-8859-1/update/update_2.5_to_2.5.1rc1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
+	psql -U $dbuser -f pgsql/ISO-8859-1/update/update_2.5.1rc1_to_2.5.1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
+	psql -U $dbuser -f pgsql/ISO-8859-1/update/update_2.5.1_to_2.6rc1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
+
+elif test $dbversion = "p" -a $dbenc = "u"
+then
+	echo ""
+	echo "Installing Mapbender with PostgreSQL (UTF-8) in database $dbname";
+	echo ""
+	
+        # ask for database user
+        echo ""
+        echo "Name of database user?"
+        read dbuser
+
+        #ask for database template
+        echo ""
+        echo "Do you want to use a database template? (y)es or (n)o "    
+        read dbtemplateuse
+
+        if test $dbtemplateuse = "y"
+        then
+           #ask for template name
+           echo ""
+           echo "Name of the template?"
+           read dbtemplate
+        fi
+
+    
+    echo "The script will ask you several times for your database password. Don't be confused about this."
+ 
+    
+        if test dbtemplate != ""
+        then  
+           createdb -U $dbuser -E UTF-8 $dbname -T $dbtemplate
+        else  
+          createdb -U $dbuser -E UTF-8 $dbname  
+        fi
+
+	psql -U $dbuser -f pgsql/pgsql_schema_2.5.sql $dbname > log_schema.txt
+	psql -U $dbuser -f pgsql/UTF-8/pgsql_data_2.5.sql $dbname > log_data.txt
+	psql -U $dbuser -f pgsql/pgsql_serial_set_sequences_2.5.sql $dbname > log_sequences.txt
+	psql -U $dbuser -f pgsql/UTF-8/update/update_2.5_to_2.5.1rc1_pgsql_UTF-8.sql $dbname > log_update.txt
+	psql -U $dbuser -f pgsql/UTF-8/update/update_2.5.1rc1_to_2.5.1_pgsql_UTF-8.sql $dbname > log_update.txt
+	psql -U $dbuser -f pgsql/UTF-8/update/update_2.5.1_to_2.6rc1_pgsql_UTF-8.sql $dbname > log_update.txt
+	psql -U $dbuser -f pgsql/UTF-8/update/update_2.6rc1_to_2.6rc2_pgsql_UTF-8.sql $dbname > log_update.txt
+fi
+
+echo ""
+echo "Compiling .po files..."
+cd ../../tools/
+./i18n_update_mo.sh
+echo ""
+echo ""
+echo "Finished...check the log files to see if an error occured.";

Deleted: branches/2.6/resources/db/install_2.6rc1.sh
===================================================================
--- branches/2.6/resources/db/install_2.6rc1.sh	2009-06-22 17:14:02 UTC (rev 4073)
+++ branches/2.6/resources/db/install_2.6rc1.sh	2009-06-22 17:15:22 UTC (rev 4074)
@@ -1,122 +0,0 @@
-#!/bin/bash
-#
-
-rm log_*.txt
-
-# Disclaimer
-echo ""
-echo "DISCLAIMER: this Mapbender database setup script is not stable. USE AT YOUR OWN RISK!"
-echo ""
-echo "Continue? (y)es or (n)o"
-read disclaimer
-
-if test $disclaimer != "y"
-then
-	exit 1
-fi
-
-# ask for db version
-echo ""
-echo "Database version? (p)ostgresql or (m)ysql?"
-read dbversion
-
-if test $dbversion != "p" -a $dbversion != "m"
-then
-	echo ""
-	echo "Incorrect database type. Terminating the script..."
-	exit 1
-fi
-
-# ask for db character encoding
-echo ""
-echo "Database character encoding? (i)so-8859-1 or (u)tf-8?"
-read dbenc
-
-if test $dbenc != "i" -a $dbenc != "u"
-then
-	echo ""
-	echo "Incorrect database character encoding. Terminating the script..."
-	exit 1
-fi
-
-# ask for database name
-echo ""
-echo "Name of database?"
-read dbname
-
-
-if test $dbversion = "m"
-then
-
-	echo "Not available!!!"
-	exit 1
-
-	echo ""
-	echo "Enter your MySQL password:"
-	stty -echo
-	read password
-	stty echo
-	echo ""
-
-	if test $dbenc = "i"
-	then
-		echo ""
-		echo "Installing Mapbender with MySQL (ISO-8859-1) in database $dbname";
-		echo ""
-
-		mysql -e "create database $dbname CHARACTER SET latin1 COLLATE latin1_german1_ci;" -p$password
-		mysql $dbname -p$password < mysql/mysql_schema_2.5.sql > log_schema.txt
-		mysql $dbname -p$password < mysql/ISO-8859-1/mysql_data_2.5.sql > log_data.txt
-		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5_to_2.5.1rc1_mysql_ISO-8859-1.sql > log_update.txt
-		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5.1rc1_to_2.5.1_mysql_ISO-8859-1.sql > log_update.txt
-		mysql $dbname -p$password < mysql/ISO-8859-1/update/update_2.5.1_to_2.6rc1_mysql_ISO-8859-1.sql > log_update.txt
-	
-	elif test $dbenc = "u"
-	then
-		echo ""
-		echo "Installing Mapbender with MySQL (UTF-8) in database $dbname";
-		echo ""
-
-		mysql -e "create database $dbname CHARACTER SET utf8 COLLATE utf8_general_ci;" -p$password
-		mysql $dbname -p$password < mysql/mysql_schema_2.5.sql > log_schema.txt
-		mysql $dbname -p$password < mysql/UTF-8/mysql_data_2.5.sql > log_data.txt
-		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5_to_2.5.1rc1_mysql_UTF-8.sql > log_update.txt
-		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5.1rc1_to_2.5.1_mysql_UTF-8.sql > log_update.txt
-		mysql $dbname -p$password < mysql/UTF-8/update/update_2.5.1_to_2.6rc1_mysql_UTF-8.sql > log_update.txt
-	fi
-elif test $dbversion = "p" -a $dbenc = "i"
-then
-	echo "Not available!!!"
-	exit 1
-	echo ""
-	echo "Installing Mapbender with PostgreSQL (ISO-8859-1) in database $dbname";
-	echo ""
-	createdb -E ISO-8859-1 $dbname
-	psql -f pgsql/pgsql_schema_2.5.sql $dbname > log_schema.txt
-	psql -f pgsql/ISO-8859-1/pgsql_data_2.5.sql $dbname > log_data.txt
-	psql -f pgsql/pgsql_serial_set_sequences_2.5.sql $dbname > log_sequences.txt
-	psql -f pgsql/ISO-8859-1/update/update_2.5_to_2.5.1rc1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
-	psql -f pgsql/ISO-8859-1/update/update_2.5.1rc1_to_2.5.1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
-	psql -f pgsql/ISO-8859-1/update/update_2.5.1_to_2.6rc1_pgsql_ISO-8859-1.sql $dbname > log_update.txt
-
-elif test $dbversion = "p" -a $dbenc = "u"
-then
-	echo ""
-	echo "Installing Mapbender with PostgreSQL (UTF-8) in database $dbname";
-	echo ""
-	createdb -E UTF-8 $dbname
-	psql -f pgsql/pgsql_schema_2.5.sql $dbname > log_schema.txt
-	psql -f pgsql/UTF-8/pgsql_data_2.5.sql $dbname > log_data.txt
-	psql -f pgsql/pgsql_serial_set_sequences_2.5.sql $dbname > log_sequences.txt
-	psql -f pgsql/UTF-8/update/update_2.5_to_2.5.1rc1_pgsql_UTF-8.sql $dbname > log_update.txt
-	psql -f pgsql/UTF-8/update/update_2.5.1rc1_to_2.5.1_pgsql_UTF-8.sql $dbname > log_update.txt
-	psql -f pgsql/UTF-8/update/update_2.5.1_to_2.6rc1_pgsql_UTF-8.sql $dbname > log_update.txt
-fi
-
-echo ""
-echo "Compiling .po files..."
-cd ../../tools/
-./i18n_update_mo.sh
-echo ""
-echo ""
-echo "Finished...check the log files to see if an error occured.";
\ No newline at end of file



More information about the Mapbender_commits mailing list