summaryrefslogtreecommitdiff
path: root/gdal.spec
blob: 92e95b8f790c6120404ec93431afb8c0f3456892 (plain)
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
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
%global run_tests 0

%global bashcompletiondir %(pkg-config --variable=compatdir bash-completion)
%global cpuarch 64

%if 0%{?bootstrap}
%global with_mysql 0
%global mysql --without-mysql
%global with_poppler 0
%global poppler --without-poppler
%global with_spatialite 0
%global spatialite --without-spatialite
%else
# https://bugzilla.redhat.com/show_bug.cgi?id=1490492
%global with_mysql 1
%global mysql --with-mysql
# https://bugzilla.redhat.com/show_bug.cgi?id=1490492
%global with_poppler 1
%global poppler --with-poppler
%global with_spatialite 1
%global spatialite "--with-spatialite"
%endif

Name:          gdal
Version:       3.10.1
Release:       3
Summary:       GIS file format library
License:       MIT
URL:           http://www.gdal.org
Source0:       http://download.osgeo.org/gdal/%{version}/gdal-%{version}.tar.xz
Source1:       http://download.osgeo.org/%{name}/%{version}/%{name}autotest-%{version}.tar.gz
# Multilib compatible cpl-config.h header
Source2:       cpl-config.h
# Multilib compatible gdal-config script
Source3:       gdal-config

# Add some utils to the default install target
Patch0:        gdal_utils.patch
Patch1:        gdal_incompatible-pointer-types.patch

BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: gmock-devel

BuildRequires: armadillo-devel
BuildRequires: bison
BuildRequires: cfitsio-devel
BuildRequires: CharLS-devel
BuildRequires: curl-devel
BuildRequires: expat-devel
BuildRequires: freexl-devel
BuildRequires: geos-devel
BuildRequires: giflib-devel
BuildRequires: gtest-devel
BuildRequires: hdf-devel
BuildRequires: hdf5-devel
BuildRequires: json-c-devel
BuildRequires: libdap-devel
BuildRequires: libgeotiff-devel
BuildRequires: libgta-devel
BuildRequires: libjpeg-devel
# BuildRequires: libkml-devel
# BuildRequires: liblerc-devel
BuildRequires: libpng-devel
BuildRequires: libpq-devel
%if %{with_spatialite}
BuildRequires: libspatialite-devel
%endif
BuildRequires: libtiff-devel
BuildRequires: libtirpc-devel
BuildRequires: libwebp-devel
BuildRequires: libzstd-devel
%if 0%{?with_mysql}
BuildRequires: mariadb-connector-c-devel
%endif
BuildRequires: netcdf-devel
BuildRequires: ogdi-devel
BuildRequires: openexr-devel
BuildRequires: openjpeg2-devel
BuildRequires: pcre2-devel
%if 0%{?with_poppler}
BuildRequires: poppler-devel
%endif
BuildRequires: proj-devel >= 5.2.0
BuildRequires: qhull-devel
BuildRequires: sqlite-devel
BuildRequires: swig
BuildRequires: unixODBC-devel
BuildRequires: xerces-c-devel
BuildRequires: xz-devel
BuildRequires: zlib-devel

# Python
BuildRequires: python3-devel
BuildRequires: python3-numpy
BuildRequires: python3-setuptools
BuildRequires: python3-pytest >= 3.6
BuildRequires: python3-lxml >= 4.5.1
BuildRequires: python3-filelock
BuildRequires: python3-pyproj

# Java
# For 'mvn_artifact' and 'mvn_install'
BuildRequires: ant
BuildRequires: java-devel >= 1:1.6.0
BuildRequires: javapackages-local
BuildRequires: jpackage-utils

# Run time dependency for gpsbabel driver
Requires:      gpsbabel
Requires:      %{name}-libs%{?_isa} = %{version}-%{release}


%description
Geospatial Data Abstraction Library (GDAL/OGR) is a cross platform
C++ translator library for raster and vector geospatial data formats.
As a library, it presents a single abstract data model to the calling
application for all supported formats. It also comes with a variety of
useful commandline utilities for data translation and processing.

It provides the primary data access engine for many applications.
GDAL/OGR is the most widely used geospatial data access library.


%package devel
Summary:       Development files for the GDAL file format library
Requires:      %{name}-libs%{?_isa} = %{version}-%{release}

%description devel
This package contains development files for GDAL.


%package libs
Summary:       GDAL file format library
# See frmts/grib/degrib/README.TXT
Provides:      bundled(g2lib) = 1.6.0
Provides:      bundled(degrib) = 2.14

%description libs
This package contains the GDAL file format library.

# No complete java yet in EL8
%package java
Summary:        Java modules for the GDAL file format library
Requires:       jpackage-utils
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description java
The GDAL Java modules provide support to handle multiple GIS file formats.


