From c64d95299e08448abb21f9e55e815ec6b2c8cb7d Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 30 Dec 2018 09:55:41 +0100 Subject: [PATCH] - updated to 2.4.0 - updated perl patch - poppler patch replaced by a new one (support for poppler 0.72) - removed oudated php,fpic,armadillo patches - added pc patch (fix libdir in .pc file) - php and ruby bindings have been removed from sources --- gdal-armadillo.patch | 12 -- gdal-fpic.patch | 12 -- gdal-pc.patch | 20 ++++ gdal-perl.patch | 10 +- gdal-php.patch | 11 -- gdal-poppler.patch | 256 ++++++------------------------------------- gdal.spec | 153 +++++++------------------- 7 files changed, 97 insertions(+), 377 deletions(-) delete mode 100644 gdal-armadillo.patch delete mode 100644 gdal-fpic.patch create mode 100644 gdal-pc.patch delete mode 100644 gdal-php.patch diff --git a/gdal-armadillo.patch b/gdal-armadillo.patch deleted file mode 100644 index 6824e3d..0000000 --- a/gdal-armadillo.patch +++ /dev/null @@ -1,12 +0,0 @@ -Kill warnings in Armadillo detection code to make compiler output empty ---- gdal-1.11.0/configure.ac.orig 2014-06-14 15:45:50.005039893 +0200 -+++ gdal-1.11.0/configure.ac 2014-06-14 16:46:47.261630331 +0200 -@@ -4227,7 +4227,7 @@ - rm -f testarmadillo.* - rm -f testarmadillo - echo '#include ' > testarmadillo.cpp -- echo 'int main(int argc, char** argv) { arma::mat matInput(2,2); const arma::mat& matInv = arma::inv(matInput); return 0; } ' >> testarmadillo.cpp -+ echo 'int main(int, char**) { arma::mat matInput(2,2); const arma::mat& matInv = arma::inv(matInput); (void)matInv; return 0; } ' >> testarmadillo.cpp - if test -z "`${CXX} ${CPPFLAGS} testarmadillo.cpp -o testarmadillo -larmadillo 2>&1`" ; then - HAVE_ARMADILLO=yes - LIBS="-larmadillo ${LIBS}" diff --git a/gdal-fpic.patch b/gdal-fpic.patch deleted file mode 100644 index 3f12b77..0000000 --- a/gdal-fpic.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- gdal-1.9.0/swig/ruby/RubyMakefile.mk~ 2012-01-04 08:03:41.000000000 +0100 -+++ gdal-1.9.0/swig/ruby/RubyMakefile.mk 2012-02-13 16:12:17.778605160 +0100 -@@ -41,7 +41,8 @@ - RUBY_LIB := -l$(RUBY_SO_NAME) - else - RUBY_MODULES=$(RUBY_MODULES_LIN) --LDFLAGS += -Xcompiler -shared -L$(RUBY_LIB_DIR) -+LDFLAGS += -fPIC -Xcompiler -shared -L$(RUBY_LIB_DIR) -+CFLAGS += -fPIC - RUBY_LIB := -l$(RUBY_SO_NAME) - endif - diff --git a/gdal-pc.patch b/gdal-pc.patch new file mode 100644 index 0000000..75d1044 --- /dev/null +++ b/gdal-pc.patch @@ -0,0 +1,20 @@ +--- gdal-2.4.0/GNUmakefile.orig 2018-12-14 22:34:19.000000000 +0100 ++++ gdal-2.4.0/GNUmakefile 2018-12-29 19:15:29.433390410 +0100 +@@ -314,6 +314,7 @@ + rm -f gdal.pc + echo 'CONFIG_VERSION='`cat ./VERSION`'' >> gdal.pc + echo 'CONFIG_INST_PREFIX=$(INST_PREFIX)' >> gdal.pc ++ echo 'CONFIG_INST_LIBDIR=$(INST_LIB)' >> gdal.pc + echo 'CONFIG_INST_LIBS=$(CONFIG_LIBS_INS)' >> gdal.pc + echo 'CONFIG_INST_CFLAGS=-I$(INST_INCLUDE)' >> gdal.pc + echo 'CONFIG_INST_DATA=$(INST_DATA)' >> gdal.pc +--- gdal-2.4.0/gdal.pc.in.orig 2018-12-14 22:34:20.000000000 +0100 ++++ gdal-2.4.0/gdal.pc.in 2018-12-29 19:15:47.330056870 +0100 +@@ -1,6 +1,6 @@ + prefix=${CONFIG_INST_PREFIX} + exec_prefix=${prefix} +-libdir=${exec_prefix}/lib ++libdir=${CONFIG_INST_LIBDIR} + includedir=${exec_prefix}/include + datadir=${CONFIG_INST_DATA} + diff --git a/gdal-perl.patch b/gdal-perl.patch index b083600..d22b695 100644 --- a/gdal-perl.patch +++ b/gdal-perl.patch @@ -1,9 +1,9 @@ ---- gdal-1.8.0/swig/perl/GNUmakefile.orig 2011-01-14 06:19:06.000000000 +0100 -+++ gdal-1.8.0/swig/perl/GNUmakefile 2011-01-26 17:16:08.978356589 +0100 -@@ -26,7 +26,7 @@ - gdal_wrap.cc: generate +--- gdal-2.4.0/swig/perl/GNUmakefile.orig 2018-12-26 21:34:07.219588369 +0100 ++++ gdal-2.4.0/swig/perl/GNUmakefile 2018-12-26 21:35:04.292921051 +0100 +@@ -28,7 +28,7 @@ + if [ -f Makefile_Geo__GNM ]; then $(MAKE) -f Makefile_Geo__GNM; fi - Makefile_Geo__GDAL: + Makefile_Geo__GDAL: ${WRAPPERS} Makefile.PL - perl Makefile.PL INSTALL_BASE=$(INST_PREFIX) + perl Makefile.PL INSTALLDIRS=vendor diff --git a/gdal-php.patch b/gdal-php.patch deleted file mode 100644 index ac11ce6..0000000 --- a/gdal-php.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- gdal-1.9.0/swig/php/GNUmakefile.orig 2012-01-04 08:03:42.000000000 +0100 -+++ gdal-1.9.0/swig/php/GNUmakefile 2012-01-21 10:52:29.873728130 +0100 -@@ -28,7 +28,7 @@ - - generate: ${WRAPPERS} - --build: php_gdal.so -+build: $(all_libs) - - # This directive should actually do an install. - install: build diff --git a/gdal-poppler.patch b/gdal-poppler.patch index fd912a6..e1d8a62 100644 --- a/gdal-poppler.patch +++ b/gdal-poppler.patch @@ -1,230 +1,40 @@ -From 2d789902ffb48251ec2ff632320d78ee088c2c5f Mon Sep 17 00:00:00 2001 -From: Even Rouault -Date: Sat, 5 May 2018 22:18:37 +0200 -Subject: [PATCH] Fix build with recent Poppler (0.64) (fix #573) - ---- - gdal/frmts/pdf/pdfobject.cpp | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/gdal/frmts/pdf/pdfobject.cpp b/gdal/frmts/pdf/pdfobject.cpp -index ae734a74e4c..5eab5dd1546 100644 ---- a/gdal/frmts/pdf/pdfobject.cpp -+++ b/gdal/frmts/pdf/pdfobject.cpp -@@ -1055,7 +1055,12 @@ const CPLString& GDALPDFObjectPoppler::GetString() - { - if (GetType() == PDFObjectType_String) +--- gdal-2.4.0/frmts/pdf/pdfdataset.cpp.orig 2018-12-14 22:37:15.000000000 +0100 ++++ gdal-2.4.0/frmts/pdf/pdfdataset.cpp 2018-12-27 05:35:39.755925135 +0100 +@@ -3459,7 +3459,7 @@ + #endif + if( ocg != nullptr && ocg->getName() != nullptr ) + { +- const char* pszLayerName = (const char*)ocg->getName()->getCString(); ++ const char* pszLayerName = (const char*)ocg->getName()->c_str(); + AddLayer(pszLayerName); + oLayerOCGMapPoppler[pszLayerName] = ocg; + } +@@ -4787,7 +4787,7 @@ + GooString* poMetadata = poCatalogPoppler->readMetadata(); + if (poMetadata) { -+#ifdef POPPLER_0_58_OR_LATER -+ // At least available since poppler 0.41 -+ const GooString* gooString = m_po->getString(); -+#else +- const char* pszContent = poMetadata->getCString(); ++ const char* pszContent = poMetadata->c_str(); + if (pszContent != nullptr && + STARTS_WITH(pszContent, "getString(); -+#endif - return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast(gooString->getCString()), + #endif +- return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast(gooString->getCString()), ++ return (osStr = GDALPDFGetUTF8StringFromBytes(reinterpret_cast(gooString->c_str()), static_cast(gooString->getLength()))); } -From 69e07012533b8393edd8b9ec4da6d239d204858a Mon Sep 17 00:00:00 2001 -From: Even Rouault -Date: Fri, 12 Oct 2018 19:02:40 +0200 -Subject: [PATCH] Add support for Poppler 0.69 (fixes #1004) - ---- - gdal/GDALmake.opt.in | 1 + - gdal/configure | 61 ++++++++++++++++++++++++++--------- - gdal/configure.ac | 56 +++++++++++++++++++++++--------- - gdal/frmts/pdf/GNUmakefile | 4 +++ - gdal/frmts/pdf/makefile.vc | 6 +++- - gdal/frmts/pdf/pdfdataset.cpp | 12 +++++++ - gdal/nmake.opt | 2 ++ - 7 files changed, 111 insertions(+), 31 deletions(-) - -diff --git a/gdal/GDALmake.opt.in b/gdal/GDALmake.opt.in -index c3b5b34f92b..eaf005e5a14 100644 ---- a/gdal/GDALmake.opt.in -+++ b/gdal/GDALmake.opt.in -@@ -473,6 +473,7 @@ POPPLER_BASE_STREAM_HAS_TWO_ARGS = @POPPLER_BASE_STREAM_HAS_TWO_ARGS@ - POPPLER_0_20_OR_LATER = @POPPLER_0_20_OR_LATER@ - POPPLER_0_23_OR_LATER = @POPPLER_0_23_OR_LATER@ - POPPLER_0_58_OR_LATER = @POPPLER_0_58_OR_LATER@ -+POPPLER_0_69_OR_LATER = @POPPLER_0_69_OR_LATER@ - POPPLER_INC = @POPPLER_INC@ - POPPLER_PLUGIN_LIB = @POPPLER_PLUGIN_LIB@ - -index 857f7fdb445..b6e59020c5b 100644 ---- a/gdal/configure.ac -+++ b/gdal/configure.ac -@@ -4446,6 +4446,7 @@ POPPLER_BASE_STREAM_HAS_TWO_ARGS=no - POPPLER_0_20_OR_LATER=no - POPPLER_0_23_OR_LATER=no - POPPLER_0_58_OR_LATER=no -+POPPLER_0_69_OR_LATER=no - - AC_MSG_CHECKING([for poppler]) - -@@ -4486,21 +4487,45 @@ if test "$with_poppler" != "no" -a "$with_poppler" != ""; then - - CHECK_OTHER_POPPLER_VERSION=yes - -- # And now we check if we have Poppler >= 0.58.0 -- AC_MSG_CHECKING([if Object does have new API (>= 0.58.0)]) -- rm -f testpoppler.* -- echo '#include ' > testpoppler.cpp -- echo 'int main(int argc, char** argv) { Object o(objNull); return 0; }' >> testpoppler.cpp -- if test -z "`${CXX} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then -- POPPLER_0_58_OR_LATER=yes -- POPPLER_0_23_OR_LATER=yes -- POPPLER_0_20_OR_LATER=yes -- POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes -- POPPLER_HAS_OPTCONTENT=yes -- CHECK_OTHER_POPPLER_VERSION=no -- AC_MSG_RESULT([yes]) -- else -- AC_MSG_RESULT([no]) -+ if test "$CHECK_OTHER_POPPLER_VERSION" = "yes"; then -+ AC_MSG_CHECKING([if OptionalContent has API >= 0.69.0]) -+ rm -f testpoppler.* -+ echo '#include ' > testpoppler.cpp -+ echo 'int main(int argc, char** argv) {' >> testpoppler.cpp -+ echo 'OCGs ocg(nullptr, nullptr);' >> testpoppler.cpp -+ echo 'ocg.getOCGs().size();' >> testpoppler.cpp -+ echo 'return 0; }' >> testpoppler.cpp -+ if test -z "`${CXX} ${CXXFLAGS} ${CPPFLAGS} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then -+ POPPLER_0_69_OR_LATER=yes -+ POPPLER_0_58_OR_LATER=yes -+ POPPLER_0_23_OR_LATER=yes -+ POPPLER_0_20_OR_LATER=yes -+ POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes -+ POPPLER_HAS_OPTCONTENT=yes -+ CHECK_OTHER_POPPLER_VERSION=no -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ fi -+ fi -+ -+ if test "$CHECK_OTHER_POPPLER_VERSION" = "yes"; then -+ # And now we check if we have Poppler >= 0.58.0 -+ AC_MSG_CHECKING([if Object does have new API (>= 0.58.0)]) -+ rm -f testpoppler.* -+ echo '#include ' > testpoppler.cpp -+ echo 'int main(int argc, char** argv) { Object o(objNull); return 0; }' >> testpoppler.cpp -+ if test -z "`${CXX} ${CXXFLAGS} ${CPPFLAGS} testpoppler.cpp -c ${POPPLER_INC} 2>&1`" ; then -+ POPPLER_0_58_OR_LATER=yes -+ POPPLER_0_23_OR_LATER=yes -+ POPPLER_0_20_OR_LATER=yes -+ POPPLER_BASE_STREAM_HAS_TWO_ARGS=yes -+ POPPLER_HAS_OPTCONTENT=yes -+ CHECK_OTHER_POPPLER_VERSION=no -+ AC_MSG_RESULT([yes]) -+ else -+ AC_MSG_RESULT([no]) -+ fi - fi - - if test "$CHECK_OTHER_POPPLER_VERSION" = "yes"; then -@@ -4585,6 +4610,7 @@ AC_SUBST(POPPLER_BASE_STREAM_HAS_TWO_ARGS, $POPPLER_BASE_STREAM_HAS_TWO_ARGS) - AC_SUBST(POPPLER_0_20_OR_LATER, $POPPLER_0_20_OR_LATER) - AC_SUBST(POPPLER_0_23_OR_LATER, $POPPLER_0_23_OR_LATER) - AC_SUBST(POPPLER_0_58_OR_LATER, $POPPLER_0_58_OR_LATER) -+AC_SUBST(POPPLER_0_69_OR_LATER, $POPPLER_0_69_OR_LATER) - AC_SUBST(POPPLER_INC, $POPPLER_INC) - AC_SUBST(POPPLER_PLUGIN_LIB, $POPPLER_PLUGIN_LIB) - -diff --git a/gdal/frmts/pdf/GNUmakefile b/gdal/frmts/pdf/GNUmakefile -index 2014070eac7..618072f05d3 100644 ---- a/gdal/frmts/pdf/GNUmakefile -+++ b/gdal/frmts/pdf/GNUmakefile -@@ -35,6 +35,10 @@ ifeq ($(POPPLER_0_58_OR_LATER),yes) - CPPFLAGS += -DPOPPLER_0_58_OR_LATER - endif - -+ifeq ($(POPPLER_0_69_OR_LATER),yes) -+CPPFLAGS += -DPOPPLER_0_69_OR_LATER -+endif -+ - ifeq ($(HAVE_PODOFO),yes) - CPPFLAGS += -DHAVE_PODOFO - endif -diff --git a/gdal/frmts/pdf/makefile.vc b/gdal/frmts/pdf/makefile.vc -index b4fa14d0a18..ad76d3de70c 100644 ---- a/gdal/frmts/pdf/makefile.vc -+++ b/gdal/frmts/pdf/makefile.vc -@@ -14,7 +14,7 @@ OBJ = $(OBJ) ..\..\ogr\ogrsf_frmts\mem\ogrmemdatasource.obj ..\..\ogr\ogrsf_frmt - EXTRAFLAGS = -I..\vrt -I..\mem -I..\..\ogr\ogrsf_frmts\mem $(POPPLER_EXTRAFLAGS) $(PODOFO_EXTRAFLAGS) $(PDFIUM_EXTRAFLAGS) - - !IFDEF POPPLER_ENABLED --POPPLER_EXTRAFLAGS = $(POPPLER_CFLAGS) $(POPPLER_HAS_OPTCONTENT_FLAGS) $(POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS) $(POPPLER_0_20_OR_LATER_FLAGS) $(POPPLER_0_23_OR_LATER_FLAGS) $(POPPLER_0_58_OR_LATER_FLAGS) -DHAVE_POPPLER -+POPPLER_EXTRAFLAGS = $(POPPLER_CFLAGS) $(POPPLER_HAS_OPTCONTENT_FLAGS) $(POPPLER_BASE_STREAM_HAS_TWO_ARGS_FLAGS) $(POPPLER_0_20_OR_LATER_FLAGS) $(POPPLER_0_23_OR_LATER_FLAGS) $(POPPLER_0_58_OR_LATER_FLAGS) $(POPPLER_0_69_OR_LATER_FLAGS) -DHAVE_POPPLER - - !IFDEF POPPLER_HAS_OPTCONTENT - POPPLER_HAS_OPTCONTENT_FLAGS = -DPOPPLER_HAS_OPTCONTENT -@@ -36,6 +36,10 @@ POPPLER_0_23_OR_LATER_FLAGS = -DPOPPLER_0_23_OR_LATER - POPPLER_0_58_OR_LATER_FLAGS = -DPOPPLER_0_58_OR_LATER - !ENDIF - -+!IFDEF POPPLER_0_69_OR_LATER -+POPPLER_0_69_OR_LATER_FLAGS = -DPOPPLER_0_69_OR_LATER -+!ENDIF -+ - !ENDIF - - !IFDEF PODOFO_ENABLED -diff --git a/gdal/frmts/pdf/pdfdataset.cpp b/gdal/frmts/pdf/pdfdataset.cpp -index ee89fd07564..1a56f57ee06 100644 ---- a/gdal/frmts/pdf/pdfdataset.cpp -+++ b/gdal/frmts/pdf/pdfdataset.cpp -@@ -3440,10 +3440,16 @@ void PDFDataset::FindLayersPoppler() - } else - { -+#ifdef POPPLER_0_69_OR_LATER -+ for( const auto& refOCGPair: optContentConfig->getOCGs() ) -+ { -+ auto ocg = refOCGPair.second.get(); -+#else - GooList* ocgList = optContentConfig->getOCGs(); - for(int i=0;igetLength();i++) - { - OptionalContentGroup* ocg = (OptionalContentGroup*) ocgList->get(i); -+#endif - if( ocg != NULL && ocg->getName() != NULL ) - { - const char* pszLayerName = (const char*)ocg->getName()->getCString(); -@@ -3472,10 +3478,16 @@ void PDFDataset::TurnLayersOnOffPoppler() - { - int i; - int bAll = EQUAL(pszLayers, "ALL"); -+#ifdef POPPLER_0_69_OR_LATER -+ for( const auto& refOCGPair: optContentConfig->getOCGs() ) -+ { -+ auto ocg = refOCGPair.second.get(); -+#else - GooList* ocgList = optContentConfig->getOCGs(); - for(i=0;igetLength();i++) +@@ -1422,7 +1422,7 @@ + char* pszContent = (char*) VSIMalloc(m_nLength + 1); + if (pszContent) { - OptionalContentGroup* ocg = (OptionalContentGroup*) ocgList->get(i); -+#endif - ocg->setState( (bAll) ? OptionalContentGroup::On : OptionalContentGroup::Off ); +- memcpy(pszContent, gstr->getCString(), m_nLength); ++ memcpy(pszContent, gstr->c_str(), m_nLength); + pszContent[m_nLength] = '\0'; } - -diff --git a/gdal/nmake.opt b/gdal/nmake.opt -index a3b88583425..c9ca28d3cd9 100644 ---- a/gdal/nmake.opt -+++ b/gdal/nmake.opt -@@ -632,6 +632,7 @@ OCI_INCLUDE = -I$(ORACLE_HOME)\oci\include - # Uncomment POPPLER_0_20_OR_LATER = YES for Poppler >= 0.20.0 - # Uncomment POPPLER_0_23_OR_LATER = YES for Poppler >= 0.23.0 - # Uncomment POPPLER_0_58_OR_LATER = YES for Poppler >= 0.58.0 -+# Uncomment POPPLER_0_69_OR_LATER = YES for Poppler >= 0.69.0 - #POPPLER_ENABLED = YES - #POPPLER_CFLAGS = -Ie:/kde/include -Ie:/kde/include/poppler - #POPPLER_HAS_OPTCONTENT = YES -@@ -639,6 +640,7 @@ OCI_INCLUDE = -I$(ORACLE_HOME)\oci\include - #POPPLER_0_20_OR_LATER = YES - #POPPLER_0_23_OR_LATER = YES - #POPPLER_0_58_OR_LATER = YES -+#POPPLER_0_69_OR_LATER = YES - #POPPLER_LIBS = e:/kde/lib/poppler.lib e:/kde/lib/freetype.lib e:/kde/lib/liblcms-1.lib advapi32.lib gdi32.lib - - # Uncomment for PDF support + delete gstr; diff --git a/gdal.spec b/gdal.spec index f477e3c..1c884bf 100644 --- a/gdal.spec +++ b/gdal.spec @@ -2,6 +2,9 @@ # - be reasonable about devel dependencies - you do not need all of them to # use gdal (probably a gdal module or driver shall not imply devel # dependency) +# - MongoCXX (mongo/client/dbclient.h, -lmongoclient -lboost_system -lboost_thread -lboost_regex) +# - rasterlite2 +# - sfcgal >= 1.2.2 # - libjpeg12 (needs patching to use system one, --with-jpeg12 is not sufficient as of 1.9.2) # - libkml (1.3.0 needed, not released yet) # - wait for newer pcidsk, switch to external again @@ -12,11 +15,13 @@ # - ECW (http://www.erdas.com/products/ecw/ERDASECWJPEG2000SDK/Details.aspx) # - Kakadu/JPEG2000 (http://www.kakadusoftware.com/) # - MrSID (http://www.lizardtech.com/developer/) +# - LuraTech JP2Lura # - MSG/EUMETSAT (http://www.eumetsat.int/Home/Main/DataAccess/SupportSoftwareTools/index.htm) # - Ingres (--with-ingres=/path) # - Informix DB (--with-idb) # - DWGdirect (members only? http://www.opendwg.org/) # - ESRI SDE (http://www.esri.com/software/arcgis/arcsde/index.html) +# - Teigha DWG/DGN (https://www.opendesign.com/products/drawings?) # # Conditional build: %bcond_without armadillo # Armadillo support for faster TPS transform @@ -37,41 +42,36 @@ %bcond_without spatialite # SpatiaLite support %bcond_without xerces # Xerces support %bcond_without java # Java and MDB support -%bcond_with php # PHP binding [PHP 7 not supported by swig 3.0.x] -%bcond_with ruby # Ruby binding [not available as of 2.0.2] %if %{with podofo} %undefine with_poppler %endif -%if 0%{!?php_name:1} -%define php_name php55 -%endif Summary: Geospatial Data Abstraction Library Summary(pl.UTF-8): Biblioteka abstrakcji danych dotyczących powierzchni Ziemi Name: gdal -Version: 2.2.4 -Release: 9 +Version: 2.4.0 +Release: 1 License: BSD-like Group: Libraries Source0: http://download.osgeo.org/gdal/%{version}/%{name}-%{version}.tar.xz -# Source0-md5: 51b1df61dbdf81473689fab3075e7a5e +# Source0-md5: 794096364a50df4bc7c5b710d997b6b4 Patch0: %{name}-perl.patch Patch1: %{name}-poppler.patch -Patch2: %{name}-php.patch -Patch3: %{name}-fpic.patch +Patch2: %{name}-pc.patch Patch9: %{name}-dds.patch -Patch11: %{name}-armadillo.patch Patch12: %{name}-rasdaman.patch Patch13: %{name}-pluginsdir.patch Patch15: libx32.patch URL: http://www.gdal.org/ -%{?with_php:BuildRequires: %{php_name}-devel} +# 1.x or 2.x supported +BuildRequires: CharLS-devel %{?with_opencl:BuildRequires: OpenCL-devel >= 1.0} %{?with_armadillo:BuildRequires: armadillo-devel} BuildRequires: autoconf >= 2.52 BuildRequires: automake BuildRequires: cfitsio-devel %{?with_crnlib:BuildRequires: crnlib-devel} +BuildRequires: cryptopp-devel BuildRequires: curl-devel BuildRequires: doxygen >= 1.4.2 %{?with_epsilon:BuildRequires: epsilon-compressor-devel} @@ -82,7 +82,7 @@ BuildRequires: gcc >= 6:4.1 BuildRequires: geos-devel >= 3.1.0 BuildRequires: giflib-devel >= 4.0 %{?with_grass:BuildRequires: grass-devel >= 6.4} -BuildRequires: hdf-devel >= 4.0 +BuildRequires: hdf-devel >= 4.2.5 BuildRequires: hdf5-devel BuildRequires: jasper-devel %{?with_java:BuildRequires: jdk} @@ -103,14 +103,17 @@ BuildRequires: libtool BuildRequires: libuuid-devel BuildRequires: libwebp-devel BuildRequires: libxml2-devel >= 2 +#%{?with_mysql:BuildRequires: mysql-devel >= 4} %{?with_mysql:BuildRequires: /usr/bin/mysql_config} BuildRequires: netcdf-devel >= 4.1 BuildRequires: ogdi-devel >= 3.1 -%{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2.0.0-2} +%{?with_openjpeg:BuildRequires: openjpeg2-devel >= 2.1.0} # 8.1.7 for DB support, 10.0.1 for georaster %{?with_oci:BuildRequires: oracle-instantclient-devel >= 10.0.1} #BuildRequires: pcidsk-devel > 0.3 +BuildRequires: pcre-devel BuildRequires: perl-devel +BuildRequires: pkgconfig >= 1:0.21 %{?with_podofo:BuildRequires: podofo-devel} %{?with_poppler:BuildRequires: poppler-devel >= 0.24} # ensure it's compiled with PQescapeStringConn support @@ -120,28 +123,31 @@ BuildRequires: proj-devel >= 4 BuildRequires: python-devel >= 1:2.5 BuildRequires: python-numpy-devel >= 1:1.0.0 BuildRequires: python-setuptools +BuildRequires: qhull-devel >= 2012 %{?with_rasdaman:BuildRequires: rasdaman-devel} BuildRequires: rpm-pythonprov -%{?with_ruby:BuildRequires: rpm-rubyprov} BuildRequires: rpmbuild(macros) >= 1.344 -%{?with_ruby:BuildRequires: ruby-devel} BuildRequires: sed >= 4.0 BuildRequires: sqlite3-devel >= 3.0.0 BuildRequires: swig-perl -BuildRequires: swig-php >= 2.0.12-2 BuildRequires: swig-python >= 1.3 -%{?with_ruby:BuildRequires: swig-ruby} BuildRequires: texlive-dvips BuildRequires: texlive-latex %{?with_odbc:BuildRequires: unixODBC-devel >= 2.2.15} -%{?with_xerces:BuildRequires: xerces-c-devel >= 2.7.0} +%{?with_xerces:BuildRequires: xerces-c-devel >= 3.1.0} BuildRequires: xz-devel BuildRequires: zlib-devel >= 1.1.4 +# for ZSTD compression in TIFF +BuildRequires: zstd-devel Requires: freexl >= 1.0 Requires: geos >= 3.1.0 +Requires: hdf >= 4.2.5 Requires: libgeotiff >= 1.2.1 Requires: libpng >= 2:1.2.8 Requires: libtiff >= 4.0 +%{?with_openjpeg:Requires: openjpeg2 >= 2.1.0} +Requires: qhull >= 2012 +%{?with_xerces:Requires: xerces-c >= 3.1.0} BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %description @@ -165,10 +171,12 @@ Summary: GDAL library header files Summary(pl.UTF-8): Pliki nagłówkowe biblioteki GDAL Group: Development/Libraries Requires: %{name} = %{version}-%{release} +Requires: CharLS-devel %{?with_opencl:Requires: OpenCL-devel >= 1.0} %{?with_armadillo:Requires: armadillo-devel} Requires: cfitsio-devel %{?with_crnlib:Requires: crnlib-devel} +Requires: cryptopp-devel Requires: curl-devel %{?with_epsilon:Requires: epsilon-compressor-devel} %{?with_fyba:Requires: fyba-devel} @@ -176,7 +184,7 @@ Requires: expat-devel >= 1.95.0 Requires: freexl-devel >= 1.0 Requires: geos-devel >= 3.1.0 Requires: giflib-devel >= 4.0 -Requires: hdf-devel >= 4.0 +Requires: hdf-devel >= 4.2.5 Requires: hdf5-devel Requires: jasper-devel Requires: json-c-devel >= 0.11 @@ -196,18 +204,21 @@ Requires: libxml2-devel >= 2 %{?with_mysql:Requires: /usr/bin/mysql_config} Requires: netcdf-devel >= 4 Requires: ogdi-devel >= 3.1 -%{?with_openjpeg:Requires: openjpeg2-devel >= 2.0.0-2} +%{?with_openjpeg:Requires: openjpeg2-devel >= 2.1.0} #Requires: pcidsk-devel > 0.3 +Requires: pcre-devel %{?with_podofo:Requires: podofo-devel} %{?with_poppler:Requires: poppler-devel >= 0.24} Requires: postgresql-devel Requires: proj-devel >= 4 +Requires: qhull-devel >= 2012 %{?with_rasdaman:Requires: rasdaman-devel} Requires: sqlite3-devel >= 3.0.0 %{?with_odbc:Requires: unixODBC-devel} -%{?with_xerces:Requires: xerces-c-devel >= 2.7.0} +%{?with_xerces:Requires: xerces-c-devel >= 3.1.0} Requires: xz-devel Requires: zlib-devel >= 1.1.4 +Requires: zstd-devel %description devel GDAL library header files. @@ -239,19 +250,6 @@ Perl bindings for GDAL - Geo::GDAL, Geo::OGR and Geo::OSR modules. %description -n perl-gdal -l pl.UTF-8 Wiązania Perla do pakietu GDAL - moduły Geo::GDAL, Geo::OGR, Geo::OSR. -%package -n %{php_name}-gdal -Summary: PHP bindings for GDAL library -Summary(pl.UTF-8): Wiązania PHP do biblioteki GDAL -Group: Development/Languages/PHP -Requires: %{name} = %{version}-%{release} -%{?requires_php_extension} - -%description -n %{php_name}-gdal -PHP bindings for GDAL library - -%description -n %{php_name}-gdal -l pl.UTF-8 -Wiązania PHP do biblioteki GDAL. - %package -n python-gdal Summary: GDAL Python module Summary(pl.UTF-8): Moduł Pythona GDAL @@ -265,50 +263,18 @@ GDAL Python module. %description -n python-gdal -l pl.UTF-8 Moduł Pythona GDAL. -%package -n ruby-gdal -Summary: Ruby bindings for GDAL -Summary(pl.UTF-8): Wiązania języka Ruby do pakietu GDAL -Group: Development/Languages -Requires: %{name} = %{version}-%{release} - -%description -n ruby-gdal -Ruby bindings for GDAL - gdal, gdalconst, ogr and osr modules. - -%description -n ruby-gdal -l pl.UTF-8 -Wiązania języka Ruby do pakietu GDAL - moduły gdal, gdalconst, ogr i -osr. - %prep %setup -q %patch0 -p1 -%patch1 -p2 +%patch1 -p1 %patch2 -p1 -%patch3 -p1 %patch9 -p1 -%patch11 -p1 %patch12 -p1 %patch13 -p1 %patch15 -p1 -# need to regenerate (old ones don't support perl 5.10 or php 5.5) -%{__rm} swig/{perl,php}/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp} - -%{__sed} -i \ - -e 's/^CC=gcc/CC=%{__cc}/' \ - -e 's/^CXX=g++/CXX=%{__cxx}/' \ - -e 's/^CFLAGS=-fpic/CFLAGS=%{rpmcflags} -fPIC/' \ - -e 's/^LDFLAGS=-shared/LDFLAGS=%{rpmldflags} -shared/' \ - swig/php/GNUmakefile -# Build with fPIC to allow Ruby bindings -# Xcompiler should normally achieve that -- http://trac.osgeo.org/gdal/ticket/3978 -# http://trac.osgeo.org/gdal/ticket/1994 -sed -i 's|\$(CFLAGS)|$(CFLAGS) -fPIC|g' swig/ruby/RubyMakefile.mk -# Install Ruby bindings to distribution specific directory -sed -i 's|RUBY_EXTENSIONS_DIR :=.*|RUBY_EXTENSIONS_DIR := %{ruby_vendorarchdir}|' swig/ruby/RubyMakefile.mk - -# Install Ruby bindings into the proper place -sed -i -e 's|^$(INSTALL_DIR):|$(DESTDIR)$(INSTALL_DIR):|' swig/ruby/RubyMakefile.mk -sed -i -e 's|^install: $(INSTALL_DIR)|install: $(DESTDIR)$(INSTALL_DIR)|' swig/ruby/RubyMakefile.mk +# need to regenerate (old ones don't support perl 5.10) +%{__rm} swig/perl/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp} # our man path sed -i -e 's#^mandir=.*##g' configure.ac @@ -350,18 +316,16 @@ jvm_arch=x32 %{?with_oci:--with-oci --with-oci-include=/usr/include/oracle/client --with-oci-lib=%{_libdir}} \ %{?with_opencl:--with-opencl} \ --with-perl \ - %{?with_php:--with-php} \ %{?with_podofo:--with-podofo} \ %{?with_poppler:--with-poppler} \ --with-python \ %{?with_rasdaman:--with-rasdaman=%{_libdir}/rasdaman} \ - %{?with_ruby:--with-ruby} \ %{?with_fyba:--with-sosi} \ %{?with_spatialite:--with-spatialite} \ --with-sqlite3 \ --with-webp \ %{?with_xerces:--with-xerces} \ - --with-xerces-inc=/usr/include/xercesc \ + --with-xerces-inc=/usr/include \ --with-xerces-lib="-lxerces-c" \ --without-libgrass # --with-pcidsk=/usr (needs > 0.3) @@ -369,9 +333,6 @@ jvm_arch=x32 # regenerate where needed %{__make} -j1 -C swig/perl generate -%if %{with ruby} -%{__make} -j1 -C swig/ruby generate -%endif %{__make} -j1 \ %{?with_grass:GRASS_INCLUDE="-I/usr/include/grass64"} \ @@ -387,26 +348,11 @@ rm -rf $RPM_BUILD_ROOT %{__make} -j1 install install-man \ DESTDIR=$RPM_BUILD_ROOT +# TODO: remove libgdal.la when gdal.pc gets maintained Requires.private/Libs.private list + rm -rf _html cp -a html _html -%if %{with php} -# missing in make install -install -d $RPM_BUILD_ROOT%{php_extensiondir} -install -p swig/php/php_gdal.so $RPM_BUILD_ROOT%{php_extensiondir}/gdal.so -install -p swig/php/php_gdalconst.so $RPM_BUILD_ROOT%{php_extensiondir}/gdalconst.so -install -p swig/php/php_ogr.so $RPM_BUILD_ROOT%{php_extensiondir}/ogr.so -install -p swig/php/php_osr.so $RPM_BUILD_ROOT%{php_extensiondir}/osr.so -install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d -cat <<'EOF' >$RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/gdal.ini -; Enable gdal extension modules -extension=gdal.so -extension=gdalconst.so -extension=ogr.so -extension=osr.so -EOF -%endif - %py_comp $RPM_BUILD_ROOT%{py_sitedir} %py_ocomp $RPM_BUILD_ROOT%{py_sitedir} %py_postclean @@ -555,22 +501,11 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/Geo::GDAL.3pm* %{perl_vendorarch}/Geo/GNM.pm -%if %{with php} -%files -n %{php_name}-gdal -%defattr(644,root,root,755) -%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gdal.ini -%attr(755,root,root) %{php_extensiondir}/gdal.so -%attr(755,root,root) %{php_extensiondir}/gdalconst.so -%attr(755,root,root) %{php_extensiondir}/ogr.so -%attr(755,root,root) %{php_extensiondir}/osr.so -%endif - %files -n python-gdal %defattr(644,root,root,755) %{py_sitedir}/gdal.py[co] %{py_sitedir}/gdalconst.py[co] %{py_sitedir}/gdalnumeric.py[co] -%{py_sitedir}/gnm.py[co] %{py_sitedir}/ogr.py[co] %{py_sitedir}/osr.py[co] %{py_sitedir}/GDAL-*.egg-info @@ -582,13 +517,3 @@ rm -rf $RPM_BUILD_ROOT %attr(755,root,root) %{py_sitedir}/osgeo/_ogr.so %attr(755,root,root) %{py_sitedir}/osgeo/_osr.so %{py_sitedir}/osgeo/*.py[co] - -%if %{with ruby} -%files -n ruby-gdal -%defattr(644,root,root,755) -%dir %{ruby_vendorarchdir}/gdal -%attr(755,root,root) %{ruby_vendorarchdir}/gdal/gdal.so -%attr(755,root,root) %{ruby_vendorarchdir}/gdal/gdalconst.so -%attr(755,root,root) %{ruby_vendorarchdir}/gdal/ogr.so -%attr(755,root,root) %{ruby_vendorarchdir}/gdal/osr.so -%endif -- 2.43.0