[GRASS-SVN] r39049 - grass/trunk/mswindows/osgeo4w

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Sep 6 13:31:59 EDT 2009


Author: hamish
Date: 2009-09-06 13:31:58 -0400 (Sun, 06 Sep 2009)
New Revision: 39049

Modified:
   grass/trunk/mswindows/osgeo4w/package.sh
Log:
quote path names (may contain spaces);
remove bashisms when using /bin/sh;
remove PWD from PATH(ok?).
  (merge from devbr6 r39046)


Modified: grass/trunk/mswindows/osgeo4w/package.sh
===================================================================
--- grass/trunk/mswindows/osgeo4w/package.sh	2009-09-06 17:07:34 UTC (rev 39048)
+++ grass/trunk/mswindows/osgeo4w/package.sh	2009-09-06 17:31:58 UTC (rev 39049)
@@ -7,8 +7,10 @@
 	exit 1
 fi
 
-export OSGEO4W_ROOT_MSYS=/c/Programme/OSGeo4W
-export PATH=.:/c/mingw/bin:/usr/local/bin:/bin:$OSGEO4W_ROOT_MSYS/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem
+#portable? can we use %PROGRAMFILES% -> $PROGRAMFILES here?
+OSGEO4W_ROOT_MSYS="/c/Programme/OSGeo4W"
+PATH="/c/mingw/bin:/usr/local/bin:/bin:$OSGEO4W_ROOT_MSYS/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem"
+export OSGEO4W_ROOT_MSYS PATH
 
 version() {
 	(
@@ -16,13 +18,13 @@
 		read MINOR
 		read PATCH
 		echo $MAJOR.$MINOR.$PATCH
-	) <include/VERSION
+	) < include/VERSION
 }
 
-export VERSION=$(version)
-export PACKAGE=3
+VERSION=$(version)
+PACKAGE=3
+export VERSION PACKAGE
 
