From 28178e3c0cb5c5cec2b73de78a3bc4cd01b24874 Mon Sep 17 00:00:00 2001 From: Gwyn Ciesla Date: Sun, 20 Oct 2019 18:18:24 -0500 Subject: [PATCH 01/13] "Adding package.cfg file" --- package.cfg | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 package.cfg diff --git a/package.cfg b/package.cfg new file mode 100644 index 0000000..66ea79d --- /dev/null +++ b/package.cfg @@ -0,0 +1,2 @@ +[koji] +targets = epel8 epel8-playground \ No newline at end of file From 67a6a4c1c169ee15113de0c1f32e3316f468eebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Devrim=20G=C3=BCnd=C3=BCz?= Date: Mon, 4 Nov 2019 22:11:39 +0000 Subject: [PATCH 02/13] gdal: Initial attempt for EPEL 8 --- .gitignore | 2 + PROVENANCE.TXT-fedora | 38 ++ gdal-3.0.2-java.patch | 10 + gdal-3.0.2-perl-build.patch | 9 + gdal-3.0.2-zlib.patch | 11 + gdal-cleaner.sh | 22 + gdal-completion.patch | 11 + gdal.spec | 884 ++++++++++++++++++++++++++++++++++++ sources | 2 + 9 files changed, 989 insertions(+) create mode 100644 .gitignore create mode 100644 PROVENANCE.TXT-fedora create mode 100644 gdal-3.0.2-java.patch create mode 100644 gdal-3.0.2-perl-build.patch create mode 100644 gdal-3.0.2-zlib.patch create mode 100755 gdal-cleaner.sh create mode 100644 gdal-completion.patch create mode 100644 gdal.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..43253fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/gdalautotest-3.0.1.zip +/gdal-3.0.2-fedora.tar.xz diff --git a/PROVENANCE.TXT-fedora b/PROVENANCE.TXT-fedora new file mode 100644 index 0000000..09700d5 --- /dev/null +++ b/PROVENANCE.TXT-fedora @@ -0,0 +1,38 @@ +gdal-1.9.1.tar.gz re-pack for Fedora + +All files with pending legal questions are stripped from the original tarball, +to form this tarball. Legal information is mainly from PROVENANCE.TXT + + +No files are manipulated. + +Please see the cleaning script clean-gdal.sh! + +This leaves GDAL short of a few formats, coordinate systems and the PHP bindings. + + Volker Fröhlich + + * updated to 1.9.1 by Volker Fröhlich + * updated to 1.9.0 by Volker Fröhlich + * updated to 1.7.3 by Viji V Nair + * updated to 1.7.2 by Sven Lankes + * updated to 1.7.1 by Balint Crisitan + * updated to 1.6.1 by Dan Horak + + +Removed files: +======================================== +# due to uncertain license issues +and derivative copy from ESRI (TM) and CubeWerx (TM): + +data/cubewerx_extra.wkt +data/esri_extra.wkt +data/ecw_cs.wkt + +Removed folders plus its contents: +======================================== +# due to uncertain license issues these formats +are removed and not suported in fedora pack: + +frmts/bsb <-- http://www.osgeo.org/pipermail/gdal-dev/2003-September/001097.html +swig/php <-- PHP license, incompatible mixture diff --git a/gdal-3.0.2-java.patch b/gdal-3.0.2-java.patch new file mode 100644 index 0000000..672e622 --- /dev/null +++ b/gdal-3.0.2-java.patch @@ -0,0 +1,10 @@ +--- gdal/swig/java/java.opt.old 2019-10-29 13:03:54.400836584 +0000 ++++ gdal/swig/java/java.opt 2019-10-29 13:04:17.170046904 +0000 +@@ -7,6 +7,6 @@ + JAVAC=$(JAVA_HOME)/bin/javac + JAVA=$(JAVA_HOME)/bin/java + JAR=$(JAVA_HOME)/bin/jar +-JAVA_INCLUDE=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux ++JAVA_INCLUDE=-I/usr/lib/jvm/java/include/ -I/usr/lib/jvm/java/include/linux + + diff --git a/gdal-3.0.2-perl-build.patch b/gdal-3.0.2-perl-build.patch new file mode 100644 index 0000000..9a0b7a6 --- /dev/null +++ b/gdal-3.0.2-perl-build.patch @@ -0,0 +1,9 @@ +--- gdal/swig/perl/GNUmakefile.old 2019-10-29 13:08:12.754223012 +0000 ++++ gdal/swig/perl/GNUmakefile 2019-10-29 13:08:34.518424050 +0000 +@@ -64,3 +64,6 @@ + + .FORCE: + perl parse-for-doxygen.pl > all.pm; doxygen; rm -f all.pm ++ ++.PHONY: generate ++ diff --git a/gdal-3.0.2-zlib.patch b/gdal-3.0.2-zlib.patch new file mode 100644 index 0000000..d12691e --- /dev/null +++ b/gdal-3.0.2-zlib.patch @@ -0,0 +1,11 @@ +--- gdal/frmts/mrf/mrf_band.cpp.old 2019-10-29 13:05:35.413769644 +0000 ++++ gdal/frmts/mrf/mrf_band.cpp 2019-10-29 13:05:48.962894799 +0000 +@@ -49,7 +49,7 @@ + + #include + #include +-#include "zlib.h" ++#include "../zlib/zlib.h" + + CPL_CVSID("$Id$") + diff --git a/gdal-cleaner.sh b/gdal-cleaner.sh new file mode 100755 index 0000000..f0ce760 --- /dev/null +++ b/gdal-cleaner.sh @@ -0,0 +1,22 @@ +#!/bin/bash +VERSION="3.0.2" + +tar zxf v"${VERSION}".tar.gz + +mv gdal-"${VERSION}"{,-fedora} && pushd gdal-"${VERSION}"-fedora/gdal + +rm data/cubewerx_extra.wkt +rm data/esri_extra.wkt +rm data/esri_Wisconsin_extra.wkt +rm data/esri_StatePlane_extra.wkt +rm data/ecw_cs.wkt + +#Really necessary? +rm -r swig/php + +popd + + +#TODO: Insert Provenance file + +tar cvfJ gdal-"${VERSION}"-fedora.tar.xz gdal-"${VERSION}"-fedora diff --git a/gdal-completion.patch b/gdal-completion.patch new file mode 100644 index 0000000..97a2798 --- /dev/null +++ b/gdal-completion.patch @@ -0,0 +1,11 @@ +--- gdal/scripts/GNUmakefile.old 2019-10-29 13:02:12.524895548 +0000 ++++ gdal/scripts/GNUmakefile 2019-10-29 13:02:50.251244028 +0000 +@@ -5,6 +5,6 @@ + + install: + if test "x`pkg-config --version 2>/dev/null`" != "x" -a "x`pkg-config --variable=compatdir bash-completion`" != "x"; then \ +- $(INSTALL_DIR) $(DESTDIR)${prefix}`pkg-config --variable=compatdir bash-completion` ; \ +- cp gdal-bash-completion.sh $(DESTDIR)${prefix}`pkg-config --variable=compatdir bash-completion`; \ ++ $(INSTALL_DIR) $(DESTDIR)`pkg-config --variable=compatdir bash-completion` ; \ ++ $(INSTALL_DATA) gdal-bash-completion.sh $(DESTDIR)`pkg-config --variable=compatdir bash-completion`/gdal; \ + fi diff --git a/gdal.spec b/gdal.spec new file mode 100644 index 0000000..2500cc6 --- /dev/null +++ b/gdal.spec @@ -0,0 +1,884 @@ +#TODO: g2clib and grib (said to be modified) +#TODO: Create script to make clean tarball +#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 + +# Soname should be bumped on API/ABI break +# http://trac.osgeo.org/gdal/ticket/4543 + +# Conditionals and structures for EL 5 are there +# to make life easier for downstream ELGIS. +# Sadly noarch doesn't work in EL 5, see +# http://fedoraproject.org/wiki/EPEL/GuidelinesAndPolicies + +# Tests can be of a different version +%global testversion 3.0.1 +%global run_tests 0 + +%global bashcompletiondir %(pkg-config --variable=compatdir bash-completion) + +%if 0%{?bootstrap} +%global build_refman 0 +%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 +# Enable/disable generating refmans +# texlive currently broken deps and FTBFS in rawhide +%global build_refman 1 +# 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_with python2 +%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: gdal +Version: 3.0.2 +Release: 1%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Summary: GIS file format library +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: %{name}-%{version}-fedora.tar.xz +Source1: http://download.osgeo.org/%{name}/%{testversion}/%{name}autotest-%{testversion}.zip + +# Cleaner script for the tarball +Source3: %{name}-cleaner.sh + +Source4: PROVENANCE.TXT-fedora + +# Fix bash-completion install dir +Patch3: %{name}-completion.patch + +# Fedora uses Alternatives for Java +Patch8: %{name}-3.0.2-java.patch + +Patch9: %{name}-3.0.2-zlib.patch + +# https://github.com/OSGeo/gdal/pull/876 +Patch10: %{name}-3.0.2-perl-build.patch + + +BuildRequires: gcc gcc-c++ +BuildRequires: ant +# No armadillo in EL5 +BuildRequires: armadillo-devel +BuildRequires: bash-completion +BuildRequires: cfitsio-devel +# No CharLS in EL5 +#BuildRequires: CharLS-devel +BuildRequires: chrpath +BuildRequires: curl-devel +BuildRequires: doxygen +BuildRequires: expat-devel +BuildRequires: fontconfig-devel +# No freexl in EL5 +BuildRequires: freexl-devel +BuildRequires: g2clib-static +BuildRequires: geos-devel >= 3.7.1 +BuildRequires: ghostscript +BuildRequires: hdf-devel +BuildRequires: hdf-static +BuildRequires: hdf5-devel +BuildRequires: java-devel >= 1:1.6.0 +BuildRequires: jasper-devel +BuildRequires: jpackage-utils +# For 'mvn_artifact' and 'mvn_install' +BuildRequires: javapackages-local +BuildRequires: json-c-devel +BuildRequires: libgeotiff-devel +# No libgta in EL5 +BuildRequires: libgta-devel + +BuildRequires: libjpeg-devel +BuildRequires: libpng-devel +# No libkml in EL +BuildRequires: libkml-devel + +%if %{with_spatialite} +BuildRequires: libspatialite-devel +%endif + +BuildRequires: libtiff-devel +# No libwebp in EL 5 and 6 +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 python2} +BuildRequires: python2-devel +BuildRequires: python2-numpy +%endif +%if %{with python3} +BuildRequires: python3-devel +BuildRequires: python3-numpy +%endif +BuildRequires: sqlite-devel +BuildRequires: swig +%if %{build_refman} +BuildRequires: texlive-latex +BuildRequires: texlive-collection-fontsrecommended +%if 0%{?fedora} +BuildRequires: texlive-collection-langcyrillic +BuildRequires: texlive-collection-langportuguese +%endif +BuildRequires: texlive-collection-latex +BuildRequires: texlive-epstopdf +BuildRequires: tex(multirow.sty) +BuildRequires: tex(sectsty.sty) +BuildRequires: tex(tabu.sty) +BuildRequires: tex(tocloft.sty) +BuildRequires: tex(xtab.sty) +%endif +BuildRequires: unixODBC-devel +BuildRequires: xerces-c-devel +BuildRequires: xz-devel +BuildRequires: zlib-devel +BuildRequires: libtirpc-devel + +# 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 + +%if ! (0%{?fedora} || 0%{?rhel} > 5) +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} +%endif + +#TODO: Description on the lib? +%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 + +# Old rpm didn't figure out +%if 0%{?rhel} < 6 +Requires: pkgconfig +%endif + +Requires: %{name}-libs%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-static < 1.9.0-1 + +%description devel +This package contains development files for GDAL. + + +%package libs +Summary: GDAL file format library +# https://trac.osgeo.org/gdal/ticket/3978#comment:5 +Obsoletes: %{name}-ruby < 1.11.0-1 + +%description libs +This package contains the GDAL file format library. + + +%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 perl +Summary: Perl modules for the GDAL file format library +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. + +%if %{with python2} +%package -n python2-gdal +%{?python_provide:%python_provide python2-gdal} +# Remove before F30 +Provides: %{name}-python = %{version}-%{release} +Provides: %{name}-python%{?_isa} = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} +Summary: Python modules for the GDAL file format library +Requires: numpy +Requires: %{name}-libs%{?_isa} = %{version}-%{release} + +%description -n python2-gdal +The GDAL Python modules provide support to handle multiple GIS file formats. +The package also includes a couple of useful utilities in Python. +%endif + + +%if %{with python3} +%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} +Obsoletes: gdal-python3 < 2.3.1 +Provides: gdal-python3 = %version-%release + +%description -n python3-gdal +The GDAL Python 3 modules provide support to handle multiple GIS file formats. +%endif + + +%if %{with python2} || %{with python3} +%package python-tools +Summary: Python tools for the GDAL file format library +Requires: %{?with_python3:python3-gdal}%{?!with_python3:python2-gdal} + +%description python-tools +The GDAL Python package provides number of tools for programming and +manipulating GDAL file format library +%endif + + +%package doc +Summary: Documentation for GDAL +BuildArch: noarch + +%description doc +This package contains HTML and PDF documentation for GDAL. + +# We don't want to provide private Python extension libs +%global __provides_exclude_from ^(%{python2_sitearch}|%{python3_sitearch})/.*\.so$ + +%prep +%setup -q -n %{name}-%{version}-fedora -a 1 + +pushd gdal +# Delete bundled libraries +%{__rm} -rf frmts/zlib +%{__rm} -rf frmts/png/libpng +%{__rm} -rf frmts/gif/giflib +%{__rm} -rf frmts/jpeg/libjpeg \ + frmts/jpeg/libjpeg12 +%{__rm} -rf frmts/gtiff/libgeotiff \ + frmts/gtiff/libtiff +#rm -r frmts/grib/degrib/g2clib +popd + +#%%patch1 -p1 -b .g2clib~ +#%%patch2 -p1 -b .jni~ +%patch3 -p1 -b .completion~ +%patch8 -p1 -b .java~ +%patch9 -p1 -b .zlib~ +%patch10 -p1 -b .perl-build~ + +# Copy in PROVENANCE.TXT-fedora +cp -p %SOURCE4 . + +# Sanitize linebreaks and encoding +#TODO: Don't touch data directory! +# /frmts/grib/degrib18/degrib/metaname.cpp +# and geoconcept.c are potentially dangerous to change +set +x +for f in `find . -type f` ; do + if file $f | grep -q ISO-8859 ; then + set -x + iconv -f ISO-8859-1 -t UTF-8 $f > ${f}.tmp && \ + mv -f ${f}.tmp $f + set +x + fi + if file $f | grep -q CRLF ; then + set -x + sed -i -e 's|\r||g' $f + set +x + fi +done +set -x + +for f in apps; do +pushd gdal/$f + chmod 644 *.cpp +popd +done + +# Replace hard-coded library- and include paths +pushd gdal +sed -i 's|-L\$with_cfitsio -L\$with_cfitsio/lib -lcfitsio|-lcfitsio|g' configure +sed -i 's|-I\$with_cfitsio -I\$with_cfitsio/include|-I\$with_cfitsio/include/cfitsio|g' configure +sed -i 's|-L\$with_netcdf -L\$with_netcdf/lib -lnetcdf|-lnetcdf|g' configure +sed -i 's|-L\$DODS_LIB -ldap++|-ldap++|g' configure +sed -i 's|-L\$with_ogdi -L\$with_ogdi/lib -logdi|-logdi|g' configure +sed -i 's|-L\$with_jpeg -L\$with_jpeg/lib -ljpeg|-ljpeg|g' configure +sed -i 's|-L\$with_libtiff\/lib -ltiff|-ltiff|g' configure +sed -i 's|-lgeotiff -L$with_geotiff $LIBS|-lgeotiff $LIBS|g' configure +sed -i 's|-L\$with_geotiff\/lib -lgeotiff $LIBS|-lgeotiff $LIBS|g' configure +popd + +%if %{with python3} || %{with python2} +# Fix Python samples to depend on correct interpreter +pushd gdal + mkdir -p swig/python3/samples + pushd swig/python/samples + for f in `find . -name '*.py'`; do + sed 's|^#!.\+python$|#!/usr/bin/python3|' $f > ../../python3/samples/$f + chmod --reference=$f ../../python3/samples/$f + sed -i 's|^#!.\+python$|#!/usr/bin/python2|' $f + done + popd +popd +%endif + +# Adjust check for LibDAP version +# http://trac.osgeo.org/gdal/ticket/4545 +pushd gdal +%if %cpuarch == 64 + sed -i 's|with_dods_root/lib|with_dods_root/lib64|' configure +%endif + +# Fix mandir +sed -i "s|^mandir=.*|mandir='\${prefix}/share/man'|" configure + +# Add our custom cflags when trying to find geos +# https://bugzilla.redhat.com/show_bug.cgi?id=1284714 +sed -i 's|CFLAGS=\"${GEOS_CFLAGS}\"|CFLAGS=\"${CFLAGS} ${GEOS_CFLAGS}\"|g' configure +popd + +%build +#TODO: Couldn't I have modified that in the prep section? +%ifarch sparcv9 sparc64 s390 s390x +export CFLAGS="$RPM_OPT_FLAGS -fPIC" +%else +export CFLAGS="$RPM_OPT_FLAGS -fpic" +%endif +export CXXFLAGS="$CFLAGS -I%{_includedir}/libgeotiff -I%{_includedir}/tirpc" +export CPPFLAGS="$CPPFLAGS -I%{_includedir}/libgeotiff -I%{_includedir}/tirpc" + +# For future reference: +# epsilon: Stalled review -- https://bugzilla.redhat.com/show_bug.cgi?id=660024 +# Building without pgeo driver, because it drags in Java + +%if 0%{?fedora} >= 27 || 0%{?rhel} > 7 +%global g2clib g2c_v1.6.0 +%else +%global g2clib grib2c +%endif + +pushd gdal +%configure \ + LIBS="-l%{g2clib} -ltirpc" \ + --with-autoload=%{_libdir}/%{name}plugins \ + --datadir=%{_datadir}/%{name}/ \ + --includedir=%{_includedir}/%{name}/ \ + --prefix=%{_prefix} \ + --with-armadillo \ + --with-curl \ + --with-cfitsio=%{_prefix} \ + --with-dods-root=%{_prefix} \ + --with-expat \ + --with-freexl \ + --with-geos \ + --with-geotiff=external \ + --with-gif \ + --with-gta \ + --with-hdf4 \ + --with-hdf5 \ + --with-jasper \ + --with-java \ + --with-jpeg \ + --with-libjson-c \ + --without-jpeg12 \ + --with-liblzma \ + --with-libtiff=external \ + --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 + +sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool +sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool +popd + +# {?_smp_mflags} doesn't work; Or it does -- who knows! +# NOTE: running autoconf seems to break build: +# fitsdataset.cpp:37:10: fatal error: fitsio.h: No such file or directory +# #include + +POPPLER_OPTS="POPPLER_0_20_OR_LATER=yes POPPLER_0_23_OR_LATER=yes POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes" +%if 0%{?fedora} > 26 || 0%{?rhel} > 7 +POPPLER_OPTS="$POPPLER_OPTS POPPLER_0_58_OR_LATER=yes" +%endif + +pushd gdal +export SHLIB_LINK="$SHLIB_LINK" +%{__make} %{?_smp_mflags} $POPPLER_OPTS + +%{__make} man +%{__make} docs +popd + +# Build some utilities, as requested in BZ #1271906 +pushd ogr/ogrsf_frmts/s57/ + make all +popd + +pushd frmts/iso8211/ + make all +popd + +# Make Java module and documentation +pushd swig/java + make + ant maven +popd + +%mvn_artifact swig/java/build/maven/gdal-%version.pom swig/java/build/maven/gdal-%version.jar + +# Make Python modules +pushd swig/python + %{?with_python2:%py2_build} + %{?with_python3:%py3_build} +popd + +# Make Python modules +pushd swig/perl + perl Makefile.PL INSTALLDIRS=vendor + %make_build +popd + +# --------- Documentation ---------- + +# No useful documentation in swig +%global docdirs apps doc doc/br doc/ru ogr ogr/ogrsf_frmts frmts/gxf frmts/iso8211 frmts/pcidsk frmts/sdts frmts/vrt ogr/ogrsf_frmts/dgn/ +for docdir in %{docdirs}; do + # CreateHTML and PDF documentation, if specified + pushd gdal/$docdir + if [ ! -f Doxyfile ]; then + doxygen -g + else + doxygen -u + fi + sed -i -e 's|^GENERATE_LATEX|GENERATE_LATEX = YES\n#GENERATE_LATEX |' Doxyfile + sed -i -e 's|^GENERATE_HTML|GENERATE_HTML = YES\n#GENERATE_HTML |' Doxyfile + sed -i -e 's|^USE_PDFLATEX|USE_PDFLATEX = YES\n#USE_PDFLATEX |' Doxyfile + + if [ $docdir == "doc/ru" ]; then + sed -i -e 's|^OUTPUT_LANGUAGE|OUTPUT_LANGUAGE = Russian\n#OUTPUT_LANGUAGE |' Doxyfile + fi + %{__rm} -rf latex html + doxygen + popd + + %if %{build_refman} + pushd gdal/latex + sed -i -e '/rfoot\[/d' -e '/lfoot\[/d' doxygen.sty + sed -i -e '/small/d' -e '/large/d' refman.tex + sed -i -e 's|pdflatex|pdflatex -interaction nonstopmode |g' Makefile + make refman.pdf || true + popd + %endif + popd +done + + +%install +%{__rm} -rf %{buildroot} + +pushd gdal/swig/python + %{?with_python2:%py2_install} + %{?with_python3:%py3_install} +popd + +pushd gdal/swig/perl + %make_install +popd + +pushd gdal +make DESTDIR=%{buildroot} \ + install \ + install-man +popd + +%{__install} -pm 755 ogr/ogrsf_frmts/s57/s57dump %{buildroot}%{_bindir} +%{__install} -pm 755 frmts/iso8211/8211createfromxml %{buildroot}%{_bindir} +%{__install} -pm 755 frmts/iso8211/8211dump %{buildroot}%{_bindir} +%{__install} -pm 755 frmts/iso8211/8211view %{buildroot}%{_bindir} + +# Directory for auto-loading plugins +mkdir -p %{buildroot}%{_libdir}/%{name}plugins + +#TODO: Don't do that? +find %{buildroot}%{perl_vendorarch} -name "*.dox" -exec rm -rf '{}' \; +rm %{buildroot}%{perl_archlib}/perllocal.pod + +%if %{without python} && %{without python3} +%{__rm} %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 '{}' \; + +# 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} + +# Install refmans +for docdir in %{docdirs}; do + pushd gdal/$docdir + path=%{_builddir}/%{name}-%{version}-fedora/gdal/refman + mkdir -p $path/html/$docdir + cp -r html $path/html/$docdir + + # Install all Refmans + %if %{build_refman} + if [ -f gdal/latex/refman.pdf ]; then + mkdir -p $path/pdf/$docdir + cp gdal/latex/refman.pdf $path/pdf/$docdir + fi + %endif + popd +done + +pushd gdal +# Install formats documentation +for dir in gdal_frmts ogrsf_frmts; do + mkdir -p $dir + find frmts -name "*.html" -exec install -p -m 644 '{}' $dir \; +done +popd + +#TODO: Header date lost during installation +# Install multilib cpl_config.h bz#430894 +%{__install} -p -D -m 644 port/cpl_config.h %{buildroot}%{_includedir}/%{name}/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}/%{name}/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 port/cpl_config.h + +# Create and install pkgconfig file +#TODO: Why does that exist? Does Grass really use it? I don't think so. +# http://trac.osgeo.org/gdal/ticket/3470 +#>>>>>>>>>>>>> +cat > %{name}.pc <>>>>>>>>>>>> +cat > %{buildroot}%{_bindir}/%{name}-config < - 3.0.2-1 +- Initial packaging for EPEL 8 diff --git a/sources b/sources index e69de29..07f82ea 100644 --- a/sources +++ b/sources @@ -0,0 +1,2 @@ +SHA512 (gdalautotest-3.0.1.zip) = 07f50ac17d7033ba08e4ca4552a0f59eebbe2b43f351b675df22fae6087edd98687b46b50f7d3fea2a2159ad4183082a3afaac8caa9bf632a410492f098c5be8 +SHA512 (gdal-3.0.2-fedora.tar.xz) = 0cd3154a86d36bf161b64c95e1227c06969e7517484eb80876fab4f5869d51e4cf2c4849a5ec653ae46a982022c6f226bd19ba3bc3b6030919071279b1789b33 From 639c8ddaad64c142f6752fd9aac6b78b41ca9b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Devrim=20G=C3=BCnd=C3=BCz?= Date: Tue, 5 Nov 2019 16:02:02 +0000 Subject: [PATCH 03/13] Fix patch levels --- gdal.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdal.spec b/gdal.spec index 2500cc6..554635a 100644 --- a/gdal.spec +++ b/gdal.spec @@ -328,10 +328,10 @@ popd #%%patch1 -p1 -b .g2clib~ #%%patch2 -p1 -b .jni~ -%patch3 -p1 -b .completion~ -%patch8 -p1 -b .java~ -%patch9 -p1 -b .zlib~ -%patch10 -p1 -b .perl-build~ +%patch3 -p0 -b .completion~ +%patch8 -p0 -b .java~ +%patch9 -p0 -b .zlib~ +%patch10 -p0 -b .perl-build~ # Copy in PROVENANCE.TXT-fedora cp -p %SOURCE4 . From 3987881e824d7ec1c7e80153d5f7f9ea0244a725 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Devrim=20G=C3=BCnd=C3=BCz?= Date: Tue, 5 Nov 2019 17:31:39 +0000 Subject: [PATCH 04/13] Disable patch9 for testing --- gdal.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index 554635a..2a0d7e7 100644 --- a/gdal.spec +++ b/gdal.spec @@ -330,7 +330,7 @@ popd #%%patch2 -p1 -b .jni~ %patch3 -p0 -b .completion~ %patch8 -p0 -b .java~ -%patch9 -p0 -b .zlib~ +#%patch9 -p0 -b .zlib~ %patch10 -p0 -b .perl-build~ # Copy in PROVENANCE.TXT-fedora From 677558f0ba0cb049e11fcdfbd3e556a22794bcd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Devrim=20G=C3=BCnd=C3=BCz?= Date: Wed, 6 Nov 2019 00:08:08 +0000 Subject: [PATCH 05/13] gdal: More 3.0.2 update --- gdal.spec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdal.spec b/gdal.spec index 2a0d7e7..96a5da1 100644 --- a/gdal.spec +++ b/gdal.spec @@ -494,11 +494,11 @@ export SHLIB_LINK="$SHLIB_LINK" popd # Build some utilities, as requested in BZ #1271906 -pushd ogr/ogrsf_frmts/s57/ +pushd gdal/ogr/ogrsf_frmts/s57/ make all popd -pushd frmts/iso8211/ +pushd gdal/frmts/iso8211/ make all popd @@ -630,7 +630,7 @@ done pushd gdal # Install formats documentation -for dir in gdal_frmts ogrsf_frmts; do +for dir in gdal/frmts gdal/ogr/ogrsf_frmts gdal/ogr; do mkdir -p $dir find frmts -name "*.html" -exec install -p -m 644 '{}' $dir \; done @@ -800,7 +800,7 @@ popd %files libs -%doc LICENSE.TXT NEWS PROVENANCE.TXT COMMITTERS PROVENANCE.TXT-fedora +%doc gdal/LICENSE.TXT gdal/NEWS gdal/PROVENANCE.TXT gdal/COMMITTERS %{_libdir}/libgdal.so.20 %{_libdir}/libgdal.so.20.* %{_datadir}/%{name} From 46989b2a975c0dc6bdaad033376d9a7d81350b8b Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Thu, 24 Sep 2020 17:32:49 +0000 Subject: [PATCH 06/13] remove package.cfg per new epel-playground policy --- package.cfg | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 package.cfg diff --git a/package.cfg b/package.cfg deleted file mode 100644 index 66ea79d..0000000 --- a/package.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[koji] -targets = epel8 epel8-playground \ No newline at end of file From 204ddbd7ba72646a8adfdb6f500fb69791dbd0ac Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 19 May 2021 00:22:15 +0200 Subject: [PATCH 07/13] Rebuild --- gdal.spec | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gdal.spec b/gdal.spec index 60213a8..c7a1919 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 5%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 7%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -564,7 +564,7 @@ done pushd %{name}autotest-%{testversion} # Export test enviroment - export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python_sitearch} + export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitearch} #TODO: Nötig? export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{buildroot}%{_libdir} # export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%%{buildroot}%%{_libdir}:$java_inc @@ -709,6 +709,12 @@ popd #Or as before, using ldconfig %changelog +* Tue May 18 2021 Sandro Mani - 3.0.4-7 +- Rebuild + +* Tue May 18 2021 Sandro Mani +- Rebuild + * Sat May 09 2020 Markus Neteler - 3.0.4-5 * disabled JAVA and LaTeX support for EPEL8, due to (yet) missing dependencies From 13a0f88384e576496a4bdf41fec67cb40e74d5d9 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 4 Jun 2021 14:25:30 -0600 Subject: [PATCH 08/13] Rebuild for poppler 20.11 (EL 8.4) (bz#1962667) --- gdal.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index c7a1919..08397a5 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 7%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 8%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -709,6 +709,9 @@ popd #Or as before, using ldconfig %changelog +* Fri Jun 04 2021 Orion Poplawski - 3.0.4-8 +- Rebuild for poppler 20.11 (EL 8.4) (bz#1962667) + * Tue May 18 2021 Sandro Mani - 3.0.4-7 - Rebuild From 394d408510d7d54ccfd7612ab64d3b7fb5725b17 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Thu, 23 Sep 2021 13:34:33 +0200 Subject: [PATCH 09/13] Rebuild (ldap) --- gdal.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index 08397a5..37cf5e3 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 8%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 9%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -709,6 +709,9 @@ popd #Or as before, using ldconfig %changelog +* Thu Sep 23 2021 Sandro Mani - 3.0.4-9 +- Rebuild (ldap) + * Fri Jun 04 2021 Orion Poplawski - 3.0.4-8 - Rebuild for poppler 20.11 (EL 8.4) (bz#1962667) From 067343c0a28ffdce5d99a182cb0ed392bbc236f5 Mon Sep 17 00:00:00 2001 From: Guillaume Foreau Date: Mon, 4 Oct 2021 13:19:09 +0000 Subject: [PATCH 10/13] Restore java package generation --- gdal.spec | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/gdal.spec b/gdal.spec index 37cf5e3..211c85e 100644 --- a/gdal.spec +++ b/gdal.spec @@ -75,6 +75,7 @@ Patch5: gdal_installapps.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: libtool +BuildRequires: make BuildRequires: automake BuildRequires: autoconf BuildRequires: ant @@ -97,17 +98,15 @@ BuildRequires: ghostscript BuildRequires: hdf-devel BuildRequires: hdf-static BuildRequires: hdf5-devel -# No complete java yet in EL8 %if 0%{?rhel} < 8 BuildRequires: java-devel >= 1:1.6.0 +%else +BuildRequires: java-1.8.0-openjdk-devel %endif BuildRequires: jasper-devel BuildRequires: jpackage-utils -# No complete java yet in EL8 -%if 0%{?rhel} < 8 -# For 'mvn_artifact' and 'mvn_install' +# For 'mvn_artifact' BuildRequires: javapackages-local -%endif BuildRequires: json-c-devel BuildRequires: libgeotiff-devel # No libgta in EL5 @@ -210,8 +209,6 @@ Provides: bundled(degrib) = 2.14 This package contains the GDAL file format library. -# No complete java yet in EL8 -%if 0%{?rhel} < 8 %package java Summary: Java modules for the GDAL file format library Requires: jpackage-utils @@ -228,7 +225,6 @@ BuildArch: noarch %description javadoc This package contains the API documentation for %{name}. -%endif %package perl @@ -351,9 +347,7 @@ autoreconf -ifv --with-hdf4 \ --with-hdf5 \ --with-jasper \ -%if 0%{?rhel} < 8 --with-java \ -%endif --with-jpeg \ --with-libjson-c \ --without-jpeg12 \ @@ -388,15 +382,12 @@ make docs make -C ogr/ogrsf_frmts/s57 all make -C frmts/iso8211 all -# No complete java yet in EL8 -%if 0%{?rhel} < 8 # Make Java module and documentation pushd swig/java make ant maven popd %mvn_artifact swig/java/build/maven/gdal-%version.pom swig/java/build/maven/gdal-%version.jar -%endif # Make Python modules pushd swig/python @@ -461,8 +452,6 @@ rm %buildroot%_mandir/man1/{pct2rgb,rgb2pct}.1 find %{buildroot}%{perl_vendorarch} -name "*.so" -exec chmod 755 '{}' \; find %{buildroot}%{perl_vendorarch} -name "*.pm" -exec chmod 644 '{}' \; -# No complete java yet in EL8 -%if 0%{?rhel} < 8 # install Java plugin %mvn_install -J swig/java/java @@ -477,7 +466,6 @@ 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 # Install refmans for docdir in %{docdirs}; do @@ -553,8 +541,6 @@ done rm %{buildroot}%{_datadir}/%{name}/LICENSE.TXT -# No complete java yet in EL8 -%if 0%{?rhel} < 8 %check %if %{run_tests} for i in -I/usr/lib/jvm/java/include{,/linux}; do @@ -584,7 +570,6 @@ pushd %{name}autotest-%{testversion} # Run tests but force normal exit in the end ./run_all.py || true popd -%endif #%%{run_tests} @@ -645,15 +630,12 @@ popd %{_libdir}/*.so %{_libdir}/pkgconfig/%{name}.pc -# No complete java yet in EL8 -%if 0%{?rhel} < 8 # 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 From b871d71276c1cfdecd81b05d6d0b8f1bde46dcaf Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 4 Oct 2021 16:19:04 +0200 Subject: [PATCH 11/13] Bump release --- gdal.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index 211c85e..11f42cd 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 9%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 10%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -691,6 +691,9 @@ popd #Or as before, using ldconfig %changelog +* Mon Oct 04 2021 Sandro Mani - 3.0.4-10 +- Restore java subpackage + * Thu Sep 23 2021 Sandro Mani - 3.0.4-9 - Rebuild (ldap) From 7cd68a7648cb227bec89de298930c571cdecb2ba Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Wed, 1 Jun 2022 12:18:44 +0200 Subject: [PATCH 12/13] Rebuild (armadillo) --- gdal.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index 11f42cd..328dcde 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 10%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 11%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -691,6 +691,9 @@ popd #Or as before, using ldconfig %changelog +* Wed Jun 01 2022 Sandro Mani - 3.0.4-11 +- Rebuild (armadillo) + * Mon Oct 04 2021 Sandro Mani - 3.0.4-10 - Restore java subpackage From 96a397216fc90b8b772c3a6669095b0fd19d7881 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mon, 1 Jan 2024 18:59:01 +0100 Subject: [PATCH 13/13] Rebuild (armadillo) --- gdal.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdal.spec b/gdal.spec index 328dcde..02360ac 100644 --- a/gdal.spec +++ b/gdal.spec @@ -46,7 +46,7 @@ Name: gdal Version: 3.0.4 -Release: 11%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} +Release: 12%{?dist}%{?bootstrap:.%{bootstrap}.bootstrap} Summary: GIS file format library License: MIT URL: http://www.gdal.org @@ -691,6 +691,9 @@ popd #Or as before, using ldconfig %changelog +* Mon Jan 01 2024 Sandro Mani - 3.0.4-12 +- Rebuild (armadillo) + * Wed Jun 01 2022 Sandro Mani - 3.0.4-11 - Rebuild (armadillo)