Skip to content

Commit 63ecdd7

Browse files
committed
windows packaging updates
1 parent 62714a8 commit 63ecdd7

8 files changed

+136
-22
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,4 @@ scripts/astyle.exe
3737
doc/CODING.html
3838
doc/CODING.tex
3939
doc/INSTALL.tex
40+
scripts/RelWithDebInfo

CMakeLists.txt

+15-6
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,21 @@ ELSE (SVN_MARKER)
472472
IF (GIT_MARKER)
473473
FIND_PROGRAM(GIT git PATHS c:/cygwin/bin)
474474
IF(GIT)
475-
ADD_CUSTOM_COMMAND(
476-
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
477-
COMMAND echo \\\#define QGSSVNVERSION \\\"$$\( ${GIT} log -n1 --grep='git-svn-id' | sed -ne 's/^ *git-svn-id:.*@\\\([0-9]*\\\).*$$/\\1/p' \)$$\( ${GIT} log --oneline $$\( ${GIT} log -n1 --grep='git-svn-id' --pretty=%H \).. | wc -l | sed -e 's/^/+/' -e 's/+0$$//' \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
478-
MAIN_DEPENDENCY ${GIT_MARKER}
479-
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
480-
)
475+
IF(MSVC)
476+
ADD_CUSTOM_COMMAND(
477+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
478+
COMMAND for /f \"usebackq tokens=1\" %%a in "(`\"${GIT}\" log -n1 --oneline`)" do echo \#define QGSSVNVERSION \"%%a\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
479+
MAIN_DEPENDENCY ${GIT_MARKER}
480+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
481+
)
482+
ELSE(MSVC)
483+
ADD_CUSTOM_COMMAND(
484+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
485+
COMMAND echo \\#define QGSSVNVERSION \\\"$$\( ${GIT} log -n1 --pretty=%h \)\\\" >${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h
486+
MAIN_DEPENDENCY ${GIT_MARKER}
487+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
488+
)
489+
ENDIF(MSVC)
481490
ELSE(GIT)
482491
MESSAGE(STATUS "git marker, but no git found - version will be unknown")
483492
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/qgssvnversion.h "#define QGSSVNVERSION \"unknown\"")

ms-windows/osgeo4w/httpd.conf.tmpl

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
LoadModule fcgid_module modules/mod_fcgid.so
2+
3+
DefaultInitEnv PATH "@osgeo4w@\bin;@osgeo4w@\apps\@package@\bin;@osgeo4w@\apps\grass\grass-@grassversion@\bin;@osgeo4w@\apps\grass\grass-@grassversion@\lib;@windir@\system32;@windir@;@windir@\System32\Wbem"
4+
DefaultInitEnv QGIS_PREFIX_PATH "@osgeo4w@\apps\qgis"
5+
DefaultInitEnv TEMP "@temp@"
6+
7+
Alias /qgis/ @osgeo4w@/apps/qgis/bin/
8+
9+
<Directory "@osgeo4w@/apps/qgis/bin/">
10+
SetHandler fcgid-script
11+
Options ExecCGI
12+
Order allow,deny
13+
Allow from all
14+
</Directory>

ms-windows/osgeo4w/package.cmd

+100-16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
@echo off
22
set GRASS_VERSION=6.4.1
3-
set SVNVERSION=c:/cygwin/bin/svnversion
43

54
set BUILDDIR=%CD%\build
65
REM set BUILDDIR=%TEMP%\qgis_unstable
@@ -47,6 +46,8 @@ set SRCDIR=%CD%
4746
if "%BUILDDIR:~1,1%"==":" %BUILDDIR:~0,2%
4847
cd %BUILDDIR%
4948

49+
if exist repackage goto package
50+
5051
if not exist build.log goto build
5152

5253
REM
@@ -110,7 +111,6 @@ cmake -G "Visual Studio 9 2008" ^
110111
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG" ^
111112
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
112113
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
113-
-D SVNVERSION="%SVNVERSION%" ^
114114
%SRCDIR%>>%LOG% 2>&1
115115
if errorlevel 1 goto error
116116

@@ -132,13 +132,17 @@ echo INSTALL: %DATE% %TIME%>>%LOG% 2>&1
132132
%DEVENV% qgis%VERSION%.sln /Project INSTALL /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
133133
if errorlevel 1 goto error
134134

