337 lines
8.8 KiB
RPMSpec
337 lines
8.8 KiB
RPMSpec
%global run_tests 1
|
|
|
|
%global bashcompletiondir %(pkg-config --variable=compatdir bash-completion)
|
|
|
|
%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.7.2
|
|
Release: 1
|
|
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
|
|
Source2: gdal-config
|
|
|
|
# Add some utils to the default install target
|
|
Patch0: gdal_utils.patch
|
|
Patch1: 0001-Fix-build-error-with-libxml2-2.12.patch
|
|
Patch2: 0002-Fix-build-error-with-pre-installed-version-in-the-PA.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
|
|
|
|
# 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
|
|
%autopatch -p1
|
|
|
|
%build
|
|
%cmake \
|
|
-DCMAKE_INSTALL_INCLUDEDIR=include/gdal \
|
|
-DGDAL_JAVA_INSTALL_DIR=%{_jnidir}/%{name} \
|
|
-DGDAL_USE_JPEG12_INTERNAL=OFF \
|
|
-DENABLE_DEFLATE64=OFF \
|
|
-DGDAL_USE_LERC_INTERNAL=OFF
|
|
sed -i "s#-Wp, -Wp,#-Wp,#g" `grep "Wp, -Wp," -rl ./`
|
|
%make_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
|
|
%make_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
|
|
cp -a %{SOURCE2} %{buildroot}%{_bindir}/%{name}-config
|
|
|
|
|
|
%if 0%{run_tests}
|
|
%check
|
|
%ctest || :
|
|
%endif
|
|
|
|
|
|
%files -f gdal_python_manpages_excludes.txt
|
|
%{_bindir}/8211*
|
|
%{_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}/s57dump
|
|
%{_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.33
|
|
%{_libdir}/libgdal.so.33.*
|
|
%{_datadir}/%{name}/
|
|
%{_libdir}/gdalplugins/
|
|
|
|
%files devel
|
|
%{_bindir}/%{name}-config*
|
|
%{_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
|
|
* 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
|