[Mapbender-commits] r4428 - in branches/2.5: resources/db tools

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 28 09:22:00 EDT 2009


Author: christoph
Date: 2009-07-28 09:21:59 -0400 (Tue, 28 Jul 2009)
New Revision: 4428

Modified:
   branches/2.5/resources/db/install_2.5.2.bat
   branches/2.5/resources/db/install_2.5.2.sh
   branches/2.5/tools/i18n_add_translations_to_Mapbender_po.sh
   branches/2.5/tools/i18n_update_mo.sh
Log:


Modified: branches/2.5/resources/db/install_2.5.2.bat
===================================================================
--- branches/2.5/resources/db/install_2.5.2.bat	2009-07-28 13:11:05 UTC (rev 4427)
+++ branches/2.5/resources/db/install_2.5.2.bat	2009-07-28 13:21:59 UTC (rev 4428)
@@ -1,12 +1,11 @@
 @echo off
-rem $id: $
-REM Script to install Mapbender 2.5 database
+REM Script to install Mapbender 2.5.2 database
 REM
 setlocal
 REM Delete old Logfiles
 del log_*.txt
 del err_*.txt
-:PREP
+:PREP
 echo.
 echo ==============================================================================
 REM Disclaimer
@@ -62,8 +61,18 @@
 :DB_ISO
 IF %USEDBENC%x==x set USEDBENC=ISO-8859-1
 
+echo.
+set /p DBHOST="Database host (localhost if running on local maschine):"
+echo.
 
+
 echo.
+set /p DBPORT="Database port (e.g. 5432 for postgres, 3306 for mysql):"
+echo.
+
+
+
+echo.
 set /p DBUSER="Database user:"
 echo.
 
@@ -79,6 +88,8 @@
 echo Your Choices:
 echo Databasetype: %DBTYPE% - %USEDBTYPE%
 echo Encoding: %DBENC% - %USEDBENC%
+echo Database Host: %DBHOST%
+echo Database Port: %DBPORT%
 echo Database Name: %DBNAME%
 echo Database User: %DBUSER%
 echo Database Password: %DBPASSWORD% (not shown)
@@ -101,53 +112,67 @@
 set /p DBTEMPLATE="database template to use (just hit return for default):"
 
 IF %DBTEMPLATE%x==x set DBTEMPLATE=template0
+IF %DBHOST%x==x set DBHOST=localhost
+IF %DBPORT%x==x set DBPORT=5432
 
 echo creating db
-createdb -U %DBUSER% -E %USEDBENC% -T %DBTEMPLATE% %DBNAME% "Mapbender Database Version 2.5"
+createdb -U %DBUSER% -E %USEDBENC% -h %DBHOST% -p %DBPORT% -T %DBTEMPLATE% %DBNAME% "Mapbender Database Version 2.5.2"
 echo creating schema
-psql -U %DBUSER% -f pgsql/pgsql_schema_2.5.sql %DBNAME% 1>log_schema.txt 2> err_schema.txt
+psql -U %DBUSER% -h %DBHOST% -p %DBPORT% -f pgsql/pgsql_schema_2.5.sql %DBNAME% 1>log_schema.txt 2> err_schema.txt
 echo importing data
-psql -U %DBUSER% -f pgsql/%USEDBENC%/pgsql_data_2.5.sql %DBNAME% 1>log_data.txt 2> err_data.txt
+psql -U %DBUSER% -h %DBHOST% -p %DBPORT% -f pgsql/%USEDBENC%/pgsql_data_2.5.sql %DBNAME% 1>log_data.txt 2> err_data.txt
 echo setting sequences
-psql -U %DBUSER% -f pgsql/pgsql_serial_set_sequences_2.5.sql %DBNAME% 1>log_sequences.txt 2> err_sequences.txt
+psql -U %DBUSER% -h %DBHOST% -p %DBPORT% -f pgsql/pgsql_serial_set_sequences_2.5.sql %DBNAME% 1>log_sequences.txt 2> err_sequences.txt
 
 echo performing updates
 echo to 2.5.1rc1
-psql -U %DBUSER% -f pgsql/%USEDBENC%/update/update_2.5_to_2.5.1rc1_pgsql_%USEDBENC%.sql %DBNAME% 1>log_update.txt 2> err_update.txt
+psql -U %DBUSER% -h %DBHOST% -p %DBPORT% -f pgsql/%USEDBENC%/update/update_2.5_to_2.5.1rc1_pgsql_%USEDBENC%.sql %DBNAME% 1>log_update.txt 2> err_update.txt
 echo to 2.5.1