135+
:package
135136
echo PACKAGE: %DATE% %TIME%>>%LOG% 2>&1
136137

137138
cd ..
138-
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
139-
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
139+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-desktop.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
140+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-desktop.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
140141
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%.bat.tmpl
141142
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.reg.tmpl >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.reg.tmpl
143+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-server.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%-server.bat
144+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-server.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%-server.bat
145+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' httpd.conf.tmpl >%OSGEO4W_ROOT%\httpd.d\httpd_%PACKAGENAME%.conf.tmpl
142146

143147
REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py.tmpl
144148
REM if errorlevel 1 goto error
@@ -147,21 +151,89 @@ REM del %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py
147151

148152
touch exclude
149153

154+
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 ^
155+
--exclude-from exclude ^
156+
--exclude "*.pyc" ^
157+
"apps/%PACKAGENAME%/bin/Microsoft.VC90.CRT.manifest" ^
158+
"apps/%PACKAGENAME%/bin/msvcm90.dll" ^
159+
"apps/%PACKAGENAME%/bin/msvcp90.dll" ^
160+
"apps/%PACKAGENAME%/bin/msvcr90.dll" ^
161+
"apps/%PACKAGENAME%/bin/qgispython.dll" ^
162+
"apps/%PACKAGENAME%/bin/qgis_analysis.dll" ^
163+
"apps/%PACKAGENAME%/bin/qgis_core.dll" ^
164+
"apps/%PACKAGENAME%/bin/qgis_gui.dll" ^
165+
"apps/%PACKAGENAME%/doc/" ^
166+
"apps/%PACKAGENAME%/plugins/delimitedtextprovider.dll" ^
167+
"apps/%PACKAGENAME%/plugins/diagramoverlay.dll" ^
168+
"apps/%PACKAGENAME%/plugins/gdalprovider.dll" ^
169+
"apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^
170+
"apps/%PACKAGENAME%/plugins/memoryprovider.dll" ^
171+
"apps/%PACKAGENAME%/plugins/ogrprovider.dll" ^
172+
"apps/%PACKAGENAME%/plugins/osmprovider.dll" ^
173+
"apps/%PACKAGENAME%/plugins/postgresprovider.dll" ^
174+
"apps/%PACKAGENAME%/plugins/spatialiteprovider.dll" ^
175+
"apps/%PACKAGENAME%/plugins/sqlanywhereprovider.dll" ^
176+
"apps/%PACKAGENAME%/plugins/qgissqlanyconnection.dll" ^
177+
"apps/%PACKAGENAME%/plugins/wfsprovider.dll" ^
178+
"apps/%PACKAGENAME%/plugins/wmsprovider.dll" ^
179+
"apps/%PACKAGENAME%/resources/qgis.db" ^
180+
"apps/%PACKAGENAME%/resources/spatialite.db" ^
181+
"apps/%PACKAGENAME%/resources/srs.db" ^
182+
"apps/%PACKAGENAME%/resources/symbology-ng-style.xml" ^
183+
"apps/%PACKAGENAME%/svg/" ^
184+
>>%LOG% 2>&1
185+
if errorlevel 1 goto error
186+
187+
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 ^
188+
--exclude-from exclude ^
189+
--exclude "*.pyc" ^
190+
"apps/%PACKAGENAME%/bin/qgis_mapserv.fcgi.exe" ^
191+
"apps/%PACKAGENAME%/bin/admin.sld" ^
192+
"apps/%PACKAGENAME%/bin/wms_metadata.xml" ^
193+
"httpd.d/httpd_%PACKAGENAME%.conf.tmpl" ^
194+
"etc/postinstall/%PACKAGENAME%-server.bat" ^
195+
"etc/preremove/%PACKAGENAME%-server.bat" ^
196+
>>%LOG% 2>&1
197+
if errorlevel 1 goto error
198+
150199
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
151200
--exclude-from exclude ^
152201
--exclude "*.pyc" ^
153-
--exclude "apps/%PACKAGENAME%/themes/classic/grass" ^
154-
--exclude "apps/%PACKAGENAME%/themes/default/grass" ^
155-
--exclude "apps/%PACKAGENAME%/themes/gis/grass" ^
156-
--exclude "apps/%PACKAGENAME%/grass" ^
157-
--exclude "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
158-
--exclude "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
159-
--exclude "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^
160-
--exclude "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^
161-
apps/%PACKAGENAME% ^
162-
bin/%PACKAGENAME%.bat.tmpl ^
163-
etc/postinstall/%PACKAGENAME%.bat ^
164-
etc/preremove/%PACKAGENAME%.bat ^
202+
--exclude apps/%PACKAGENAME%/themes/classic/grass ^
203+
--exclude apps/%PACKAGENAME%/themes/default/grass ^
204+
--exclude apps/%PACKAGENAME%/themes/gis/grass ^
205+
"apps/%PACKAGENAME%/bin/qgis.exe" ^
206+
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
207+
"apps/%PACKAGENAME%/i18n/" ^
208+
"apps/%PACKAGENAME%/icons/" ^
209+
"apps/%PACKAGENAME%/images/" ^
210+
"apps/%PACKAGENAME%/plugins/coordinatecaptureplugin.dll" ^
211+
"apps/%PACKAGENAME%/plugins/copyrightlabelplugin.dll" ^
212+
"apps/%PACKAGENAME%/plugins/delimitedtextplugin.dll" ^
213+
"apps/%PACKAGENAME%/plugins/displacementplugin.dll" ^
214+
"apps/%PACKAGENAME%/plugins/dxf2shpconverterplugin.dll" ^
215+
"apps/%PACKAGENAME%/plugins/evis.dll" ^
216+
"apps/%PACKAGENAME%/plugins/georefplugin.dll" ^
217+
"apps/%PACKAGENAME%/plugins/gpsimporterplugin.dll" ^
218+
"apps/%PACKAGENAME%/plugins/interpolationplugin.dll" ^
219+
"apps/%PACKAGENAME%/plugins/northarrowplugin.dll" ^
220+
"apps/%PACKAGENAME%/plugins/offlineeditingplugin.dll" ^
221+
"apps/%PACKAGENAME%/plugins/oracleplugin.dll" ^
222+
"apps/%PACKAGENAME%/plugins/rasterterrainplugin.dll" ^
223+
"apps/%PACKAGENAME%/plugins/roadgraphplugin.dll" ^
224+
"apps/%PACKAGENAME%/plugins/scalebarplugin.dll" ^
225+
"apps/%PACKAGENAME%/plugins/spatialqueryplugin.dll" ^
226+
"apps/%PACKAGENAME%/plugins/spitplugin.dll" ^
227+
"apps/%PACKAGENAME%/plugins/sqlanywhereplugin.dll" ^
228+
"apps/%PACKAGENAME%/plugins/wfsplugin.dll" ^
229+
"apps/%PACKAGENAME%/qgis_help.exe" ^
230+
"apps/%PACKAGENAME%/python/" ^
231+
"apps/%PACKAGENAME%/resources/context_help/" ^
232+
"apps/%PACKAGENAME%/resources/qgis_help.db" ^
233+
"apps/%PACKAGENAME%/themes/" ^
234+
"bin/%PACKAGENAME%.bat.tmpl" ^
235+
"etc/postinstall/%PACKAGENAME%.bat" ^
236+
"etc/preremove/%PACKAGENAME%.bat" ^
165237
>>%LOG% 2>&1
166238
if errorlevel 1 goto error
167239

@@ -179,12 +251,24 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz
179251
>>%LOG% 2>&1
180252
if errorlevel 1 goto error
181253

254+
tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 ^
255+
--exclude-from exclude ^
256+
--exclude "*.pyc" ^
257+
"apps/%PACKAGENAME%/FindQGIS.cmake" ^
258+
"apps/%PACKAGENAME%/include/" ^
259+
"apps/%PACKAGENAME%/lib/" ^
260+
>>%LOG% 2>&1
261+
if errorlevel 1 goto error
262+
182263
goto end
183264

184265
:error
185266
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
186267
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1
268+
if exist %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2
187269
if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2
270+
if exist %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2
271+
if exist %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2
188272
if exist %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2
189273

190274
:end
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
textreplace -std ^
2+
-map @windir@ "%WINDIR%" ^
3+
-map @temp@ "%TEMP%" ^
4+
-t httpd.d\httpd_@package@.conf
5+
del httpd.d\httpd_@package@.conf.tmpl
File renamed without changes.
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
del "%OSGEO4W_ROOT%"\httpd.d\httpd_@package@.conf

0 commit comments

Comments
 (0)