2 # - be reasonable about devel dependencies - you do not need all of them to
3 # use gdal (probably a gdal module or driver shall not imply devel
5 # - rasdaman (--with-rasdaman; http://rasdaman.eecs.jacobs-university.de/trac/rasdaman/wiki/Download)
6 # - libjpeg12 (needs patching to use system one, --with-jpeg12 is not sufficient as of 1.9.2)
7 # - libkml (1.3.0 needed, not released yet)
8 # - wait for newer pcidsk, switch to external again
10 # - additional, proprietary(?) formats support:
11 # - FMEObjects (http://www.safe.com/support/support-resources/fme-downloads/)
12 # - ESRI FileGDBAPI (http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api)
13 # - ECW (http://www.erdas.com/products/ecw/ERDASECWJPEG2000SDK/Details.aspx)
14 # - Kakadu/JPEG2000 (http://www.kakadusoftware.com/)
15 # - MrSID (http://www.lizardtech.com/developer/)
16 # - MSG/EUMETSAT (http://www.eumetsat.int/Home/Main/DataAccess/SupportSoftwareTools/index.htm)
17 # - Oracle/OCI >= 10.0.1 (for georaster); Oracle/OCI >= 8.1.7 (as DB)
18 # - Ingres (--with-ingres=/path)
20 # - DWGdirect (members only? http://www.opendwg.org/)
21 # - ESRI SDE (http://www.esri.com/software/arcgis/arcsde/index.html)
24 %bcond_without armadillo # Armadillo support for faster TPS transform
25 %bcond_without epsilon # EPSILON wavelet compression support
26 %bcond_without gta # GTA format support
27 %bcond_without mysql # MySQL DB support
28 %bcond_without odbc # ODBC DB support
29 %bcond_without opencl # OpenCL (GPU) support
30 %bcond_without openjpeg # OpenJPEG 2 (JPEG2000) support
31 %bcond_with podofo # PDF support via podofo instead of poppler
32 %bcond_without poppler # PDF support via poppler
33 %bcond_without spatialite # SpatiaLite support
34 %bcond_without xerces # Xerces support
35 %bcond_without java # Java and MDB support
36 %bcond_without php # PHP binding
37 %bcond_without ruby # Ruby binding
40 %undefine with_poppler
42 Summary: Geospatial Data Abstraction Library
43 Summary(pl.UTF-8): Biblioteka abstrakcji danych dotyczących powierzchni Ziemi
49 Source0: http://download.osgeo.org/gdal/%{version}/%{name}-%{version}.tar.xz
50 # Source0-md5: f354c614aea76e5630e4edbf06e5c292
51 Patch0: %{name}-perl.patch
52 Patch1: %{name}-python_install.patch
53 Patch2: %{name}-php.patch
54 Patch3: %{name}-fpic.patch
55 Patch4: %{name}-format-security.patch
56 URL: http://www.gdal.org/
57 %{?with_opencl:BuildRequires: OpenCL-devel >= 1.0}
58 %{?with_armadillo:BuildRequires: armadillo-devel}
59 BuildRequires: autoconf >= 2.52
60 BuildRequires: automake
61 BuildRequires: cfitsio-devel
62 BuildRequires: curl-devel
63 BuildRequires: doxygen >= 1.4.2
64 %{?with_epsilon:BuildRequires: epsilon-compressor-devel}
65 BuildRequires: expat-devel >= 1.95.0
66 BuildRequires: freexl-devel >= 1.0
67 BuildRequires: geos-devel >= 2.2.0
68 BuildRequires: giflib-devel >= 4.0
69 BuildRequires: hdf-devel >= 4.0
70 BuildRequires: hdf5-devel
71 BuildRequires: jasper-devel
72 %{?with_java:BuildRequires: jdk}
73 %{?with_java:BuildRequires: jpackage-utils}
74 BuildRequires: libcsf-devel
75 BuildRequires: libdap-devel >= 3.10
76 BuildRequires: libgeotiff-devel >= 1.2.1
77 %{?with_gta:BuildRequires: libgta-devel}
78 BuildRequires: libjpeg-devel >= 6b
79 #BuildRequires: libkml-devel >= 1.3.0
80 BuildRequires: libpng-devel >= 2:1.2.8
81 %{?with_spatialite:BuildRequires: libspatialite-devel}
82 BuildRequires: libstdc++-devel
83 BuildRequires: libtiff-devel >= 4.0
84 BuildRequires: libtool
85 BuildRequires: libuuid-devel
86 BuildRequires: libwebp-devel
87 BuildRequires: libxml2-devel
88 %{?with_mysql:BuildRequires: mysql-devel}
89 BuildRequires: netcdf-devel >= 4.1
90 BuildRequires: ogdi-devel >= 3.1
91 %{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2.0.0-2}
92 #BuildRequires: pcidsk-devel > 0.3
93 BuildRequires: perl-devel
94 %{?with_php:BuildRequires: php-devel}
95 %{?with_podofo:BuildRequires: podofo-devel}
96 %{?with_poppler:BuildRequires: poppler-devel >= 0.24}
97 # ensure it's compiled with PQescapeStringConn support
98 BuildRequires: postgresql-backend-devel >= 8.1.4
99 BuildRequires: postgresql-devel >= 8.1.4
100 BuildRequires: proj-devel >= 4
101 BuildRequires: python-devel >= 1:2.5
102 BuildRequires: python-numpy-devel >= 1:1.0.0
103 BuildRequires: python-setuptools
104 BuildRequires: rpm-pythonprov
105 %{?with_ruby:BuildRequires: rpm-rubyprov}
106 BuildRequires: rpmbuild(macros) >= 1.344
107 %{?with_ruby:BuildRequires: ruby-devel}
108 BuildRequires: sed >= 4.0
109 BuildRequires: sqlite3-devel >= 3.0.0
110 BuildRequires: swig-perl
111 BuildRequires: swig-python >= 1.3
112 %{?with_ruby:BuildRequires: swig-ruby}
113 BuildRequires: texlive-dvips
114 BuildRequires: texlive-latex
115 %{?with_odbc:BuildRequires: unixODBC-devel >= 2.2.15}
116 %{?with_xerces:BuildRequires: xerces-c-devel >= 2.7.0}
117 BuildRequires: xz-devel
118 BuildRequires: zlib-devel >= 1.1.4
119 Requires: freexl >= 1.0
120 Requires: geos >= 2.2.0
121 Requires: libgeotiff >= 1.2.1
122 Requires: libpng >= 2:1.2.8
123 Requires: libtiff >= 4.0
124 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
127 GDAL is a translator library for raster geospatial data formats that
128 is released under an Open Source license. As a library, it presents a
129 single abstract data model to the calling application for all
130 supported formats. The related OGR library (which lives within the
131 GDAL source tree) provides a similar capability for simple features
134 %description -l pl.UTF-8
135 GDAL to biblioteka konwertująca między formatami rastrowych danych
136 dotyczących powierzchni Ziemi, udostępniona na licencji Open Source.
137 Jako biblioteka udostępnia aplikacjom jeden abstrakcyjny model danych
138 do wszystkich obsługiwanych formatów. Powiązana z nią biblioteka OGR
139 (której źródła są dołączone do drzewa źródeł GDAL) daje podobne
140 możliwości dla danych wektorowych.
143 Summary: GDAL library header files
144 Summary(pl.UTF-8): Pliki nagłówkowe biblioteki GDAL
145 Group: Development/Libraries
146 Requires: %{name} = %{version}-%{release}
147 %{?with_opencl:Requires: OpenCL-devel >= 1.0}
148 %{?with_armadillo:Requires: armadillo-devel}
149 Requires: cfitsio-devel
151 %{?with_epsilon:Requires: epsilon-compressor-devel}
152 Requires: expat-devel >= 1.95.0
153 Requires: freexl-devel >= 1.0
154 Requires: geos-devel >= 2.2.0
155 Requires: giflib-devel >= 4.0
156 Requires: hdf-devel >= 4.0
158 Requires: jasper-devel
159 Requires: libcsf-devel
160 Requires: libdap-devel >= 3.10
161 Requires: libgeotiff-devel >= 1.2.1
162 %{?with_gta:Requires: libgta-devel}
163 Requires: libjpeg-devel >= 6b
164 Requires: libpng-devel >= 2:1.2.8
165 %{?with_spatialite:Requires: libspatialite-devel}
166 Requires: libstdc++-devel
167 Requires: libtiff-devel >= 4.0
168 Requires: libuuid-devel
169 Requires: libwebp-devel
170 Requires: libxml2-devel
171 %{?with_mysql:Requires: mysql-devel}
172 Requires: netcdf-devel >= 4
173 Requires: ogdi-devel >= 3.1
174 %{?with_openjpeg:Requires: openjpeg2-devel >= 2.0.0-2}
175 #Requires: pcidsk-devel > 0.3
176 %{?with_podofo:Requires: podofo-devel}
177 %{?with_poppler:Requires: poppler-devel >= 0.24}
178 Requires: postgresql-devel
179 Requires: proj-devel >= 4
180 Requires: sqlite3-devel >= 3.0.0
181 %{?with_odbc:Requires: unixODBC-devel}
182 %{?with_xerces:Requires: xerces-c-devel >= 2.7.0}
184 Requires: zlib-devel >= 1.1.4
187 GDAL library header files.
189 %description devel -l pl.UTF-8
190 Pliki nagłówkowe biblioteki GDAL.
193 Summary: GDAL static libraries
194 Summary(pl.UTF-8): Statyczne biblioteki GDAL
195 Group: Development/Libraries
196 Requires: %{name}-devel = %{version}-%{release}
199 GDAL static libraries.
201 %description static -l pl.UTF-8
202 Statyczne biblioteki GDAL.
204 %package -n perl-gdal
205 Summary: Perl bindings for GDAL
206 Summary(pl.UTF-8): Wiązania Perla do pakietu GDAL
207 Group: Development/Languages/Perl
208 Requires: %{name} = %{version}-%{release}
210 %description -n perl-gdal
211 Perl bindings for GDAL - Geo::GDAL, Geo::OGR and Geo::OSR modules.
213 %description -n perl-gdal -l pl.UTF-8
214 Wiązania Perla do pakietu GDAL - moduły Geo::GDAL, Geo::OGR, Geo::OSR.
217 Summary: PHP bindings for GDAL library
218 Summary(pl.UTF-8): Wiązania PHP do biblioteki GDAL
219 Group: Development/Languages/PHP
220 Requires: %{name} = %{version}-%{release}
221 %{?requires_php_extension}
223 %description -n php-gdal
224 PHP bindings for GDAL library
226 %description -n php-gdal -l pl.UTF-8
227 Wiązania PHP do biblioteki GDAL.
229 %package -n python-gdal
230 Summary: GDAL Python module
231 Summary(pl.UTF-8): Moduł Pythona GDAL
232 Group: Libraries/Python
233 Requires: %{name} = %{version}-%{release}
234 Requires: python-libs
236 %description -n python-gdal
239 %description -n python-gdal -l pl.UTF-8
242 %package -n ruby-gdal
243 Summary: Ruby bindings for GDAL
244 Summary(pl.UTF-8): Wiązania języka Ruby do pakietu GDAL
245 Group: Development/Languages
246 Requires: %{name} = %{version}-%{release}
248 %description -n ruby-gdal
249 Ruby bindings for GDAL - gdal, gdalconst, ogr and osr modules.
251 %description -n ruby-gdal -l pl.UTF-8
252 Wiązania języka Ruby do pakietu GDAL - moduły gdal, gdalconst, ogr i
263 # need to regenerate (old ones don't support perl 5.10)
264 %{__rm} swig/perl/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp}
266 # Build with fPIC to allow Ruby bindings
267 # Xcompiler should normally achieve that -- http://trac.osgeo.org/gdal/ticket/3978
268 # http://trac.osgeo.org/gdal/ticket/1994
269 sed -i 's|\$(CFLAGS)|$(CFLAGS) -fPIC|g' swig/ruby/RubyMakefile.mk
270 # Install Ruby bindings to distribution specific directory
271 sed -i 's|RUBY_EXTENSIONS_DIR :=.*|RUBY_EXTENSIONS_DIR := %{ruby_vendorarchdir}|' swig/ruby/RubyMakefile.mk
273 # Install Ruby bindings into the proper place
274 sed -i -e 's|^$(INSTALL_DIR):|$(DESTDIR)$(INSTALL_DIR):|' swig/ruby/RubyMakefile.mk
275 sed -i -e 's|^install: $(INSTALL_DIR)|install: $(DESTDIR)$(INSTALL_DIR)|' swig/ruby/RubyMakefile.mk
279 %{__sed} -i -e 's,DODS_INC="-I.*,DODS_INC="$(pkg-config --cflags libdap)",' configure.in
285 # disable grass/libgrass here, it can be built from separate gdal-grass package
287 --datadir=%{_datadir}/gdal \
288 --with-dods-root=/usr \
289 %{?with_armadillo:--with-armadillo} \
290 %{?with_epsilon:--with-epsilon} \
291 %{!?with_gta:--without-gta} \
292 --with-hide-internal-symbols \
293 %{?with_java:--with-java=%{java_home}} \
295 %{?with_java:--with-mdb --with-jvm-lib-add-rpath} \
296 %{?with_mysql:--with-mysql} \
297 %{?with_opencl:--with-opencl} \
299 %{?with_php:--with-php} \
300 %{?with_podofo:--with-podofo} \
301 %{?with_poppler:--with-poppler} \
303 %{?with_ruby:--with-ruby} \
304 %{?with_spatialite:--with-spatialite} \
307 %{?with_xerces:--with-xerces} \
308 --with-xerces-inc=/usr/include/xercesc \
309 --with-xerces-lib="-lxerces-c" \
313 # --with-pcidsk=/usr (needs > 0.3)
314 # csharp builds, but has no configure option
316 # regenerate where needed
317 %{__make} -j1 -C swig/perl generate
319 %{__make} -j1 -C swig/ruby generate
329 rm -rf $RPM_BUILD_ROOT
331 %{__make} -j1 install install-man \
332 DESTDIR=$RPM_BUILD_ROOT
336 cp -a ogr/html _html/ogr
339 # missing in make install
340 install -D swig/php/php_gdal.so $RPM_BUILD_ROOT%{php_extensiondir}/gdal.so
341 install -D swig/php/php_gdalconst.so $RPM_BUILD_ROOT%{php_extensiondir}/gdalconst.so
342 install -D swig/php/php_ogr.so $RPM_BUILD_ROOT%{php_extensiondir}/ogr.so
343 install -D swig/php/php_osr.so $RPM_BUILD_ROOT%{php_extensiondir}/osr.so
344 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
345 cat <<'EOF' >$RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gdal.ini
346 ; Enable gdal extension module
348 extension=gdalconst.so
354 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
355 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
358 %{__rm} $RPM_BUILD_ROOT%{perl_archlib}/perllocal.pod
359 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/GDAL/.packlist
360 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/GDAL/Const/.packlist
361 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/OGR/.packlist
362 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/OSR/.packlist
365 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Geo/{GDAL.dox,GDAL/Const.dox,OGR.dox,OSR.dox}
366 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/Geo/check_dox.pl
367 %{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal_{fillnodata,sieve}.dox
370 rm -rf $RPM_BUILD_ROOT
372 %post -p /sbin/ldconfig
373 %postun -p /sbin/ldconfig
376 %defattr(644,root,root,755)
377 %doc NEWS PROVENANCE.TXT
378 %attr(755,root,root) %{_bindir}/epsg_tr.py
379 %attr(755,root,root) %{_bindir}/esri2wkt.py
380 %attr(755,root,root) %{_bindir}/gcps2vec.py
381 %attr(755,root,root) %{_bindir}/gcps2wld.py
382 %attr(755,root,root) %{_bindir}/gdal2tiles.py
383 %attr(755,root,root) %{_bindir}/gdal2xyz.py
384 %attr(755,root,root) %{_bindir}/gdal_contour
385 %attr(755,root,root) %{_bindir}/gdal_calc.py
386 %attr(755,root,root) %{_bindir}/gdal_fillnodata.py
387 %attr(755,root,root) %{_bindir}/gdal_grid
388 %attr(755,root,root) %{_bindir}/gdal_merge.py
389 %attr(755,root,root) %{_bindir}/gdal_polygonize.py
390 %attr(755,root,root) %{_bindir}/gdal_proximity.py
391 %attr(755,root,root) %{_bindir}/gdal_rasterize
392 %attr(755,root,root) %{_bindir}/gdal_retile.py
393 %attr(755,root,root) %{_bindir}/gdal_sieve.py
394 %attr(755,root,root) %{_bindir}/gdal_translate
395 %attr(755,root,root) %{_bindir}/gdaladdo
396 %attr(755,root,root) %{_bindir}/gdalbuildvrt
397 %attr(755,root,root) %{_bindir}/gdalchksum.py
398 %attr(755,root,root) %{_bindir}/gdaldem
399 %attr(755,root,root) %{_bindir}/gdalenhance
400 %attr(755,root,root) %{_bindir}/gdalident.py
401 %attr(755,root,root) %{_bindir}/gdalimport.py
402 %attr(755,root,root) %{_bindir}/gdalinfo
403 %attr(755,root,root) %{_bindir}/gdallocationinfo
404 %attr(755,root,root) %{_bindir}/gdalmanage
405 %attr(755,root,root) %{_bindir}/gdalsrsinfo
406 %attr(755,root,root) %{_bindir}/gdaltindex
407 %attr(755,root,root) %{_bindir}/gdaltransform
408 %attr(755,root,root) %{_bindir}/gdalwarp
409 %attr(755,root,root) %{_bindir}/mkgraticule.py
410 %attr(755,root,root) %{_bindir}/nearblack
411 %attr(755,root,root) %{_bindir}/ogr2ogr
412 %attr(755,root,root) %{_bindir}/ogrinfo
413 %attr(755,root,root) %{_bindir}/ogrtindex
414 %attr(755,root,root) %{_bindir}/pct2rgb.py
415 %attr(755,root,root) %{_bindir}/rgb2pct.py
416 %attr(755,root,root) %{_bindir}/testepsg
417 %attr(755,root,root) %{_libdir}/libgdal.so.*.*.*
418 %attr(755,root,root) %ghost %{_libdir}/libgdal.so.1
420 %{_mandir}/man1/gdal2tiles.1*
421 %{_mandir}/man1/gdal_contour.1*
422 %{_mandir}/man1/gdal_fillnodata.1*
423 %{_mandir}/man1/gdal_grid.1*
424 %{_mandir}/man1/gdal_merge.1*
425 %{_mandir}/man1/gdal_rasterize.1*
426 %{_mandir}/man1/gdal_retile.1*
427 %{_mandir}/man1/gdal_sieve.1*
428 %{_mandir}/man1/gdal_translate.1*
429 %{_mandir}/man1/gdal_utilities.1*
430 %{_mandir}/man1/gdaladdo.1*
431 %{_mandir}/man1/gdalbuildvrt.1*
432 %{_mandir}/man1/gdaldem.1*
433 %{_mandir}/man1/gdalinfo.1*
434 %{_mandir}/man1/gdallocationinfo.1*
435 %{_mandir}/man1/gdalsrsinfo.1*
436 %{_mandir}/man1/gdaltindex.1*
437 %{_mandir}/man1/gdaltransform.1*
438 %{_mandir}/man1/gdalwarp.1*
439 %{_mandir}/man1/nearblack.1*
440 %{_mandir}/man1/ogr2ogr.1*
441 %{_mandir}/man1/ogr_utilities.1*
442 %{_mandir}/man1/ogrinfo.1*
443 %{_mandir}/man1/ogrtindex.1*
444 %{_mandir}/man1/pct2rgb.1*
445 %{_mandir}/man1/rgb2pct.1*
448 %defattr(644,root,root,755)
450 %attr(755,root,root) %{_bindir}/gdal-config
451 %attr(755,root,root) %{_libdir}/libgdal.so
452 %{_libdir}/libgdal.la
453 %{_includedir}/cpl_*.h
454 %{_includedir}/cplkeywordparser.h
455 %{_includedir}/gdal*.h
456 %{_includedir}/gvgcpfit.h
457 %{_includedir}/memdataset.h
458 %{_includedir}/ogr_*.h
459 %{_includedir}/ogrsf_frmts.h
460 %{_includedir}/rawdataset.h
461 %{_includedir}/thinplatespline.h
462 %{_includedir}/vrtdataset.h
463 %{_mandir}/man1/gdal-config.1*
466 %defattr(644,root,root,755)
470 %defattr(644,root,root,755)
471 %dir %{perl_vendorarch}/Geo
472 %{perl_vendorarch}/Geo/GDAL.pm
473 %dir %{perl_vendorarch}/Geo/GDAL
474 %{perl_vendorarch}/Geo/GDAL/Const.pm
475 %{perl_vendorarch}/Geo/OGR.pm
476 %{perl_vendorarch}/Geo/OSR.pm
477 %dir %{perl_vendorarch}/auto/Geo
478 %dir %{perl_vendorarch}/auto/Geo/GDAL
479 %{perl_vendorarch}/auto/Geo/GDAL/GDAL.bs
480 %attr(755,root,root) %{perl_vendorarch}/auto/Geo/GDAL/GDAL.so
481 %dir %{perl_vendorarch}/auto/Geo/GDAL/Const
482 %{perl_vendorarch}/auto/Geo/GDAL/Const/Const.bs
483 %attr(755,root,root) %{perl_vendorarch}/auto/Geo/GDAL/Const/Const.so
484 %dir %{perl_vendorarch}/auto/Geo/OGR
485 %{perl_vendorarch}/auto/Geo/OGR/OGR.bs
486 %attr(755,root,root) %{perl_vendorarch}/auto/Geo/OGR/OGR.so
487 %dir %{perl_vendorarch}/auto/Geo/OSR
488 %{perl_vendorarch}/auto/Geo/OSR/OSR.bs
489 %attr(755,root,root) %{perl_vendorarch}/auto/Geo/OSR/OSR.so
493 %defattr(644,root,root,755)
494 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gdal.ini
495 %attr(755,root,root) %{php_extensiondir}/gdal.so
496 %attr(755,root,root) %{php_extensiondir}/gdalconst.so
497 %attr(755,root,root) %{php_extensiondir}/ogr.so
498 %attr(755,root,root) %{php_extensiondir}/osr.so
501 %files -n python-gdal
502 %defattr(644,root,root,755)
503 %{py_sitedir}/gdal.py[co]
504 %{py_sitedir}/gdalconst.py[co]
505 %{py_sitedir}/gdalnumeric.py[co]
506 %{py_sitedir}/ogr.py[co]
507 %{py_sitedir}/osr.py[co]
508 %{py_sitedir}/GDAL-*.egg-info
509 %dir %{py_sitedir}/osgeo
510 %attr(755,root,root) %{py_sitedir}/osgeo/_gdal.so
511 %attr(755,root,root) %{py_sitedir}/osgeo/_gdal_array.so
512 %attr(755,root,root) %{py_sitedir}/osgeo/_gdalconst.so
513 %attr(755,root,root) %{py_sitedir}/osgeo/_ogr.so
514 %attr(755,root,root) %{py_sitedir}/osgeo/_osr.so
515 %{py_sitedir}/osgeo/*.py[co]
519 %defattr(644,root,root,755)
520 %dir %{ruby_vendorarchdir}/gdal
521 %attr(755,root,root) %{ruby_vendorarchdir}/gdal/gdal.so
522 %attr(755,root,root) %{ruby_vendorarchdir}/gdal/gdalconst.so
523 %attr(755,root,root) %{ruby_vendorarchdir}/gdal/ogr.so
524 %attr(755,root,root) %{ruby_vendorarchdir}/gdal/osr.so