%package javadoc
Summary:        Javadocs for %{name}
Requires:       jpackage-utils
BuildArch:      noarch

%description javadoc
This package contains the API documentation for %{name}.


%package -n python3-gdal
%{?python_provide:%python_provide python3-gdal}
Summary:        Python modules for the GDAL file format library
Requires:       python3-numpy
Requires:       %{name}-libs%{?_isa} = %{version}-%{release}

%description -n python3-gdal
The GDAL Python 3 modules provide support to handle multiple GIS file formats.


%package python-tools
Summary:        Python tools for the GDAL file format library
Requires:       python3-gdal

%description python-tools
The GDAL Python package provides number of tools for programming and
manipulating GDAL file format library

%prep
%autosetup -N -p1 -n %{name}-%{version}

# Delete bundled libraries
rm -rf frmts/zlib
rm -rf frmts/png/libpng
rm -rf frmts/gif/giflib
rm -rf frmts/jpeg/libjpeg
rm -rf frmts/jpeg/libjpeg12
rm -rf frmts/gtiff/libgeotiff
rm -rf frmts/gtiff/libtiff
rm -rf mrf/LERCV1
rm -rf third_party/LercLib

# Setup autotest directory
tar xf %{SOURCE1}
mv %{name}autotest-%{version} autotest

# Need to patch autotest
# autotest/cpp uses private -O0 where it does not like any level of FORTIFY_SOURCE
sed -i -e 's/-D_FORTIFY_SOURCE=2/%{?_fortify_level_flags}%{!?_fortify_level_flags:-Wp,-D_FORTIFY_SOURCE=2}/g' autotest/cpp/CMakeLists.txt
sed -i "s/ \-O0)/)/g" ./autotest/cpp/CMakeLists.txt

%build
%cmake \
  -DCMAKE_INSTALL_INCLUDEDIR=include/gdal \
  -DGDAL_JAVA_INSTALL_DIR=%{_jnidir}/%{name} \
  -DGDAL_JAVA_JNI_INSTALL_DIR=%{_jnidir}/%{name} \
  -DGDAL_USE_JPEG12_INTERNAL=OFF \
  -DENABLE_DEFLATE64=OFF \
  -DGDAL_USE_LERC_INTERNAL=OFF
%cmake_build

%if %{with mingw}
%mingw_cmake \
  -DBUILD_TESTING=OFF \
  -DCMAKE_INSTALL_INCLUDEDIR=include/gdal \
  -DGDAL_USE_JPEG12_INTERNAL=OFF \
  -DENABLE_DEFLATE64=OFF \
  -DGDAL_USE_LERC_INTERNAL=OFF
%mingw_make_build
%endif


%install
%cmake_install

