[GRASS-SVN] r49286 - in grass/trunk/mswindows: . osgeo4w

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 17 09:53:26 EST 2011


Author: martinl
Date: 2011-11-17 06:53:26 -0800 (Thu, 17 Nov 2011)
New Revision: 49286

Modified:
   grass/trunk/mswindows/GRASS-Installer.nsi
   grass/trunk/mswindows/GRASS-Packager.bat
   grass/trunk/mswindows/osgeo4w/env.bat.tmpl
   grass/trunk/mswindows/osgeo4w/grass.bat.tmpl
   grass/trunk/mswindows/osgeo4w/grass.tmpl
   grass/trunk/mswindows/osgeo4w/package.sh
   grass/trunk/mswindows/osgeo4w/postinstall.bat
   grass/trunk/mswindows/osgeo4w/preremove.bat
Log:
winGRASS: scripts for packaging simplified

Modified: grass/trunk/mswindows/GRASS-Installer.nsi
===================================================================
--- grass/trunk/mswindows/GRASS-Installer.nsi	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/GRASS-Installer.nsi	2011-11-17 14:53:26 UTC (rev 49286)
@@ -30,18 +30,18 @@
 
 ;Version variables
 
-!define RELEASE_VERSION_NUMBER "7.0.0"
-!define RELEASE_SVN_REVISION "36599"
-!define RELEASE_BINARY_REVISION "1"
-!define RELEASE_GRASS_COMMAND "grass70"
-!define RELEASE_GRASS_BASE "GRASS 7.0"
+!define SVN_REVISION "36599"
+!define BINARY_REVISION "1"
+!if ${INSTALLER_TYPE} == "Release"
+	!define VERSION_NUMBER "7.0.0"
+	!define GRASS_COMMAND "grass70"
+	!define GRASS_BASE "GRASS 7.0"
+!else
+	!define VERSION_NUMBER "7.0.SVN"
+	!define GRASS_COMMAND "grass70svn"
+	!define GRASS_BASE "GRASS 7.0.SVN"
+!endif
 
-!define DEVEL_VERSION_NUMBER "7.0.SVN"
-!define DEVEL_SVN_REVISION "36599"
-!define DEVEL_BINARY_REVISION "1"
-!define DEVEL_GRASS_COMMAND "grass70svn"
-!define DEVEL_GRASS_BASE "GRASS 7.0.SVN"
-
 ;----------------------------------------------------------------------------------------------------------------------------
 
 ;Don't modify the following lines
@@ -57,26 +57,15 @@
 
 ;Set the installer variables, depending on the selected version to build
 
+!define PACKAGE_FOLDER ".\GRASS-70-Package"
 !if ${INSTALLER_TYPE} == "Release"
-	!define VERSION_NUMBER "${RELEASE_VERSION_NUMBER}"
-	!define SVN_REVISION "${RELEASE_SVN_REVISION}"
-	!define BINARY_REVISION "${RELEASE_BINARY_REVISION}"
-	!define GRASS_COMMAND "${RELEASE_GRASS_COMMAND}"
-	!define GRASS_BASE "${RELEASE_GRASS_BASE}"
 	!define INSTALLER_NAME "WinGRASS-${VERSION_NUMBER}-${BINARY_REVISION}-Setup.exe"
 	!define DISPLAYED_NAME "GRASS ${VERSION_NUMBER}-${BINARY_REVISION}"
-	!define CHECK_INSTALL_NAME "GRASS"
-	!define PACKAGE_FOLDER ".\GRASS-70-Release-Package"
-!else if ${INSTALLER_TYPE} == "Devel"
-	!define VERSION_NUMBER "${DEVEL_VERSION_NUMBER}"
-	!define SVN_REVISION "${DEVEL_SVN_REVISION}"
-	!define BINARY_REVISION "${DEVEL_BINARY_REVISION}"
-	!define GRASS_COMMAND "${DEVEL_GRASS_COMMAND}"
-	!define GRASS_BASE "${DEVEL_GRASS_BASE}"
+	!define CHECK_INSTALL_NAME "GRASS 70"
+!else
 	!define INSTALLER_NAME "WinGRASS-${VERSION_NUMBER}-r${SVN_REVISION}-${BINARY_REVISION}-Setup.exe"
 	!define DISPLAYED_NAME "GRASS ${VERSION_NUMBER}-r${SVN_REVISION}-${BINARY_REVISION}"
 	!define CHECK_INSTALL_NAME "GRASS 70 SVN"