-psql -U %DBUSER% -f pgsql/%USEDBENC%/update/update_2.5.1rc1_to_2.5.1_pgsql_%USEDBENC%.sql %DBNAME% 1>>log_update.txt 2>> err_update.txt
+psql -U %DBUSER% -h %DBHOST% -p %DBPORT% -f pgsql/%USEDBENC%/update/update_2.5.1rc1_to_2.5.1_pgsql_%USEDBENC%.sql %DBNAME% 1>>log_update.txt 2>> err_update.txt
 
 
-goto END
+goto POFILES
 
 :INSTMYSQL
+IF %DBHOST%x==x set DBHOST=localhost
+IF %DBPORT%x==x set DBPORT=3306
+
 mysql --version 2> nul 1> nul
 
 if not %ERRORLEVEL% == 0 goto MYSQLNOTFOUND
 echo creating database
-if %USEDBENC% == ISO-8859-1 mysql -u %DBUSER% -e "create database %DBNAME% character set latin1 COLLATE latin1_german1_ci;" -p
-if %USEDBENC% == UTF-8 mysql -e "create database %DBNAME% character set utf8 COLLATE utf8_general__ci;" -p
+if %USEDBENC% == ISO-8859-1 mysql -h %DBHOST% -P %DBPORT% -u %DBUSER% -e "create database %DBNAME% character set latin1 COLLATE latin1_german1_ci;" -p
+if %USEDBENC% == UTF-8 mysql -h %DBHOST% -P %DBPORT% -e "create database %DBNAME% character set utf8 COLLATE utf8_general__ci;" -p
 echo creating schema
-mysql %DBNAME% -p -u %DBUSER% < mysql/mysql_schema_2.5.sql > log_schema.txt 2> err_schema.txt
+mysql %DBNAME% -p -h %DBHOST% -P %DBPORT% -u %DBUSER% < mysql/mysql_schema_2.5.sql > log_schema.txt 2> err_schema.txt
 echo loading data
-mysql %DBNAME% -p -u %DBUSER% < mysql/%USEDBENC%/mysql_data_2.5.sql > log_data.txt 2> err_data.txt
+mysql %DBNAME% -p -h %DBHOST% -P %DBPORT% -u %DBUSER% < mysql/%USEDBENC%/mysql_data_2.5.sql > log_data.txt 2> err_data.txt
 echo update to 2.5.1rc1
-mysql %DBNAME% -p -u %DBUSER% < mysql/%USEDBENC%/update/update_2.5_to_2.5.1rc1_mysql_%USEDBENC%.sql > log_update.txt 2> err_update.txt
+mysql %DBNAME% -p -h %DBHOST% -P %DBPORT% -u %DBUSER% < mysql/%USEDBENC%/update/update_2.5_to_2.5.1rc1_mysql_%USEDBENC%.sql > log_update.txt 2> err_update.txt
 echo update to 2.5.1
-mysql %DBNAME% -p -u %DBUSER% < mysql/%USEDBENC%/update/update_2.5.1rc1_to_2.5.1_mysql_%USEDBENC%.sql >> log_update.txt 2>> err_update.txt
+mysql %DBNAME% -p -h %DBHOST% -P %DBPORT% -u %DBUSER% < mysql/%USEDBENC%/update/update_2.5.1rc1_to_2.5.1_mysql_%USEDBENC%.sql >> log_update.txt 2>> err_update.txt
 
+GOTO POFILES
 
+
+:POFILES
+rem install mapbender.conf
+if not exist ..\..\conf\mapbender.conf copy ..\..\conf\mapbender.conf-dist ..\..\conf\mapbender.conf
+echo please check and edit your mapbender.conf.
+
+
 rem update .po files
-
 echo ""
 msgfmt --version 2> nul 1> nul
 if NOT %ERRORLEVEL% == 0 goto MSGFMTNOTFOUND
 echo "Compiling .po files..."
-pushd ../../tools/
+pushd ..\..\tools\
 findstr /v ^# i18n_update_mo.sh > i18n_update_mo.bat
 call i18n_update_mo.bat
 del i18n_update_mo.bat
 popd
+
+
 goto END:
 
 :MSGFMTNOTFOUND
@@ -166,4 +191,4 @@
 :END
 endlocal
 echo Finished...check the log files to see if an error occured.
-pause 
+pause 

Modified: branches/2.5/resources/db/install_2.5.2.sh
===================================================================
--- branches/2.5/resources/db/install_2.5.2.sh	2009-07-28 13:11:05 UTC (rev 4427)
+++ branches/2.5/resources/db/install_2.5.2.sh	2009-07-28 13:21:59 UTC (rev 4428)
@@ -78,7 +78,16 @@
     fi
 
     echo ""
