GRASS-Packager.bat.tmpl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. rem -----------------------------------------------------------------------------------------------------------------------
  2. rem Self Contained GRASS Automated Packager
  3. rem -----------------------------------------------------------------------------------------------------------------------
  4. rem Edited by: Marco Pasetti
  5. rem Revised for OSGeo4W by: Colin Nielsen, Helmut Kudrnovsky, and Martin Landa
  6. rem Last Update: $Id$
  7. rem -----------------------------------------------------------------------------------------------------------------------
  8. @echo off
  9. rem --------------------------------------------------------------------------------------------------------------------------
  10. rem Set the script variables
  11. rem --------------------------------------------------------------------------------------------------------------------------
  12. set PACKAGE_DIR=.\GRASS-@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@-Package
  13. set OSGEO4W_BLD_DIR=C:\OSGeo4W
  14. if exist C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@ (
  15. set OSGEO4W_PKG_DIR=C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@
  16. ) else (
  17. set OSGEO4W_PKG_DIR=C:\OSGeo4W
  18. )
  19. set MSYS_BLD_DIR=C:\msys64\mingw64
  20. set GRASS_PREFIX=%OSGEO4W_BLD_DIR%\apps\grass\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@
  21. @echo.
  22. @echo -----------------------------------------------------------------------------------------------------------------------
  23. @echo Remove the previous package and create a new PACKAGE_DIR
  24. @echo -----------------------------------------------------------------------------------------------------------------------
  25. @echo.
  26. if exist %PACKAGE_DIR% rmdir /S/Q %PACKAGE_DIR%
  27. mkdir %PACKAGE_DIR%
  28. @echo.
  29. @echo -----------------------------------------------------------------------------------------------------------------------
  30. @echo Copy %GRASS_PREFIX% content to PACKAGE_DIR
  31. @echo -----------------------------------------------------------------------------------------------------------------------
  32. @echo.
  33. xcopy %GRASS_PREFIX% %PACKAGE_DIR% /S/V/F/I
  34. @echo.
  35. @echo -----------------------------------------------------------------------------------------------------------------------
  36. @echo Copy extrabins to PACKAGE_DIR\extrabin
  37. @echo -----------------------------------------------------------------------------------------------------------------------
  38. @echo.
  39. mkdir %PACKAGE_DIR%\extrabin
  40. mkdir %PACKAGE_DIR%\extrabin\gdalplugins
  41. copy %OSGEO4W_PKG_DIR%\bin\* %PACKAGE_DIR%\extrabin
  42. xcopy %OSGEO4W_PKG_DIR%\bin\gdalplugins\* %PACKAGE_DIR%\extrabin\gdalplugins /S/V/F/I
  43. rem msvcrt2019
  44. del %PACKAGE_DIR%\extrabin\*140*.dll
  45. @echo.
  46. @echo -----------------------------------------------------------------------------------------------------------------------
  47. @echo Copy 'Windows batchfiles for use with R' (GRASS-R-integration) from source to PACKAGE_DIR\extrabin
  48. @echo -----------------------------------------------------------------------------------------------------------------------
  49. @echo.
  50. copy .\external\rbatch\* %PACKAGE_DIR%\extrabin
  51. @echo.
  52. @echo -----------------------------------------------------------------------------------------------------------------------
  53. @echo Copy shared PROJ.4 files to PACKAGE_DIR\proj
  54. @echo -----------------------------------------------------------------------------------------------------------------------
  55. @echo.
  56. if not exist "%PACKAGE_DIR%\share" mkdir %PACKAGE_DIR%\share
  57. mkdir %PACKAGE_DIR%\share\proj
  58. xcopy %OSGEO4W_PKG_DIR%\share\proj %PACKAGE_DIR%\share\proj /S/V/F/I
  59. @echo.
  60. @echo -----------------------------------------------------------------------------------------------------------------------
  61. @echo Copy shared GDAL files to PACKAGE_DIR\share\gdal
  62. @echo -----------------------------------------------------------------------------------------------------------------------
  63. @echo.
  64. mkdir %PACKAGE_DIR%\share\gdal
  65. xcopy %OSGEO4W_PKG_DIR%\share\gdal %PACKAGE_DIR%\share\gdal /S/V/F/I
  66. @echo.
  67. @echo -----------------------------------------------------------------------------------------------------------------------
  68. @echo Copy Python content to PACKAGE_DIR\Python3
  69. @echo -----------------------------------------------------------------------------------------------------------------------
  70. @echo.
  71. mkdir %PACKAGE_DIR%\Python39
  72. xcopy %OSGEO4W_PKG_DIR%\apps\Python39\* %PACKAGE_DIR%\Python39 /S/V/F/I
  73. @echo.
  74. @echo -----------------------------------------------------------------------------------------------------------------------
  75. @echo Copy env.bat
  76. @echo -----------------------------------------------------------------------------------------------------------------------
  77. @echo.
  78. copy env.bat %PACKAGE_DIR%\etc
  79. @echo.
  80. @echo -----------------------------------------------------------------------------------------------------------------------
  81. @echo Packaging Completed
  82. @echo -----------------------------------------------------------------------------------------------------------------------
  83. @echo.