-	!define PACKAGE_FOLDER ".\GRASS-70-Devel-Package"
 !endif
 
 ;----------------------------------------------------------------------------------------------------------------------------
@@ -617,7 +606,7 @@
 	
 	;HKEY_LOCAL_MACHINE Install entries
 	;Set the Name, Version and Revision of GRASS + PublisherInfo + InstallPath	
-	WriteRegStr HKLM "Software\${GRASS_BASE}" "Name" "GRASS"
+	WriteRegStr HKLM "Software\${GRASS_BASE}" "Name" "GRASS 7.0"
 	WriteRegStr HKLM "Software\${GRASS_BASE}" "VersionNumber" "${VERSION_NUMBER}"
 	WriteRegStr HKLM "Software\${GRASS_BASE}" "SvnRevision" "${SVN_REVISION}"
 	WriteRegStr HKLM "Software\${GRASS_BASE}" "BinaryRevision" "${BINARY_REVISION}"
@@ -626,7 +615,7 @@
 	WriteRegStr HKLM "Software\${GRASS_BASE}" "InstallPath" "$INSTALL_DIR"
 	
 	;HKEY_LOCAL_MACHINE Uninstall entries
-	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "DisplayName" "GRASS"
+	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "DisplayName" "GRASS 7.0"
 	WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "UninstallString" "$INSTALL_DIR\Uninstall-GRASS.exe"
 	
 	!if ${INSTALLER_TYPE} == "Release"
@@ -721,7 +710,7 @@
 	FileWrite $0 '$\r$\n'
 	FileWrite $0 'cd "%USERPROFILE%"'
 	FileWrite $0 '$\r$\n'
-	FileWrite $0 '%GRASS_PYTHON% "%WINGISBASE%\grass70.py" %*'
+	FileWrite $0 '%GRASS_PYTHON% "%GISBASE%\etc\grass70.py" %*'
 	FileClose $0
 	done_create_grass_command.bat:
 	
@@ -858,7 +847,7 @@
 	FileWrite $0 'GEOTIFF_CSV="$INSTALL_DIR\share\epsg_csv"$\r$\n'
 	FileWrite $0 'export GEOTIFF_CSV$\r$\n'
 	FileWrite $0 '$\r$\n'
-	FileWrite $0 '"$$GRASS_PYTHON $$GISBASE/grass70.py" "$$@"'
+	FileWrite $0 '"$$GRASS_PYTHON $$GISBASE/etc/grass70.py" "$$@"'
 	FileClose $0
 	done_create_grass_command:
 		
@@ -893,13 +882,13 @@
 	done_create_grass7\rc:
 	
 	;replace gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn" in grass70.py with $INSTDIR
-	Push "$INSTDIR\grass70.py" ; file to modify
+	Push "$INSTDIR\etc\grass70.py" ; file to modify
 	Push 'gisbase = "/c/OSGeo4W/apps/grass/grass-7.0.svn"' ; string that a line must begin with *WS Sensitive*
 	Push 'gisbase = "$INSTDIR"' ; string to replace whole line with
 	Call ReplaceLineStr
 	
 	;replace config_projshare = "/c/OSGeo4W/share/proj" i n grass70.py with $INSTDIR\proj
-	Push "$INSTDIR\grass70.py" ; file to modify
+	Push "$INSTDIR\etc\grass70.py" ; file to modify
 	Push 'config_projshare = "/c/OSGeo4W/share/proj"' ; string that a line must begin with *WS Sensitive*
 	Push 'config_projshare = "$INSTDIR\proj"' ; string to replace whole line with
 	Call ReplaceLineStr