-    echo "database User?"
+    echo "database host (e.g. localhost)?"
+    read DBHOST
+
+    echo ""
+    echo "database port (e.g. 5432 for postgres, 3306 for mysql)?"
+    read DBPORT
+    
+
+    echo ""
+    echo "database user?"
     read DBUSER
 
 #using a password via commandline oder as shell var could lead to security problems, so we don't do it
@@ -100,6 +109,8 @@
     then
         echo "postgres template:" $DBTEMPLATE
     fi
+    echo "db host:" $DBHOST
+    echo "db port:" $DBPORT
     echo "dbname:" $DBNAME
     echo "user:"     $DBUSER
     echo ""
@@ -125,14 +136,14 @@
     else
         mysql -e "create database $DBNAME CHARACTER SET utf8 COLLATE utf8_general_ci;" -p$DBPASSWORD
     fi
-	mysql $DBNAME -p$DBPASSWORD < mysql/mysql_schema_2.5.sql > log_schema.txt 2> err_schema.txt
-	mysql $DBNAME -p$DBPASSWORD < mysql/$DBENCODING/mysql_data_2.5.sql > log_data.txt 2> err_data.txt
-	mysql $DBNAME -p$DBPASSWORD < mysql/$DBENCODING/update/update_2.5_to_2.5.1rc1_mysql_$DBENCODING.sql > log_update.txt 2> err_update.txt
-	mysql $DBNAME -p$DBPASSWORD < mysql/$DBENCODING/update/update_2.5.1rc1_to_2.5.1_mysql_$DBENCODING.sql >> log_update.txt 2>> err_update.txt
+	mysql $DBNAME -p$DBPASSWORD -h $DBHOST -P $DBPORT < mysql/mysql_schema_2.5.sql > log_schema.txt 2> err_schema.txt
+	mysql $DBNAME -p$DBPASSWORD -h $DBHOST -P $DBPORT < mysql/$DBENCODING/mysql_data_2.5.sql > log_data.txt 2> err_data.txt
+	mysql $DBNAME -p$DBPASSWORD -h $DBHOST -P $DBPORT < mysql/$DBENCODING/update/update_2.5_to_2.5.1rc1_mysql_$DBENCODING.sql > log_update.txt 2> err_update.txt
+	mysql $DBNAME -p$DBPASSWORD -h $DBHOST -P $DBPORT < mysql/$DBENCODING/update/update_2.5.1rc1_to_2.5.1_mysql_$DBENCODING.sql >> log_update.txt 2>> err_update.txt
 	
 }
 
-#Datenbank erzeugen
+#Create Database (Postgres)
 function create_pgsql_db(){
     which psql createdb > /dev/null
     if [ $? -ne 0 ]
@@ -144,17 +155,17 @@
     fi
     echo "Your password will be asked several times, this is normal (unless .pgpass is used)"
     echo "creating database"
-    createdb -U $DBUSER -E $DBENCODING $DBNAME -T $DBTEMPLATE
+    createdb -U $DBUSER  -h $DBHOST -p $DBPORT -E $DBENCODING $DBNAME -T $DBTEMPLATE
     echo "creating schema"
-	psql -U $DBUSER  -f pgsql/pgsql_schema_2.5.sql $DBNAME > log_schema.txt 2> err_schema.txt
+	psql -U $DBUSER  -h $DBHOST -p $DBPORT -f pgsql/pgsql_schema_2.5.sql $DBNAME > log_schema.txt 2> err_schema.txt
     echo "loading data"	
-    psql -U $DBUSER  -f pgsql/$DBENCODING/pgsql_data_2.5.sql $DBNAME > log_data.txt 2> err_data.txt
+    psql -U $DBUSER  -h $DBHOST -p $DBPORT -f pgsql/$DBENCODING/pgsql_data_2.5.sql $DBNAME > log_data.txt 2> err_data.txt
 	echo "setting sequences"
-    psql -U $DBUSER  -f pgsql/pgsql_serial_set_sequences_2.5.sql $DBNAME > log_sequences.txt 2> err_squences.txt
+    psql -U $DBUSER  -h $DBHOST -p $DBPORT -f pgsql/pgsql_serial_set_sequences_2.5.sql $DBNAME > log_sequences.txt 2> err_squences.txt
 	echo "update to 2.5.1rc1"
-    psql -U $DBUSER  -f pgsql/$DBENCODING/update/update_2.5_to_2.5.1rc1_pgsql_$DBENCODING.sql $DBNAME > log_update.txt 2> err_update.txt
+    psql -U $DBUSER  -h $DBHOST -p $DBPORT -f pgsql/$DBENCODING/update/update_2.5_to_2.5.1rc1_pgsql_$DBENCODING.sql $DBNAME > log_update.txt 2> err_update.txt
 	echo "update to 2.5.1"
-	psql -U $DBUSER  -f pgsql/$DBENCODING/update/update_2.5.1rc1_to_2.5.1_pgsql_$DBENCODING.sql $DBNAME >> log_update.txt 2>> err_update.txt
+	psql -U $DBUSER  -h $DBHOST -p $DBPORT -f pgsql/$DBENCODING/update/update_2.5.1rc1_to_2.5.1_pgsql_$DBENCODING.sql $DBNAME >> log_update.txt 2>> err_update.txt
 
 
 }
