#TODO: msg needs to have PublicDecompWT.zip from EUMETSAT, which is not free; # Building without msg therefore #TODO: e00compr bundled? #TODO: There are tests for bindings -- at least for Perl #TODO: Java has a directory with test data and a build target called test # It uses %%{JAVA_RUN}; make test seems to work in the build directory #TODO: e00compr source is the same in the package and bundled in GDAL #TODO: Consider doxy patch from Suse, setting EXTRACT_LOCAL_CLASSES = NO # GDAL 3.4 specific naming to avoid conflicts with RHEL gdal package %global pkgname gdal %global binprefix gdal3.4- # Tests can be of a different version %global testversion 3.4.3 %global run_tests 1 %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 %bcond_without java %bcond_without python3 # No ppc64 build for spatialite in EL6 # https://bugzilla.redhat.com/show_bug.cgi?id=663938 %if 0%{?rhel} == 6 %ifnarch ppc64 %global with_spatialite 0 %global spatialite --without-spatialite %endif %endif Name: gdal3.4 Version: 3.4.3 Release: 5%{?dist} Summary: GIS file format library (GDAL 3.4 version with full features) License: MIT URL: http://www.gdal.org # Source0: http://download.osgeo.org/gdal/%%{version}/gdal-%%{version}.tar.xz # See PROVENANCE.TXT-fedora and the cleaner script for details! Source0: %{pkgname}-%{version}-fedora.tar.xz Source1: http://download.osgeo.org/%{pkgname}/%{testversion}/%{pkgname}autotest-%{testversion}.tar.gz # Cleaner script for the tarball Source3: %{pkgname}-cleaner.sh Source4: PROVENANCE.TXT-fedora # Java build fixes Patch2: gdal_java.patch # Ensure rpc/types.h is found by dods driver (indirectly required by libdap/XDRUtils.h) Patch3: gdal_tirpcinc.patch # Use libtool to create libiso8211.a, otherwise broken static lib is created since object files are compiled through libtool Patch4: gdal_iso8211.patch # Don't pass -W to sphinx, it causes it to error out on warnings # Don't do parallel build, currently fails with "Sphinx parallel build error: NotImplementedError" Patch5: gdal_sphinx.patch # Fix makefiles installing libtool wrappers instead of actual executables Patch6: gdal_installapps.patch # Don't refer to PDF manual which is not built Patch7: gdal_nopdf.patch # Fix issues caught by gcc-11 Patch8: %{pkgname}-gcc11.patch # Drop -diag-disable compile flag Patch9: gdal_no-diag-disable.patch # Fix build with autoconf 2.70 Patch10: gdal_autoconf270.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libtool BuildRequires: automake BuildRequires: autoconf BuildRequires: ant BuildRequires: armadillo-devel BuildRequires: cfitsio-devel #BuildRequires: CharLS-devel BuildRequires: chrpath BuildRequires: curl-devel BuildRequires: doxygen BuildRequires: expat-devel BuildRequires: fontconfig-devel BuildRequires: freexl-devel BuildRequires: geos-devel >= 3.7.1 BuildRequires: ghostscript BuildRequires: hdf-devel BuildRequires: hdf-static BuildRequires: hdf5-devel BuildRequires: jasper-devel BuildRequires: jpackage-utils BuildRequires: json-c-devel BuildRequires: libgeotiff-devel BuildRequires: libgta-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libkml-devel %if %{with_spatialite} BuildRequires: libspatialite-devel %endif BuildRequires: libtiff-devel BuildRequires: libwebp-devel BuildRequires: libtool BuildRequires: giflib-devel BuildRequires: netcdf-devel BuildRequires: libdap-devel BuildRequires: librx-devel %if 0%{?with_mysql} BuildRequires: mariadb-connector-c-devel %endif BuildRequires: pcre-devel BuildRequires: ogdi-devel BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: openjpeg2-devel BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: %{_bindir}/pkg-config %if 0%{?with_poppler} BuildRequires: poppler-devel %endif BuildRequires: libpq-devel BuildRequires: proj-devel >= 5.2.0 %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-numpy BuildRequires: python3-setuptools BuildRequires: python3dist(pytest) >= 3.6 BuildRequires: python3dist(lxml) >= 4.5.1 %endif BuildRequires: sqlite-devel BuildRequires: swig BuildRequires: unixODBC-devel BuildRequires: xerces-c-devel BuildRequires: xz-devel BuildRequires: zlib-devel BuildRequires: libtirpc-devel BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-breathe BuildRequires: make # Run time dependency for gpsbabel driver Requires: gpsbabel Requires: %{name}-libs%{?_isa} = %{version}-%{release} # We have multilib triage %if "%{_lib}" == "lib" %global cpuarch 32 %else %global cpuarch 64 %endif %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. This is the GDAL 3.4 version with full features, renamed to avoid conflicts with the stripped-down RHEL version. %package devel Summary: Development files for the GDAL file format library (GDAL 3.4 version) Requires: %{name}-libs%{?_isa} = %{version}-%{release} Conflicts: gdal-fevel %description devel This package contains development files for GDAL (GDAL 3.4 version). %package libs Summary: GDAL file format library (GDAL 3.4 version) # 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 (GDAL 3.4 version). %if %{with java} %package java Summary: Java modules for the GDAL file format library (GDAL 3.4 version) BuildRequires: java-devel >= 1:1.6.0 # For 'mvn_artifact' and 'mvn_install' BuildRequires: javapackages-local Requires: jpackage-utils Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description java The GDAL Java modules provide support to handle multiple GIS file formats. This is the GDAL 3.4 version. %package javadoc Summary: Javadocs for %{name} Requires: jpackage-utils BuildArch: noarch %description javadoc This package contains the API documentation for %{name}. %endif %package perl Summary: Perl modules for the GDAL file format library (GDAL 3.4 version) Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) %description perl The GDAL Perl modules provide support to handle multiple GIS file formats. This is the GDAL 3.4 version. %if %{with python3} %package -n python3-%{name} %{?python_provide:%python_provide python3-%{name}} Summary: Python modules for the GDAL file format library (GDAL 3.4 version) Requires: python3-numpy Requires: %{name}-libs%{?_isa} = %{version}-%{release} %description -n python3-%{name} The GDAL Python 3 modules provide support to handle multiple GIS file formats. This is the GDAL 3.4 version. %endif %if %{with python3} %package python-tools Summary: Python tools for the GDAL file format library (GDAL 3.4 version) Requires: python3-%{name} %description python-tools The GDAL Python package provides number of tools for programming and manipulating GDAL file format library. This is the GDAL 3.4 version. %endif %package doc Summary: Documentation for GDAL (GDAL 3.4 version) BuildArch: noarch %description doc This package contains documentation for GDAL (GDAL 3.4 version). # We don't want to provide private Python extension libs %if %{with_python3} %global __provides_exclude_from ^%{python3_sitearch}/.*\.so$ %endif %prep %autosetup -p1 -n %{pkgname}-%{version}-fedora -a 1 # 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 # Copy in PROVENANCE.TXT-fedora cp -p %SOURCE4 . # Adjust check for LibDAP version # http://trac.osgeo.org/gdal/ticket/4545 %if %cpuarch == 64 sed -i 's|with_dods_root/lib|with_dods_root/lib64|' configure.ac %endif # Library and headers remain unchanged (original libgdal.so, /usr/include/gdal/) # Only binaries are renamed with gdal3.4- prefix %build # For future reference: # epsilon: Stalled review -- https://bugzilla.redhat.com/show_bug.cgi?id=660024 # Building without pgeo driver, because it drags in Java autoreconf -ifv %configure \ --with-autoload=%{_libdir}/gdal3.4-gdalplugins \ --includedir=%{_includedir}/%{pkgname}/ \ --prefix=%{_prefix} \ --with-armadillo \ --with-curl \ --with-cfitsio \ --with-dods-root=%{_prefix} \ --with-expat \ --with-freexl \ --with-geos \ --with-geotiff \ --with-gif \ --with-gta \ --with-hdf4 \ --with-hdf5 \ --with-jasper \ %if %{with java} --with-java \ %endif --with-jpeg \ --with-libjson-c \ --without-jpeg12 \ --with-liblzma \ --with-libtiff \ --with-libz \ --without-mdb \ --without-msg \ %{mysql} \ --with-netcdf \ --with-odbc \ --with-ogdi \ --with-openjpeg \ --with-pcraster \ --with-pg \ --with-png \ %{poppler} \ --with-proj \ %{spatialite} \ --with-sqlite3 \ --with-threads \ --with-webp \ --with-xerces \ --enable-shared \ --with-libkml # Build with standard library name, rename during install %make_build # Build some utilities, as requested in BZ #1271906 make -C ogr/ogrsf_frmts/s57 all make -C frmts/iso8211 all # Documentation make man make docs %if %{with java} # Make Java module and documentation pushd swig/java make ANT_OPTS="-Dfile.encoding=utf-8" ant maven popd %mvn_artifact swig/java/build/maven/%{pkgname}-%version.pom swig/java/build/maven/%{pkgname}-%version.jar %endif # Make Python modules pushd swig/python %{?with_python3:%py3_build} popd # Make Perl modules pushd swig/perl perl Makefile.PL INSTALLDIRS=vendor %make_build popd %install pushd swig/python %{?with_python3:%py3_install} popd %make_install -C swig/perl %make_install install-man # Drop gdal.pdf symlink, as we don't build the pdf documentation rm doc/build/html/gdal.pdf install -pm 755 ogr/ogrsf_frmts/s57/s57dump %{buildroot}%{_bindir}/%{binprefix}s57dump install -pm 755 frmts/iso8211/8211createfromxml %{buildroot}%{_bindir}/%{binprefix}8211createfromxml install -pm 755 frmts/iso8211/8211dump %{buildroot}%{_bindir}/%{binprefix}8211dump install -pm 755 frmts/iso8211/8211view %{buildroot}%{_bindir}/%{binprefix}8211view # Rename for %%files doc below mv frmts/iso8211/html frmts/iso8211/iso8211_html # Rename all binaries with gdal3.4- prefix for binary in gdallocationinfo gdal_contour gdal_create gdal_rasterize gdal_translate \ gdaladdo gdalinfo gdaldem gdalbuildvrt gdaltindex gdalwarp gdal_grid \ gdalenhance gdalmanage gdalsrsinfo gdaltransform nearblack gdal_viewshed \ gdalmdiminfo gdalmdimtranslate gnmanalyse gnmmanage; do if [ -f %{buildroot}%{_bindir}/${binary} ]; then mv %{buildroot}%{_bindir}/${binary} %{buildroot}%{_bindir}/%{binprefix}${binary} fi done # Rename ogr* binaries with gdal3.4- prefix for binary in %{buildroot}%{_bindir}/ogr*; do if [ -f "$binary" ]; then basename=$(basename "$binary") mv "$binary" %{buildroot}%{_bindir}/%{binprefix}${basename} fi done # Directory for auto-loading plugins mkdir -p %{buildroot}%{_libdir}/gdal3.4-gdalplugins #TODO: Don't do that? rm %{buildroot}%{perl_archlib}/perllocal.pod %if %{without python3} rm -f %buildroot%_mandir/man1/{pct2rgb,rgb2pct}.1 %endif # Correct permissions #TODO and potential ticket: Why are the permissions not correct? find %{buildroot}%{perl_vendorarch} -name "*.so" -exec chmod 755 '{}' \; find %{buildroot}%{perl_vendorarch} -name "*.pm" -exec chmod 644 '{}' \; %if %{with java} # install Java plugin %mvn_install -J swig/java/java # 775 on the .so? # copy JNI libraries and links, non versioned link needed by JNI # What is linked here? mkdir -p %{buildroot}%{_jnidir}/%{name} cp -pl swig/java/.libs/*.so* \ %{buildroot}%{_jnidir}/%{name}/ chrpath --delete %{buildroot}%{_jnidir}/%{name}/*jni.so* # Install Java API documentation in the designated place mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr swig/java/java/org %{buildroot}%{_javadocdir}/%{name} %endif #TODO: Header date lost during installation # Install multilib cpl_config.h bz#430894 install -p -D -m 644 port/cpl_config.h %{buildroot}%{_includedir}/%{pkgname}/cpl_config-%{cpuarch}.h # Create universal multilib cpl_config.h bz#341231 # The problem is still there in 1.9. #TODO: Ticket? #>>>>>>>>>>>>> cat > %{buildroot}%{_includedir}/%{pkgname}/cpl_config.h < #if __WORDSIZE == 32 #include "gdal/cpl_config-32.h" #else #if __WORDSIZE == 64 #include "gdal/cpl_config-64.h" #else #error "Unknown word size" #endif #endif EOF #<<<<<<<<<<<<< touch -r NEWS.md port/cpl_config.h # Multilib gdal-config # Keep gdal-config in standard location for devel subpackage (no renaming) # Rename the original script to gdal-config-$arch (stores arch-specific information) # and create a script to call one or the other -- depending on detected architecture # TODO: The extra script will direct you to 64 bit libs on # 64 bit systems -- whether you like that or not mv %{buildroot}%{_bindir}/%{pkgname}-config %{buildroot}%{_bindir}/%{pkgname}-config-%{cpuarch} #>>>>>>>>>>>>> cat > %{buildroot}%{_bindir}/%{pkgname}-config < gdal3.4-gdalinfo.1 newbase=%{binprefix}${base} mv "$f" "${dir}/${newbase}" fi done for f in %{buildroot}%{_mandir}/man1/ogr*.1*; do if [ -f "$f" ]; then dir=$(dirname "$f") base=$(basename "$f") newbase=%{binprefix}${base} mv "$f" "${dir}/${newbase}" fi done for f in %{buildroot}%{_mandir}/man1/gnm*.1*; do if [ -f "$f" ]; then dir=$(dirname "$f") base=$(basename "$f") newbase=%{binprefix}${base} mv "$f" "${dir}/${newbase}" fi done for f in %{buildroot}%{_mandir}/man1/nearblack.1*; do if [ -f "$f" ]; then dir=$(dirname "$f") base=$(basename "$f") newbase=%{binprefix}${base} mv "$f" "${dir}/${newbase}" fi done # Rename Python tools man pages (pct2rgb, rgb2pct, etc.) for f in %{buildroot}%{_mandir}/man1/pct2rgb.1* \ %{buildroot}%{_mandir}/man1/rgb2pct.1*; do if [ -f "$f" ]; then dir=$(dirname "$f") base=$(basename "$f") newbase=%{binprefix}${base} mv "$f" "${dir}/${newbase}" fi done # Rename Python tools with gdal3.4- prefix for f in %{buildroot}%{_bindir}/*.py; do if [ -f "$f" ]; then filename=$(basename "$f") # script.py -> gdal3.4-script.py newname=%{binprefix}${filename} mv "$f" %{buildroot}%{_bindir}/${newname} fi done %if %{with java} %check %if %{run_tests} for i in -I/usr/lib/jvm/java/include{,/linux}; do java_inc="$java_inc $i" done %endif pushd %{pkgname}autotest-%{testversion} export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} export GDAL_DATA=%{buildroot}%{_datadir}/%{name}/ # Enable these tests on demand #export GDAL_RUN_SLOW_TESTS=1 #export GDAL_DOWNLOAD_TEST_DATA=1 # Some tests are currently skipped: # - `test_fits_vector` because it's crashing. # - `test_http*`, `test_jp2openjpeg_45`, `*multithreaded_download*`, # `*multithreaded_upload*`, and `test_vsis3_no_sign_request`, which # try to connect externally. # - `test_eedai_GOOGLE_APPLICATION_CREDENTIALS` which seems to use the # internet. # - `test_osr_erm_1`, `test_ers_4`, `test_ers_8`, and `test_ers_10` as # they use `ecw_cs.wkt` which was removed due to unclear license. # - `test_jpeg2000_8` and `test_jpeg2000_11` as files don't load, # perhaps due to buggy Jasper library? # - `test_osr_ct_options_area_of_interest` returns the wrong value, but # it's skipped on macOS by upstream for mysteriously failing as well, # so do the same here. # FIXME: Some Tests hang on i686 and armv7hl %ifnarch i686 armv7hl %{pytest} -v -k 'not test_fits_vector and not test_http and not test_jp2openjpeg_45 and not multithreaded_download and not multithreaded_upload and not test_vsis3_no_sign_request and not test_eedai_GOOGLE_APPLICATION_CREDENTIALS and not test_osr_erm_1 and not test_ers_4 and not test_ers_8 and not test_ers_10 and not test_jpeg2000_8 and not test_jpeg2000_11 and not test_osr_ct_options_area_of_interest' || : %endif popd %endif %files %{_bindir}/%{binprefix}gdallocationinfo %{_bindir}/%{binprefix}gdal_contour %{_bindir}/%{binprefix}gdal_create %{_bindir}/%{binprefix}gdal_rasterize %{_bindir}/%{binprefix}gdal_translate %{_bindir}/%{binprefix}gdaladdo %{_bindir}/%{binprefix}gdalinfo %{_bindir}/%{binprefix}gdaldem %{_bindir}/%{binprefix}gdalbuildvrt %{_bindir}/%{binprefix}gdaltindex %{_bindir}/%{binprefix}gdalwarp %{_bindir}/%{binprefix}gdal_grid %{_bindir}/%{binprefix}gdalenhance %{_bindir}/%{binprefix}gdalmanage %{_bindir}/%{binprefix}gdalsrsinfo %{_bindir}/%{binprefix}gdaltransform %{_bindir}/%{binprefix}nearblack %{_bindir}/%{binprefix}gdal_viewshed %{_bindir}/%{binprefix}gdalmdiminfo %{_bindir}/%{binprefix}gdalmdimtranslate %{_bindir}/%{binprefix}ogr* %{_bindir}/%{binprefix}8211* %{_bindir}/%{binprefix}s57dump %{_bindir}/%{binprefix}gnmanalyse %{_bindir}/%{binprefix}gnmmanage %{_mandir}/man1/%{binprefix}gdal*.1* %exclude %{_mandir}/man1/%{binprefix}gdal-config.1* %exclude %{_mandir}/man1/%{binprefix}gdal2tiles.1* %exclude %{_mandir}/man1/%{binprefix}gdal_fillnodata.1* %exclude %{_mandir}/man1/%{binprefix}gdal_merge.1* %exclude %{_mandir}/man1/%{binprefix}gdal_retile.1* %exclude %{_mandir}/man1/%{binprefix}gdal_sieve.1* %{_mandir}/man1/%{binprefix}nearblack.1* %{_mandir}/man1/%{binprefix}ogr*.1* %{_mandir}/man1/%{binprefix}gnm*.1* %files libs %license LICENSE.TXT %doc NEWS.md PROVENANCE.TXT COMMITTERS PROVENANCE.TXT-fedora %{_libdir}/libgdal.so.30 %{_libdir}/libgdal.so.30.* %{_datadir}/%{name} %dir %{_libdir}/%{name}-gdalplugins %files devel %{_bindir}/%{pkgname}-config %{_bindir}/%{pkgname}-config-%{cpuarch} %{_mandir}/man1/%{pkgname}-config.1* %dir %{_includedir}/%{pkgname} %{_includedir}/%{pkgname}/*.h %{_libdir}/libgdal.so %{_libdir}/pkgconfig/%{pkgname}.pc %if %{with java} # Can I even have a separate Java package anymore? %files java -f .mfiles %doc swig/java/apps %{_jnidir}/%{name}/libgdalalljni.so* %files javadoc -f .mfiles-javadoc %endif %files perl %doc swig/perl/README %{perl_vendorarch}/* %{_mandir}/man3/*.3pm* %if %{with python3} %files -n python3-%{name} %doc swig/python/README.rst %{python3_sitearch}/GDAL-%{version}-py*.egg-info/ %{python3_sitearch}/osgeo/ %{python3_sitearch}/osgeo_utils/ %files python-tools %{_bindir}/%{binprefix}*.py %{_mandir}/man1/%{binprefix}pct2rgb.1* %{_mandir}/man1/%{binprefix}rgb2pct.1* %{_mandir}/man1/%{binprefix}gdal2tiles.1* %{_mandir}/man1/%{binprefix}gdal_fillnodata.1* %{_mandir}/man1/%{binprefix}gdal_merge.1* %{_mandir}/man1/%{binprefix}gdal_retile.1* %{_mandir}/man1/%{binprefix}gdal_sieve.1* %endif %files doc %doc doc/build/html frmts/iso8211/iso8211_html #TODO: jvm #Should be managed by the Alternatives system and not via ldconfig #The MDB driver is said to require: #Download jackcess-1.2.2.jar, commons-lang-2.4.jar and #commons-logging-1.1.1.jar (other versions might work) #If you didn't specify --with-jvm-lib-add-rpath at #Or as before, using ldconfig %changelog * Thu Jan 08 2026 Filip Janus - 3.4.3-5 - Initial GDAL 3.4 version with alternate naming to avoid conflicts with RHEL gdal - Renamed package from gdal to gdal3.4 - Library and headers remain unchanged (libgdal.so, /usr/include/gdal/) - Renamed all binaries with gdal3.4- prefix (e.g., gdal3.4-gdalinfo) Source spec file: https://src.fedoraproject.org/rpms/gdal/blob/f8957dfc7adaeb952f53d38121c10a0f5a837a61/f/gdal.spec