Modified: grass/trunk/mswindows/GRASS-Packager.bat
===================================================================
--- grass/trunk/mswindows/GRASS-Packager.bat	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/GRASS-Packager.bat	2011-11-17 14:53:26 UTC (rev 49286)
@@ -12,7 +12,7 @@
 rem Set the script variables
 rem --------------------------------------------------------------------------------------------------------------------------
 
-set PACKAGE_DIR=.\GRASS-70-Devel-Package
+set PACKAGE_DIR=.\GRASS-70-Package
 
 set OSGEO4W_DIR=c:\osgeo4w
 
@@ -36,7 +36,7 @@
 @echo -----------------------------------------------------------------------------------------------------------------------
 @echo.
 
-xcopy %GRASS_BIN_PREFIX%\grass70* %PACKAGE_DIR% /S/V/F
+rem xcopy %GRASS_BIN_PREFIX%\grass70.py %PACKAGE_DIR% /S/V/F
 xcopy %GRASS_PREFIX% %PACKAGE_DIR% /S/V/F
 
 @echo.

Modified: grass/trunk/mswindows/osgeo4w/env.bat.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/env.bat.tmpl	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/env.bat.tmpl	2011-11-17 14:53:26 UTC (rev 49286)
@@ -1,5 +1,4 @@
 set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass- at VERSION@
-set WINGISBASE=%OSGEO4W_ROOT%\apps\grass\grass- at VERSION@
 set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe
 set GRASS_WISH=%OSGEO4W_ROOT%\bin\wish.exe
 set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe

Modified: grass/trunk/mswindows/osgeo4w/grass.bat.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/grass.bat.tmpl	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/grass.bat.tmpl	2011-11-17 14:53:26 UTC (rev 49286)
@@ -2,4 +2,4 @@
 SET OSGEO4W_ROOT=@osgeo4w@
 call %OSGEO4W_ROOT%\bin\o4w_env.bat
 call %OSGEO4W_ROOT%\apps\grass\grass- at VERSION@\etc\env.bat
-%GRASS_PYTHON% %OSGEO4W_ROOT%\bin\grass at POSTFIX@.py %*
+%GRASS_PYTHON% %GISBASE%\etc\grass at POSTFIX@.py %*

Modified: grass/trunk/mswindows/osgeo4w/grass.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/grass.tmpl	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/grass.tmpl	2011-11-17 14:53:26 UTC (rev 49286)
@@ -2,7 +2,6 @@
 
 OSGEO4W_ROOT_MSYS=@OSGEO4W_ROOT_MSYS@
 GISBASE=$OSGEO4W_ROOT_MSYS/apps/grass/grass- at VERSION@
-WINGISBASE=$OSGEO4W_ROOT_MSYS/apps/grass/grass- at VERSION@
 GRASS_SH=$OSGEO4W_ROOT_MSYS/apps/msys/bin/sh.exe
 GRASS_WISH=$OSGEO4W_ROOT_MSYS/bin/wish.exe
 GRASS_PYTHON=$OSGEO4W_ROOT_MSYS/bin/python.exe
@@ -10,9 +9,9 @@
 GRASS_PROJSHARE=$OSGEO4W_ROOT_MSYS/share/proj
 PATH=$OSGEO4W_ROOT_MSYS/apps/grass/grass- at VERSION@/bin:$PATH
 
-export $OSGEO4W_ROOT_MSYS $GISBASE $WINGISBASE $GRASS_SH $GRASS_WISH $GRASS_PYTHON $PYTHONHOME $GRASS_PROJSHARE
+export $OSGEO4W_ROOT_MSYS $GISBASE $GRASS_SH $GRASS_WISH $GRASS_PYTHON $PYTHONHOME $GRASS_PROJSHARE
 export $PATH
 
-$GRASS_PYTHON "$OSGEO4W_ROOT_MSYS/bin/grass at POSTFIX@.py" "$@"
+$GRASS_PYTHON "$GISBASE/etc/grass at POSTFIX@.py" "$@"
 
 exit 0