# List of manpages for python scripts
for file in %{buildroot}%{_bindir}/*.py; do
  if [ -f %{buildroot}%{_mandir}/man1/`basename ${file/.py/.1*}` ]; then
    echo "%{_mandir}/man1/`basename ${file/.py/.1*}`" >> gdal_python_manpages.txt
    echo "%exclude %{_mandir}/man1/`basename ${file/.py/.1*}`" >> gdal_python_manpages_excludes.txt
  fi
done

# Multilib
# - cpl_config.h is arch-dependent (contains various SIZEOF defines)
# - gdal-config stores arch-specific information
mv %{buildroot}%{_includedir}/%{name}/cpl_config.h %{buildroot}%{_includedir}/%{name}/cpl_config-%{cpuarch}.h
cp -a %{SOURCE2} %{buildroot}%{_includedir}/%{name}/cpl_config.h
mv %{buildroot}%{_bindir}/%{name}-config %{buildroot}%{_bindir}/%{name}-config-%{cpuarch}
cp -a %{SOURCE3} %{buildroot}%{_bindir}/%{name}-config


%if 0%{run_tests}
%check
%ctest || :
%endif


%files -f gdal_python_manpages_excludes.txt
%{_bindir}/gdal2tiles
%{_bindir}/gdal2xyz
%{_bindir}/gdal_calc
%{_bindir}/gdal_edit
%{_bindir}/gdal_fillnodata
%{_bindir}/gdal_footprint
%{_bindir}/gdal_merge
%{_bindir}/gdal_pansharpen
%{_bindir}/gdal_polygonize
%{_bindir}/gdal_proximity
%{_bindir}/gdal_retile
%{_bindir}/gdal_sieve
%{_bindir}/gdalattachpct
%{_bindir}/gdalcompare
%{_bindir}/gdalmove
%{_bindir}/ogr_layer_algebra
%{_bindir}/ogrmerge
%{_bindir}/pct2rgb
%{_bindir}/rgb2pct
%{_bindir}/gdal_contour
%{_bindir}/gdal_create
%{_bindir}/gdal_grid
%{_bindir}/gdal_rasterize
%{_bindir}/gdal_translate
%{_bindir}/gdal_viewshed
%{_bindir}/gdaladdo
%{_bindir}/gdalbuildvrt
%{_bindir}/gdaldem
%{_bindir}/gdalenhance
%{_bindir}/gdalinfo
%{_bindir}/gdallocationinfo
%{_bindir}/gdalmanage
%{_bindir}/gdalmdiminfo
%{_bindir}/gdalmdimtranslate
%{_bindir}/gdalsrsinfo
%{_bindir}/gdaltindex
%{_bindir}/gdaltransform
%{_bindir}/gdalwarp
%{_bindir}/gnmanalyse
%{_bindir}/gnmmanage
%{_bindir}/nearblack
%{_bindir}/ogr2ogr
%{_bindir}/ogrinfo
%{_bindir}/ogrlineref
%{_bindir}/ogrtindex
%{_bindir}/sozip
%{_datadir}/bash-completion/completions/*
%exclude %{_datadir}/bash-completion/completions/*.py
%{_mandir}/man1/*
%exclude %{_mandir}/man1/gdal-config.1*
# Python manpages excluded in -f gdal_python_manpages_excludes.txt

%files libs
%license LICENSE.TXT
%doc NEWS.md PROVENANCE.TXT COMMITTERS 
%{_libdir}/libgdal.so.36
%{_libdir}/libgdal.so.36.*
%{_datadir}/%{name}/
%{_libdir}/gdalplugins/

%files devel
%{_bindir}/%{name}-config
%{_bindir}/%{name}-config-%{cpuarch}
%{_includedir}/%{name}/
%{_libdir}/lib%{name}.so
%{_libdir}/cmake/gdal/
%{_libdir}/pkgconfig/%{name}.pc
%{_mandir}/man1/gdal-config.1*

%files -n python3-gdal
%doc swig/python/README.rst
%{python3_sitearch}/GDAL-%{version}-py*.egg-info/
%{python3_sitearch}/osgeo/
%{python3_sitearch}/osgeo_utils/

%files python-tools -f gdal_python_manpages.txt
%{_bindir}/gdal_calc.py
%{_bindir}/gdal_edit.py
%{_bindir}/gdal_fillnodata.py
%{_bindir}/gdal_merge.py
%{_bindir}/gdal_pansharpen.py
%{_bindir}/gdal_polygonize.py
%{_bindir}/gdal_proximity.py
%{_bindir}/gdal_retile.py
%{_bindir}/gdal_sieve.py
%{_bindir}/gdal2tiles.py
%{_bindir}/gdal2xyz.py
%{_bindir}/gdalattachpct.py
%{_bindir}/gdalcompare.py
%{_bindir}/gdalmove.py
%{_bindir}/ogr_layer_algebra.py
%{_bindir}/ogrmerge.py
%{_bindir}/pct2rgb.py
%{_bindir}/rgb2pct.py
%{_datadir}/bash-completion/completions/*.py

%files java
%{_jnidir}/%{name}/gdal-%{version}-sources.jar
%{_jnidir}/%{name}/gdal-%{version}.jar
%{_jnidir}/%{name}/gdal-%{version}.pom
%{_jnidir}/%{name}/libgdalalljni.so

%files javadoc
%{_jnidir}/%{name}/gdal-%{version}-javadoc.jar

%changelog
* Mon Mar 3 2025 laokz <zhangkai@iscas.ac.cn> - 3.10.1-3
- Add riscv64 to gdal-config source

* Thu Feb 27 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.10.1-2
- Fix build error with test job out of memory

* Tue Feb 11 2025 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.10.1-1
- Update to 3.10.1

* Fri Nov 15 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.7.3-2
- Fix gdal-config-64 missing

* Tue Nov 5 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.7.3-1
- Update to 3.7.3
  CheckDependentLibraries.cmake: don't use libjpeg if disabled
  frmts/mrf/CMakeLists.txt: ignore HAVE_JPEGTURBO_DUAL_MODE_8_12 if GDAL_USE_JPEG is OFF
  FindPostgreSQL.cmake: Update the list of released PgSQL versions
  Add support for PoDoFo >= 0.10.0
  Add support for TileDB 2.17
  Fix build with -DRENAME_INTERNAL_SHAPELIB_SYMBOLS=OFF

* Thu Aug 29 2024 Dongxing Wang <dongxing.wang_a@thundersoft.com> - 3.7.2-1
- Update to 3.7.2

* Fri Apr 01 2022 tanyulong <tanyulong@kylinos.cn> - 2.3.1-2
- add config.rpath and remove jasper ,fix compile error

* Fri Oct 8 2021 zhaoshuang <zhaoshuang@uniontech.com> - 2.3.1-1
- Init package