-
 (
 echo
 echo
@@ -70,50 +72,65 @@
 make install
 
 echo $(date): STARTING cleanup
-mv $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib/*.$VERSION.dll $OSGEO4W_ROOT_MSYS/bin
-rm $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib/*.dll
+mv "$OSGEO4W_ROOT_MSYS"/apps/grass/grass-$VERSION/lib/*.$VERSION.dll \
+   "$OSGEO4W_ROOT_MSYS/bin"
+rm "$OSGEO4W_ROOT_MSYS"/apps/grass/grass-$VERSION/lib/*.dll
 
-mv $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h.mingw
-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
-cp mswindows/osgeo4w/grass70.bat.tmpl $OSGEO4W_ROOT_MSYS/bin/grass70.bat.tmpl
-cp mswindows/osgeo4w/ini.bat.tmpl $OSGEO4W_ROOT_MSYS/etc/ini/grass.bat.tmpl
-cp mswindows/osgeo4w/postinstall.bat $OSGEO4W_ROOT_MSYS/etc/postinstall/grass.bat
-cp mswindows/osgeo4w/preremove.bat $OSGEO4W_ROOT_MSYS/etc/preremove/grass.bat
-cp /c/mingw/bin/libgnurx-0.dll $OSGEO_ROOT_MSYS/bin
-cp /c/mingw/bin/libiconv-2.dll $OSGEO_ROOT_MSYS/bin
-cp /c/mingw/bin/libintl-8.dll $OSGEO_ROOT_MSYS/bin
+mv "$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h" \
+   "$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h.mingw"
+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"
+cp mswindows/osgeo4w/grass70.bat.tmpl \
+   "$OSGEO4W_ROOT_MSYS/bin/grass70.bat.tmpl"
+cp mswindows/osgeo4w/ini.bat.tmpl \
+   "$OSGEO4W_ROOT_MSYS/etc/ini/grass.bat.tmpl"
+cp mswindows/osgeo4w/postinstall.bat \
+   "$OSGEO4W_ROOT_MSYS/etc/postinstall/grass.bat"
+cp mswindows/osgeo4w/preremove.bat \
+   "$OSGEO4W_ROOT_MSYS/etc/preremove/grass.bat"
+cp /c/mingw/bin/libgnurx-0.dll "$OSGEO_ROOT_MSYS/bin"
+cp /c/mingw/bin/libiconv-2.dll "$OSGEO_ROOT_MSYS/bin"
+cp /c/mingw/bin/libintl-8.dll "$OSGEO_ROOT_MSYS/bin"
 
-P=$(pwd -W)
-P=${P//\//\\\\}\\\\dist.i686-pc-mingw32
+P="$(pwd -W)"
+#portable? how about dist.amd64-pc-mingw32?
+P="${P//\//\\\\}\\\\dist.i686-pc-mingw32"
 
-sed -e "s#$P#@osgeo4w@#" $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap >$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap.tmpl
-sed -e "s#$P#@osgeo4w_msys@#" $OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70 >$OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70.tmpl
-rm $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap 
+sed -e "s#$P#@osgeo4w@#" "$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap" \
+    > $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap.tmpl
+sed -e "s#$P#@osgeo4w_msys@#" "$OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70" \
+    > $OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70.tmpl
+rm "$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap"
 
 echo $(date): STARTING building vc libraries
-sh mswindows/osgeo4w/mklibs.sh $OSGEO4W_ROOT_MSYS/bin/*.$VERSION.dll
-mv mswindows/osgeo4w/vc/grass*.lib $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib
+sh mswindows/osgeo4w/mklibs.sh "$OSGEO4W_ROOT_MSYS"/bin/*.$VERSION.dll
+mv mswindows/osgeo4w/vc/grass*.lib \
+   "$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib"
 
 set -x
 echo $(date): BUILDING GDAL GRASS plugins
 cmd /c 'mswindows\\osgeo4w\\gdalplugins.cmd $VERSION'
 
 echo $(date): CREATING packages
-mkdir -p package/grass-devel package/grass-devel-mingw package/grass-devel-vc package/grass
+mkdir -p package/grass-devel \
+         package/grass-devel-mingw \
+         package/grass-devel-vc \
+         package/grass
 
-PDIR=$PWD/package
-cd $OSGEO4W_ROOT_MSYS
-tar -cjf $PDIR/grass-devel/grass-devel-$VERSION-$PACKAGE.tar.bz2 \
-	apps/grass/grass-$VERSION/include
+PDIR="$PWD/package"
+cd "$OSGEO4W_ROOT_MSYS"
+tar -cjf "$PDIR/grass-devel/grass-devel-$VERSION-$PACKAGE.tar.bz2" \
+	"apps/grass/grass-$VERSION/include"
 
-tar -cjf $PDIR/grass-devel-mingw/grass-devel-mingw-$VERSION-$PACKAGE.tar.bz2 \
-	apps/grass/grass-$VERSION/lib/libgrass*.a
+tar -cjf "$PDIR/grass-devel-mingw/grass-devel-mingw-$VERSION-$PACKAGE.tar.bz2" \
+	"apps/grass/grass-$VERSION/lib/"libgrass*.a
 
-tar -cjf $PDIR/grass-devel-vc/grass-devel-vc-$VERSION-$PACKAGE.tar.bz2 \
-	apps/grass/grass-$VERSION/lib/*.lib
+tar -cjf "$PDIR/grass-devel-vc/grass-devel-vc-$VERSION-$PACKAGE.tar.bz2" \
+	"apps/grass/grass-$VERSION/"lib/*.lib
 
-tar -cjf $PDIR/grass/grass-$VERSION-$PACKAGE.tar.bz2 \
+tar -cjf "$PDIR/grass/grass-$VERSION-$PACKAGE.tar.bz2" \
 	apps/grass/bin/grass70.tmpl \
 	apps/grass/grass-$VERSION/authors \
 	apps/grass/grass-$VERSION/bin/ \



More information about the grass-commit mailing list