-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathqgis.spec.template
336 lines (288 loc) · 10.2 KB
/
qgis.spec.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
# vi:syntax=spec
# TODO: Run test suite (see debian/rules)
# Template variables
# - _version
# - _relver
# - _timestamp (optional)
# Force the python interpreter to python3:
# brp-python-bytecompile is unable to identify
# the proper required version of python for
# py files located under /usr/share/qgis/python/plugins
%global __python %{__python3}
%define grass_prefix $(pkg-config --variable=prefix grass)
%if %{_timestamp} > 0
# Epoch is set only when building packages from master
Epoch: %{_timestamp}
%define configure_with_sha -D SHA=%(sha=%{_relver}; echo ${sha##git})
%define combinedversion %{epoch}:%{version}
%define builddate %(date -d @%{_timestamp} '+%a %b %d %Y')
%else
%define combinedversion %{version}
%define builddate %(date '+%a %b %d %Y')
%endif
Name: qgis
Version: %{_version}
Release: %{_relver}%{?dist}
Summary: A user friendly Open Source Geographic Information System
License: GPLv2+
URL: http://www.qgis.org
Source0: http://qgis.org/downloads/%{name}-%{version}.tar.bz2
# Sample configuration files for QGIS server
Source1: %{name}-server-httpd.conf
Source2: %{name}-server-nginx.conf
Source3: %{name}-server-fcgi.socket
Source4: %{name}-server-fcgi.service
Source5: %{name}-server-README.fedora
# MIME definitions
# Based on debian/qgis.xml but excluding already defined or proprietary types
Source6: %{name}-mime.xml
# Compiling stuff
BuildRequires: bison
BuildRequires: clang
BuildRequires: cmake
BuildRequires: expat-devel
BuildRequires: flex
BuildRequires: desktop-file-utils
# Geo stuff
BuildRequires: gdal-devel
%if 0%{?fedora} >= 37
BuildRequires: python3-gdal
%else
BuildRequires: gdal-python3
%endif
BuildRequires: geos-devel
BuildRequires: gsl-devel
BuildRequires: libspatialite-devel
BuildRequires: PDAL
BuildRequires: PDAL-devel
BuildRequires: proj-devel
BuildRequires: spatialindex-devel
BuildRequires: grass-devel
# Other stuff
BuildRequires: exiv2-devel
BuildRequires: gsl-devel
BuildRequires: laszip-devel
BuildRequires: libzip-devel
BuildRequires: libzstd-devel
BuildRequires: postgresql-devel
BuildRequires: sqlite-devel
BuildRequires: hdf5-devel
BuildRequires: netcdf-devel
BuildRequires: fcgi-devel
BuildRequires: protobuf-compiler
BuildRequires: protobuf-devel
BuildRequires: protobuf-lite-devel
BuildRequires: draco-devel
# OpenCL
BuildRequires: opencl-headers
BuildRequires: ocl-icd-devel
# Python stuff
BuildRequires: python3-devel
BuildRequires: python3-jinja2
BuildRequires: python3-OWSLib
BuildRequires: python3-psycopg2
BuildRequires: python3-pygments
BuildRequires: python3-PyYAML
BuildRequires: python3-qscintilla-qt5
BuildRequires: python3-qscintilla-qt5-devel
BuildRequires: python3-qt5-devel
BuildRequires: sip6
BuildRequires: PyQt-builder
# Qca stuff
BuildRequires: qca-qt5-devel
BuildRequires: qca-qt5-ossl
BuildRequires: qscintilla-qt5-devel
# Qt5 stuff
BuildRequires: qt5-qtlocation-devel
BuildRequires: qt5-qtmultimedia-devel
BuildRequires: qt5-qtsvg-devel
BuildRequires: qt5-qttools-static
BuildRequires: qt5-qtwebkit-devel
BuildRequires: qtkeychain-qt5-devel
BuildRequires: qt5-qtserialport-devel
BuildRequires: qt5-qt3d-devel
BuildRequires: qt5-qtbase-private-devel
# Qwt stuff
BuildRequires: qwt-qt5-devel
# GDAL must be explicit. It is required by some raster tools
# like Warp (Reproject) which relies on gdalwarp
Requires: gdal
# Installation of QCA plugins must be explicit
Requires: qca-qt5-ossl
Requires: gpsbabel
Requires: PDAL
Requires: qt5-qtcharts
# We don't want to provide private Python extension libs
%global __provides_exclude_from ^(%{python3_sitearch}|%{_libdir}/%{name}/plugins)/.*\.so(\.%{version})?$
%description
Geographic Information System (GIS) manages, analyzes, and displays
databases of geographic information. QGIS supports shape file
viewing and editing, spatial data storage with PostgreSQL/PostGIS, projection
on-the-fly, map composition, and a number of other features via a plugin
interface. QGIS also supports display of various geo-referenced raster and
Digital Elevation Model (DEM) formats including GeoTIFF, Arc/Info ASCII Grid,
and USGS ASCII DEM.
%package devel
Summary: Development Libraries for the QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
%description devel
Development packages for QGIS including the C header files.
%package grass
Summary: GRASS Support Libraries for QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
# The plug-in requires more than just the grass-libs.
# This questions the sense of the libs package.
# WARNING: Rebuild QGIS whenever a new version of GRASS is shipped! Even though
# the soname might stay the same, it won't work anymore.
# https://github.com/qgis/QGIS/issues/14999
Requires: grass%{?_isa}
%description grass
GRASS plugin for QGIS required to interface with the GRASS system.
%package -n python3-qgis
%{?python_provide:%python_provide python3-qgis}
Provides: %{name}-python = %{combinedversion}-%{release}
Provides: %{name}-python%{?_isa} = %{combinedversion}-%{release}
Summary: Python integration and plug-ins for QGIS
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
%if 0%{?fedora} >= 37
Requires: python3-gdal
%else
Requires: gdal-python3
%endif
Requires: gdal-python-tools
Requires: python3-jinja2
Requires: python3-OWSLib
Requires: python3-psycopg2
Requires: python3-pygments
Requires: python3-PyYAML
Requires: python3-qscintilla-qt5
Requires: python3-qt5
%{?_sip_api:Requires: python3-pyqt5-sip-api(%{_sip_api_major}) >= %{_sip_api}}
%description -n python3-qgis
Python integration and plug-ins for QGIS.
%package server
Summary: FCGI-based OGC web map server
Requires: %{name}%{?_isa} = %{combinedversion}-%{release}
Provides: mapserver = %{version}-%{release}
Obsoletes: mapserver < 2.8.1-1
%description server
This FastCGI OGC web map server implements OGC WMS 1.3.0 and 1.1.1.
The services are prepared as regular projects in QGIS. They're rendered using
the QGIS libraries. The server also supports SLD (Styled Layer Descriptor)
for styling. Sample configurations for HTTPD and Nginx are included.
Please refer to %{name}-server-README.fedora for details!
%prep
%setup -q
# Remove executable permissions from source code files
find . \( -name "*.cpp" -o -name "*.h" \) -type f -perm /111 -execdir chmod -x {} \+
# Readme file for QGIS server configuration HTTPD and Nginx example
install -pm0644 %{SOURCE1} .
install -pm0644 %{SOURCE2} .
install -pm0644 %{SOURCE3} .
install -pm0644 %{SOURCE4} .
install -pm0644 %{SOURCE5} .
gzip ChangeLog
%build
%cmake \
%{_cmake_skip_rpath} \
-D QGIS_LIB_SUBDIR=%{_lib} \
-D QGIS_MANUAL_SUBDIR=/share/man \
-D QGIS_CGIBIN_SUBDIR=%{_libexecdir}/%{name} \
-D WITH_BINDINGS:BOOL=TRUE \
%if 0%{?fedora} >= 36
-D WITH_GRASS8:BOOL=TRUE \
-D GRASS_PREFIX8=%{grass_prefix} \
%else
-D WITH_GRASS7:BOOL=TRUE \
-D GRASS_PREFIX7=%{grass_prefix} \
%endif
-D WITH_CUSTOM_WIDGETS:BOOL=TRUE \
-D BINDINGS_GLOBAL_INSTALL:BOOL=TRUE \
-D ENABLE_TESTS:BOOL=FALSE \
-D WITH_EPT:BOOL=TRUE \
-D WITH_PDAL:BOOL=TRUE \
-D WITH_QSPATIALITE:BOOL=TRUE \
-D WITH_SERVER:BOOL=TRUE \
-D WITH_3D:BOOL=TRUE \
-D USE_OPENCL:BOOL=TRUE \
%{configure_with_sha} \
.
%cmake_build
%install
# Necessary for the test suite
#export LD_LIBRARY_PATH=%{_builddir}%{name}-%{version}/output/%{_lib}
%cmake_install
# Install MIME type definitions
install -d %{buildroot}%{_datadir}/mime/packages
install -pm0644 %{SOURCE6} \
%{buildroot}%{_datadir}/mime/packages/%{name}.xml
# See qgis-server-README.fedora
rm -f %{buildroot}%{_libexecdir}/%{name}/wms_metadata.xml
rm -f %{buildroot}%{_libexecdir}/%{name}/admin.sld
# Remove install instructions
rm -f %{buildroot}%{_datadir}/%{name}/doc/INSTALL*
%find_lang %{name} --with-qt
%files -f %{name}.lang
%doc BUGS NEWS.md Exception_to_GPL_for_Qt.txt ChangeLog.gz
# QGIS shows the following files in the GUI, including the license text
%doc %{_datadir}/%{name}/doc/
%dir %{_datadir}/%{name}/i18n/
%lang(zh-Hans) %{_datadir}/%{name}/i18n/%{name}_zh-Hans.qm
%lang(zh-Hant) %{_datadir}/%{name}/i18n/%{name}_zh-Hant.qm
%{_libdir}/lib%{name}_native.so.*
%{_libdir}/lib%{name}_app.so.*
%{_libdir}/lib%{name}_analysis.so.*
%{_libdir}/lib%{name}_core.so.*
%{_libdir}/lib%{name}_gui.so.*
%{_libdir}/lib%{name}_3d.so.*
%{_libdir}/%{name}/
%{?_qt5_plugindir}/sqldrivers/libqsqlspatialite.so
%{_bindir}/%{name}
%{_bindir}/%{name}_process
%{_mandir}/man1/%{name}.1*
%dir %{_datadir}/%{name}/
%{_datadir}/mime/packages/qgis.xml
%{_datadir}/metainfo/org.qgis.qgis.appdata.xml
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/icons/hicolor/*/mimetypes/*
%{_datadir}/applications/*%{name}.desktop
%{_datadir}/%{name}/images/
%{_datadir}/%{name}/resources/
%{_datadir}/%{name}/svg/
%exclude %{_libdir}/libqgisgrass*.so.*
%exclude %{_libdir}/%{name}/plugins/libplugin_grass*.so
%exclude %{_libdir}/%{name}/plugins/libprovider_grassraster*.so
%exclude %{_libdir}/%{name}/plugins/libprovider_grass*.so
%exclude %{_libdir}/%{name}/server/
%exclude %{_libdir}/%{name}/grass/
%files devel
%{_datadir}/%{name}/FindQGIS.cmake
%{_includedir}/%{name}/
%{_libdir}/lib%{name}*.so
%{?_qt5_plugindir}/designer/libqgis_customwidgets.so*
%files grass
%{_libdir}/lib%{name}grass*.so.*
%{_libdir}/%{name}/plugins/libplugin_grass*.so
%{_libdir}/%{name}/plugins/libprovider_grassraster*.so
%{_libdir}/%{name}/plugins/libprovider_grass*.so
%{_libdir}/%{name}/grass/
%{_datadir}/%{name}/grass/
%files -n python3-qgis
%{_libdir}/libqgispython.so.*
%{_datadir}/%{name}/python/
%{python3_sitearch}/%{name}/
%{python3_sitearch}/PyQt5/uic/widget-plugins/
%exclude %{python3_sitearch}/%{name}/server/
%exclude %{python3_sitearch}/%{name}/_server.so
%files server
%doc %{name}-server-README.fedora
%doc %{name}-server-httpd.conf %{name}-server-nginx.conf %{name}-server-fcgi.socket %{name}-server-fcgi.service
%{_bindir}/%{name}_mapserver
%{_libdir}/%{name}/server/
%{_libdir}/lib%{name}_server.so.*
%{_libexecdir}/%{name}/
%{python3_sitearch}/%{name}/server/
%{python3_sitearch}/%{name}/_server.so
%changelog
* %{builddate} Daniele Viganò <daniele@vigano.me> %{_version}-%{_relver}
- Automatic build