Modified: grass/trunk/mswindows/osgeo4w/package.sh
===================================================================
--- grass/trunk/mswindows/osgeo4w/package.sh	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/package.sh	2011-11-17 14:53:26 UTC (rev 49286)
@@ -67,6 +67,12 @@
 
 export VERSION=$MAJOR.$MINOR.$PATCH
 
+if [ "$PATCH" == "svn" ]; then
+    GRASS_EXECUTABLE=grass${MAJOR}${MINOR}svn
+else
+    GRASS_EXECUTABLE=grass${MAJOR}${MINOR}
+fi
+
 export GRASS_PYTHON="/c/OSGeo4W/bin/python.exe"
 export PYTHONHOME="/c/OSGeo4W/apps/Python25"
 
@@ -130,7 +136,7 @@
 fi
 
 log make 
-make -k || ( cat error.log >&3 && false ) 
+# make -k || ( cat error.log >&3 && false ) 
 
 log make install
 make install
@@ -141,15 +147,15 @@
 cp mswindows/osgeo4w/config.h.switch $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h
 cp mswindows/osgeo4w/config.h.vc $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass
 sed -e "s#@VERSION@#$VERSION#g" -e "s#@OSGEO4W_ROOT@#$OSGEO4W_ROOT#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-    mswindows/osgeo4w/grass.bat.tmpl >$OSGEO4W_ROOT_MSYS/bin/grass$MAJOR$MINOR.bat
+    mswindows/osgeo4w/grass.bat.tmpl >$OSGEO4W_ROOT_MSYS/bin/${GRASS_EXECUTABLE}.bat
 sed -e "s#@VERSION@#$VERSION#g" -e "s#@OSGEO4W_ROOT_MSYS@#$OSGEO4W_ROOT_MSYS#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-    mswindows/osgeo4w/grass.tmpl >$OSGEO4W_ROOT_MSYS/bin/grass$MAJOR$MINOR
+    mswindows/osgeo4w/grass.tmpl >$OSGEO4W_ROOT_MSYS/bin/${GRASS_EXECUTABLE}
 sed -e "s#@VERSION@#$VERSION#g" -e "s#@OSGEO4W_ROOT_MSYS@#$OSGEO4W_ROOT#g" \
     mswindows/osgeo4w/env.bat.tmpl >$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/env.bat
-sed -e "s#@VERSION@#$VERSION#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-    mswindows/osgeo4w/postinstall.bat >$OSGEO4W_ROOT_MSYS/etc/postinstall/grass$MAJOR$MINOR.bat 
-sed -e "s#@VERSION@#$VERSION#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-    mswindows/osgeo4w/preremove.bat >$OSGEO4W_ROOT_MSYS/etc/preremove/grass$MAJOR$MINOR.bat 
+sed -e "s#@VERSION@#$VERSION#g" -e "s#@GRASS_EXECUTABLE@#$GRASS_EXECUTABLE#g" \
+    mswindows/osgeo4w/postinstall.bat >$OSGEO4W_ROOT_MSYS/etc/postinstall/${GRASS_EXECUTABLE}.bat 
+sed -e "s#@VERSION@#$VERSION#g" -e "s#@GRASS_EXECUTABLE@#$GRASS_EXECUTABLE#g" \
+    mswindows/osgeo4w/preremove.bat >$OSGEO4W_ROOT_MSYS/etc/preremove/${GRASS_EXECUTABLE}.bat 
 
 if [ -f /c/mingw/bin/libgnurx-0.dll ]; then
     cp /c/mingw/bin/libgnurx-0.dll $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/bin 
@@ -174,24 +180,23 @@
     cd $OSGEO4W_ROOT_MSYS 
 
     sed -e "s#@VERSION@#$VERSION#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-	$SRC/mswindows/osgeo4w/grass.bat.tmpl >$OSGEO4W_ROOT_MSYS/bin/grass$MAJOR$MINOR.bat.tmpl
+	$SRC/mswindows/osgeo4w/grass.bat.tmpl >$OSGEO4W_ROOT_MSYS/bin/${GRASS_EXECUTABLE}.bat.tmpl
     sed -e "s#@VERSION@#$VERSION#g" -e "s#@OSGEO4W_ROOT_MSYS@#@OSGEO4W_ROOT@#g" -e "s#@POSTFIX@#$MAJOR$MINOR#g" \