@@ -176,14 +187,24 @@
           then
 	        echo "Please specify the webserver user"
 	        read webservuser
-	        chown -R $webservuser:$webservuser ../../
+	        echo "Please specify the webserver group"
+	        read webservgroup
+
+	        chown -R $webservuser:$webservgroup ../../
           fi
           echo "setting permissions on /resources/locale/ and subdirectories"
           chmod -R o+rw ../locale
           echo "setting execute rights on mapbender/tools/i18n_update_mo.sh"
           chmod -R o+rx ../../tools/i18n_update_mo.sh
           # creating mapbender.conf
-          cp ../../conf/mapbender.conf-dist ../../conf/mapbender.conf
+          if [ -f ../../conf/mapbender.conf ]
+          then
+            echo "mapbender.conf already exists, not changed"
+          else
+            cp ../../conf/mapbender.conf-dist ../../conf/mapbender.conf
+          fi
+          echo ""
+          echo "please check and edit the entries in your mapbender.conf manually!"
           
     fi
 }

Modified: branches/2.5/tools/i18n_add_translations_to_Mapbender_po.sh
===================================================================
--- branches/2.5/tools/i18n_add_translations_to_Mapbender_po.sh	2009-07-28 13:11:05 UTC (rev 4427)
+++ branches/2.5/tools/i18n_add_translations_to_Mapbender_po.sh	2009-07-28 13:21:59 UTC (rev 4428)
@@ -11,12 +11,14 @@
 	xgettext -p ../resources/locale/de_DE/LC_MESSAGES/ -o Mapbender.po -L php -j --keyword=_mb -n --from-code 	utf-8 ../$1
 	echo "$1: new Translations added to Mapbender.po de_DE"
 
-	xgettext -p ../resources/locale/it_IT/LC_MESSAGES/ -o Mapbender.po -L php -j --keyword=_mb -n --from-code 	utf-8 ../$1
-	echo "$1: new Translations added to Mapbender.po it_IT"
+	xgettext -p ../resources/locale/fr_FR/LC_MESSAGES/ -o Mapbender.po -L php -j --keyword=_mb -n --from-code 	utf-8 ../$1
+	echo "$1: new Translations added to Mapbender.po fr_FR"
 
 	xgettext -p ../resources/locale/el_GR/LC_MESSAGES/ -o Mapbender.po -L php -j --keyword=_mb -n --from-code 	utf-8 ../$1
 	echo "$1: new Translations added to Mapbender.po el_GR"
 
+	xgettext -p ../resources/locale/it_IT/LC_MESSAGES/ -o Mapbender.po -L php -j --keyword=_mb -n --from-code 	utf-8 ../$1
+	echo "$1: new Translations added to Mapbender.po it_IT"
 fi
 
 

Modified: branches/2.5/tools/i18n_update_mo.sh
===================================================================
--- branches/2.5/tools/i18n_update_mo.sh	2009-07-28 13:11:05 UTC (rev 4427)
+++ branches/2.5/tools/i18n_update_mo.sh	2009-07-28 13:21:59 UTC (rev 4428)
@@ -4,6 +4,8 @@
 echo "Mapbender.mo has been updated for bg_BG"
 msgfmt ../resources/locale/de_DE/LC_MESSAGES/Mapbender.po -o ../resources/locale/de_DE/LC_MESSAGES/Mapbender.mo
 echo "Mapbender.mo has been updated for de_DE"
+msgfmt ../resources/locale/fr_FR/LC_MESSAGES/Mapbender.po -o ../resources/locale/fr_FR/LC_MESSAGES/Mapbender.mo
+echo "Mapbender.mo has been updated for fr_FR"
 msgfmt ../resources/locale/el_GR/LC_MESSAGES/Mapbender.po -o ../resources/locale/el_GR/LC_MESSAGES/Mapbender.mo
 echo "Mapbender.mo has been updated for el_GR"
 msgfmt ../resources/locale/it_IT/LC_MESSAGES/Mapbender.po -o ../resources/locale/it_IT/LC_MESSAGES/Mapbender.mo



More information about the Mapbender_commits mailing list