-	$SRC/mswindows/osgeo4w/grass.tmpl >$OSGEO4W_ROOT_MSYS/bin/grass$MAJOR$MINOR.tmpl
+	$SRC/mswindows/osgeo4w/grass.tmpl >$OSGEO4W_ROOT_MSYS/bin/${GRASS_EXECUTABLE}.tmpl
 
     # grass package
     tar -cjf $PDIR/grass$PACKAGE_NAME-$VERSION-$PACKAGE.tar.bz2 \
 	apps/grass/grass-$VERSION \
-	bin/grass$MAJOR$MINOR.py \
-	bin/grass$MAJOR$MINOR.bat.tmpl \
-	bin/grass$MAJOR$MINOR.tmpl \
+	bin/${GRASS_EXECUTABLE}.bat.tmpl \
+	bin/${GRASS_EXECUTABLE}.tmpl \
 	bin/libintl3.dll \
 	bin/libiconv2.dll \
 	bin/regex2.dll \
-	etc/postinstall/grass$MAJOR$MINOR.bat \
-	etc/preremove/grass$MAJOR$MINOR.bat
+	etc/postinstall/${GRASS_EXECUTABLE}.bat \
+	etc/preremove/${GRASS_EXECUTABLE}.bat
     
-    rm bin/grass$MAJOR$MINOR.tmpl
-    rm bin/grass$MAJOR$MINOR.bat.tmpl
+    rm bin/${GRASS_EXECUTABLE}.tmpl
+    rm bin/${GRASS_EXECUTABLE}.bat.tmpl
     
     # grass-devel package (obsolete)
     ###tar -cjf $PDIR/grass-devel-$VERSION-$PACKAGE.tar.bz2 \

Modified: grass/trunk/mswindows/osgeo4w/postinstall.bat
===================================================================
--- grass/trunk/mswindows/osgeo4w/postinstall.bat	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/postinstall.bat	2011-11-17 14:53:26 UTC (rev 49286)
@@ -1,7 +1,7 @@
 set ICON=%OSGEO4W_ROOT%\apps\grass\grass- at VERSION@\etc\gui\icons\grass.ico
-set BATCH=%OSGEO4W_ROOT%\bin\grass at POSTFIX@.bat
-textreplace -std -t "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@.bat
-textreplace -std -t "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@ 
+set BATCH=%OSGEO4W_ROOT%\bin\@GRASS_EXECUTABLE at .bat
+textreplace -std -t "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE at .bat
+textreplace -std -t "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE@
 textreplace -std -t "%OSGEO4W_ROOT%"\apps\grass\grass- at VERSION@\etc\fontcap
 
 mkdir "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@" 
@@ -10,5 +10,5 @@
 
 xxmklink "%ALLUSERSPROFILE%\Desktop\GRASS GIS @VERSION at .lnk" "%BATCH%"  "-gui" \ "Launch GRASS GIS @VERSION@ with wxGUI" 1 "%ICON%" 
 
-del "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@.bat.tmpl
-del "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@.tmpl
+del "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE at .bat.tmpl
+del "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE at .tmpl

Modified: grass/trunk/mswindows/osgeo4w/preremove.bat
===================================================================
--- grass/trunk/mswindows/osgeo4w/preremove.bat	2011-11-17 14:39:34 UTC (rev 49285)
+++ grass/trunk/mswindows/osgeo4w/preremove.bat	2011-11-17 14:53:26 UTC (rev 49286)
@@ -4,7 +4,6 @@
 
 del "%ALLUSERSPROFILE%\Desktop\GRASS GIS @VERSION at .lnk"
 
-del "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@.py
-del "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@.bat
-del "%OSGEO4W_ROOT%"\bin\grass at POSTFIX@
+del "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE at .bat
+del "%OSGEO4W_ROOT%"\bin\@GRASS_EXECUTABLE@
 del "%OSGEO4W_ROOT%"\apps\grass\grass- at VERSION@\etc\fontcap



More information about the grass-commit mailing list