- updated to 1.11.0 auto/th/gdal-1.11.0-1
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 13 May 2014 14:13:28 +0000 (16:13 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Tue, 13 May 2014 14:13:28 +0000 (16:13 +0200)
- updated format-security patch
- added grass patch (allows to use default prefix for grass 5.7+)
- added sse patch (use -msse only for SSE variants, just like AVX); allows to use SSE-capable binaries on non-SSE CPUs
- added link patch (link ruby binding with just built libgdal instead of system one)
- force PHP swig files rebuild (fixes build with php 5.5)

gdal-bug-5284.patch [deleted file]
gdal-format-security.patch
gdal-grass.patch [new file with mode: 0644]
gdal-link.patch [new file with mode: 0644]
gdal-sse.patch [new file with mode: 0644]
gdal.spec

diff --git a/gdal-bug-5284.patch b/gdal-bug-5284.patch
deleted file mode 100644 (file)
index c01b55c..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-Index: /trunk/gdal/configure\r
-===================================================================\r
---- /trunk/gdal/configure      (revision 26534)\r
-+++ /trunk/gdal/configure      (revision 26582)\r
-@@ -723,4 +723,5 @@\r
- II_SYSTEM\r
- HAVE_INGRES\r
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\r
- MYSQL_LIB\r
- MYSQL_INC\r
-@@ -23308,4 +23309,32 @@\r
-       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5\r
- $as_echo "yes" >&6; }\r
-+\r
-+      # Check if mysql headers declare load_defaults\r
-+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking load_defaults() in MySQL" >&5\r
-+$as_echo_n "checking load_defaults() in MySQL... " >&6; }\r
-+      rm -f testmysql.*\r
-+      echo '#include "my_global.h"' > testmysql.cpp\r
-+      echo '#include "my_sys.h"' >> testmysql.cpp\r
-+      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
-+      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5\r
-+$as_echo "yes, found in my_sys.h" >&6; }\r
-+      else\r
-+        echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\r
-+        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
-+        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5\r
-+$as_echo "yes, found in library but not in header" >&6; }\r
-+            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes\r
-+        else\r
-+            HAVE_MYSQL=no\r
-+            MYSQL_LIB=\r
-+            MYSQL_INC=\r
-+            as_fn_error $? "Cannot find load_defaults()" "$LINENO" 5\r
-+        fi\r
-+      fi\r
-+      rm -f testmysql.*\r
-+      rm -f testmysql\r
-+\r
-       ;;\r
-   esac\r
-@@ -23317,4 +23346,6 @@\r
\r
- MYSQL_LIB=$MYSQL_LIB\r
-+\r
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\r
\r
\r
-Index: /trunk/gdal/configure.in\r
-===================================================================\r
---- /trunk/gdal/configure.in   (revision 26534)\r
-+++ /trunk/gdal/configure.in   (revision 26582)\r
-@@ -2462,4 +2462,29 @@\r
-       MYSQL_INC="`$MYSQL_CONFIG --include`"\r
-       AC_MSG_RESULT([yes])\r
-+\r
-+      # Check if mysql headers declare load_defaults\r
-+      AC_MSG_CHECKING([load_defaults() in MySQL])\r
-+      rm -f testmysql.*\r
-+      echo '#include "my_global.h"' > testmysql.cpp\r
-+      echo '#include "my_sys.h"' >> testmysql.cpp\r
-+      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
-+      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+        AC_MSG_RESULT([yes, found in my_sys.h])\r
-+      else\r
-+        echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\r
-+        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
-+        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+            AC_MSG_RESULT([yes, found in library but not in header])\r
-+            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes\r
-+        else\r
-+            HAVE_MYSQL=no\r
-+            MYSQL_LIB=\r
-+            MYSQL_INC=\r
-+            AC_MSG_ERROR([Cannot find load_defaults()])\r
-+        fi\r
-+      fi\r
-+      rm -f testmysql.*\r
-+      rm -f testmysql\r
-+\r
-       ;;\r
-   esac\r
-@@ -2469,4 +2494,5 @@\r
- AC_SUBST(MYSQL_INC,$MYSQL_INC)\r
- AC_SUBST(MYSQL_LIB,$MYSQL_LIB)\r
-+AC_SUBST(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION,$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION)\r
\r
- dnl ---------------------------------------------------------------------------\r
-Index: /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile\r
-===================================================================\r
---- /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile      (revision 15888)\r
-+++ /trunk/gdal/ogr/ogrsf_frmts/mysql/GNUmakefile      (revision 26582)\r
-@@ -8,4 +8,9 @@\r
- CPPFLAGS      :=      -I.. -I../.. $(GDAL_INCLUDE) $(MYSQL_INC) $(CPPFLAGS)\r
\r
-+ifeq ($(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION),yes)\r
-+CPPFLAGS +=   -DMYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\r
-+endif\r
-+\r
-+\r
- default:      $(O_OBJ:.o=.$(OBJ_EXT))\r
\r
-Index: /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp\r
-===================================================================\r
---- /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp   (revision 26506)\r
-+++ /trunk/gdal/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp   (revision 26582)\r
-@@ -37,4 +37,14 @@\r
- #include "cpl_string.h"\r
\r
-+/* Recent versions of mysql no longer declare load_defaults() in my_sys.h */\r
-+/* but they still have it in the lib. Very fragile... */\r
-+#ifdef MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION\r
-+extern "C" {\r
-+int load_defaults(const char *conf_file, const char **groups,\r
-+                  int *argc, char ***argv);\r
-+void free_defaults(char **argv);\r
-+}\r
-+#endif\r
-+\r
- CPL_CVSID("$Id$");\r
- /************************************************************************/\r
-Index: /trunk/gdal/GDALmake.opt.in\r
-===================================================================\r
---- /trunk/gdal/GDALmake.opt.in        (revision 26296)\r
-+++ /trunk/gdal/GDALmake.opt.in        (revision 26582)\r
-@@ -127,4 +127,5 @@\r
- MYSQL_LIB  =  @MYSQL_LIB@\r
- MYSQL_INC  =  @MYSQL_INC@\r
-+MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION  =    @MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION@\r
- LIBS     +=   $(MYSQL_LIB)\r
\r
-Index: /trunk/gdal/configure\r
-===================================================================\r
---- /trunk/gdal/configure      (revision 26582)\r
-+++ /trunk/gdal/configure      (revision 26583)\r
-@@ -23317,5 +23317,5 @@\r
-       echo '#include "my_sys.h"' >> testmysql.cpp\r
-       echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
--      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then\r
-         { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5\r
- $as_echo "yes, found in my_sys.h" >&6; }\r
-@@ -23323,5 +23323,5 @@\r
-         echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\r
-         echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
--        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then\r
-             { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5\r
- $as_echo "yes, found in library but not in header" >&6; }\r
-Index: /trunk/gdal/configure.in\r
-===================================================================\r
---- /trunk/gdal/configure.in   (revision 26582)\r
-+++ /trunk/gdal/configure.in   (revision 26583)\r
-@@ -2469,10 +2469,10 @@\r
-       echo '#include "my_sys.h"' >> testmysql.cpp\r
-       echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
--      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then\r
-         AC_MSG_RESULT([yes, found in my_sys.h])\r
-       else\r
-         echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp\r
-         echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp\r
--        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} ${MYSQL_LIB} testmysql.cpp -o testmysql 2>&1`" ; then\r
-+        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then\r
-             AC_MSG_RESULT([yes, found in library but not in header])\r
-             MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes\r
index 2783f10..063e571 100644 (file)
@@ -9,3 +9,40 @@
    }
  }
  
+--- gdal-1.11.0/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp.orig  2014-04-16 22:04:02.000000000 +0200
++++ gdal-1.11.0/ogr/ogrsf_frmts/sxf/ogrsxfdatasource.cpp       2014-05-10 17:33:52.404601057 +0200
+@@ -459,7 +459,7 @@
+     if (nEPSG == 0)
+     {
+         CPLError( CE_Warning, CPLE_NotSupported,
+-                  CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld) not supported", iVCS) );
++                  "SXF. Vertical coordinate system (SXF index %ld) not supported", iVCS );
+         return;
+     }
+@@ -468,14 +468,14 @@
+     if (eImportFromEPSGErr != OGRERR_NONE)
+     {
+         CPLError( CE_Warning, CPLE_None,
+-                  CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld, EPSG %d) import from EPSG error", iVCS, nEPSG) );
++                  "SXF. Vertical coordinate system (SXF index %ld, EPSG %d) import from EPSG error", iVCS, nEPSG );
+         return;
+     }
+     if (sr->IsVertical() != 1)
+     {
+         CPLError( CE_Warning, CPLE_None,
+-                  CPLString().Printf("SXF. Coordinate system (SXF index %ld, EPSG %d) is not Vertical", iVCS, nEPSG) );
++                  "SXF. Coordinate system (SXF index %ld, EPSG %d) is not Vertical", iVCS, nEPSG );
+         return;
+     }
+@@ -484,7 +484,7 @@
+     if (eSetVertCSErr != OGRERR_NONE)
+     {
+         CPLError( CE_Warning, CPLE_None,
+-                  CPLString().Printf("SXF. Vertical coordinate system (SXF index %ld, EPSG %d) set error", iVCS, nEPSG) );
++                  "SXF. Vertical coordinate system (SXF index %ld, EPSG %d) set error", iVCS, nEPSG );
+         return;
+     }
+ }
diff --git a/gdal-grass.patch b/gdal-grass.patch
new file mode 100644 (file)
index 0000000..a27c814
--- /dev/null
@@ -0,0 +1,43 @@
+--- gdal-1.11.0/configure.in.orig      2014-05-11 06:25:06.870303219 +0200
++++ gdal-1.11.0/configure.in   2014-05-11 09:17:12.103421341 +0200
+@@ -718,25 +718,33 @@
+ # Check for GRASS 5.7.0 or later library use.
+ # TODO: separate libs for rasters and vectors
+-if test "$with_grass" != "yes" -a "$with_grass" != "no" ; then
++if test "$with_grass" != "no" ; then
+-  AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
++  if test "$with_grass" = "yes" ; then
++    GRASS_I=
++    GRASS_L=
++    GRASS_GISBASE="$prefix"
++  else
++    GRASS_I="-I$with_grass/include"
++    GRASS_L="-L$with_grass/lib"
++    GRASS_GISBASE="$with_grass"
++  fi
++  AC_CHECK_LIB(grass_gis,G_is_initialized,GRASS_SETTING=grass70+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime)
+   if test "$GRASS_SETTING" = "no" ; then
+-    AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,-L$with_grass/lib -lgrass_datetime)
++    AC_CHECK_LIB(grass_gis,G_asprintf,GRASS_SETTING=grass57+,GRASS_SETTING=no,$GRASS_L -lgrass_datetime)
+   fi
+    
+   if test "$GRASS_SETTING" != "no" ; then   
+     if test "$GRASS_SETTING" = "grass70+" ; then   
+       G_RASTLIBS="-lgrass_raster -lgrass_imagery"
+       G_VECTLIBS="-lgrass_vector -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+-      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
++      LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+     else
+       G_RASTLIBS="-lgrass_I"
+       G_VECTLIBS="-lgrass_vect -lgrass_dig2 -lgrass_dgl -lgrass_rtree -lgrass_linkm -lgrass_dbmiclient -lgrass_dbmibase"
+-      LIBS="-L$with_grass/lib $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
++      LIBS="$GRASS_L $G_VECTLIBS $G_RASTLIBS -lgrass_gproj -lgrass_vask -lgrass_gmath -lgrass_gis -lgrass_datetime $LIBS"
+     fi
+-    GRASS_INCLUDE="-I$with_grass/include"
+-    GRASS_GISBASE="$with_grass"
++    GRASS_INCLUDE="$GRASS_I"
+     HAVE_GRASS=yes
+   else
+     AC_MSG_ERROR([--with-grass=$with_grass requested, but libraries not found!])
diff --git a/gdal-link.patch b/gdal-link.patch
new file mode 100644 (file)
index 0000000..9a9f7e6
--- /dev/null
@@ -0,0 +1,29 @@
+--- gdal-1.11.0/swig/ruby/RubyMakefile.mk.orig 2014-05-11 22:02:00.429131553 +0200
++++ gdal-1.11.0/swig/ruby/RubyMakefile.mk      2014-05-12 19:26:05.824192351 +0200
+@@ -64,10 +64,10 @@
+       for i in $(RUBY_MODULES) ; do $(INSTALL) $$i $(DESTDIR)$(INSTALL_DIR) ; done
+ $(RUBY_MODULES_MAC): %.bundle: %_wrap.o
+-      $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
++      $(LD) $(LDFLAGS) $(GDAL_SLIB_LINK) $(LIBS) $(RUBY_LIB) $< -o $@
+ $(RUBY_MODULES_LIN): %.so: %_wrap.o
+-      $(LD) $(LDFLAGS) $(LIBS) $(GDAL_SLIB_LINK) $(RUBY_LIB) $< -o $@
++      $(LD) $(LDFLAGS) $(GDAL_SLIB_LINK) $(LIBS) $(RUBY_LIB) $< -o $@
+ %.o: %.cpp
+       $(CXX) $(CFLAGS) -fPIC $(GDAL_INCLUDE) $(RUBY_INCLUDE)  -c $<
+--- gdal-1.11.0/GDALmake.opt.in.orig   2014-04-16 22:04:49.000000000 +0200
++++ gdal-1.11.0/GDALmake.opt.in        2014-05-12 19:25:43.287526155 +0200
+@@ -100,7 +100,11 @@
+ GDAL_LIB      =       $(GDAL_ROOT)/libgdal.a
+ GDAL_SLIB     =       $(GDAL_ROOT)/libgdal.$(SO_EXT)
++ifeq ($(HAVE_LIBTOOL), yes)
++GDAL_SLIB_LINK        =       $(GDAL_ROOT)/libgdal.la
++else
+ GDAL_SLIB_LINK        =       -L$(GDAL_ROOT) -lgdal
++endif
+ # Mac OS X Framework definition
+ MACOSX_FRAMEWORK = @MACOSX_FRAMEWORK@
diff --git a/gdal-sse.patch b/gdal-sse.patch
new file mode 100644 (file)
index 0000000..692affa
--- /dev/null
@@ -0,0 +1,561 @@
+--- gdal-1.11.0/alg/gdalgrid_priv.h.orig       2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/gdalgrid_priv.h    2014-05-11 20:50:49.579220569 +0200
+@@ -51,6 +51,21 @@
+     const float *pafZ;
+ } GDALGridExtraParameters;
++#ifdef HAVE_SSE_AT_COMPILE_TIME
++int CPLHaveRuntimeSSE();
++
++CPLErr
++GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
++                                        const void *poOptions,
++                                        GUInt32 nPoints,
++                                        const double *unused_padfX,
++                                        const double *unused_padfY,
++                                        const double *unused_padfZ,
++                                        double dfXPoint, double dfYPoint,
++                                        double *pdfValue,
++                                        void* hExtraParamsIn );
++#endif
++
+ #ifdef HAVE_AVX_AT_COMPILE_TIME
+ int CPLHaveRuntimeAVX();
+--- gdal-1.11.0/alg/gdalgridsse.cpp.orig       1970-01-01 01:00:00.000000000 +0100
++++ gdal-1.11.0/alg/gdalgridsse.cpp    2014-05-11 21:54:46.609140595 +0200
+@@ -0,0 +1,210 @@
++#include "gdalgrid.h"
++#include "gdalgrid_priv.h"
++
++#ifdef HAVE_SSE_AT_COMPILE_TIME
++#include <xmmintrin.h>
++
++/************************************************************************/
++/*                          CPLHaveRuntimeSSE()                         */
++/************************************************************************/
++
++#define CPUID_SSE_EDX_BIT     25
++
++#if (defined(_M_X64) || defined(__x86_64))
++
++int CPLHaveRuntimeSSE()
++{
++    return TRUE;
++}
++
++#elif defined(__GNUC__) && defined(__i386__)
++
++int CPLHaveRuntimeSSE()
++{
++    int cpuinfo[4] = {0,0,0,0};
++    GCC_CPUID(1, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
++    return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
++}
++
++#elif defined(_MSC_VER) && defined(_M_IX86)
++
++#if _MSC_VER <= 1310
++static void inline __cpuid(int cpuinfo[4], int level)
++{
++    __asm 
++    {
++        push   ebx
++        push   esi
++
++        mov    esi,cpuinfo
++        mov    eax,level  
++        cpuid  
++        mov    dword ptr [esi], eax
++        mov    dword ptr [esi+4],ebx  
++        mov    dword ptr [esi+8],ecx  
++        mov    dword ptr [esi+0Ch],edx 
++
++        pop    esi
++        pop    ebx
++    }
++}
++#else
++#include <intrin.h>
++#endif
++
++int CPLHaveRuntimeSSE()
++{
++    int cpuinfo[4] = {0,0,0,0};
++    __cpuid(cpuinfo, 1);
++    return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
++}
++
++#else
++
++int CPLHaveRuntimeSSE()
++{
++    return FALSE;
++}
++#endif
++
++/************************************************************************/
++/*         GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE()     */
++/************************************************************************/
++
++CPLErr
++GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
++                                        const void *poOptions,
++                                        GUInt32 nPoints,
++                                        const double *unused_padfX,
++                                        const double *unused_padfY,
++                                        const double *unused_padfZ,
++                                        double dfXPoint, double dfYPoint,
++                                        double *pdfValue,
++                                        void* hExtraParamsIn )
++{
++    size_t i = 0;
++    GDALGridExtraParameters* psExtraParams = (GDALGridExtraParameters*) hExtraParamsIn;
++    const float* pafX = psExtraParams->pafX;
++    const float* pafY = psExtraParams->pafY;
++    const float* pafZ = psExtraParams->pafZ;
++
++    const float fEpsilon = 0.0000000000001f;
++    const float fXPoint = (float)dfXPoint;
++    const float fYPoint = (float)dfYPoint;
++    const __m128 xmm_small = _mm_load1_ps((float*)&fEpsilon);
++    const __m128 xmm_x = _mm_load1_ps((float*)&fXPoint);
++    const __m128 xmm_y = _mm_load1_ps((float*)&fYPoint);
++    __m128 xmm_nominator = _mm_setzero_ps();
++    __m128 xmm_denominator = _mm_setzero_ps();
++    int mask = 0;
++
++#if defined(__x86_64) || defined(_M_X64)
++    /* This would also work in 32bit mode, but there are only 8 XMM registers */
++    /* whereas we have 16 for 64bit */
++#define LOOP_SIZE   8
++    size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
++    for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
++    {
++        __m128 xmm_rx = _mm_sub_ps(_mm_load_ps(pafX + i), xmm_x);            /* rx = pafX[i] - fXPoint */
++        __m128 xmm_rx_4 = _mm_sub_ps(_mm_load_ps(pafX + i + 4), xmm_x);
++        __m128 xmm_ry = _mm_sub_ps(_mm_load_ps(pafY + i), xmm_y);            /* ry = pafY[i] - fYPoint */
++        __m128 xmm_ry_4 = _mm_sub_ps(_mm_load_ps(pafY + i + 4), xmm_y);
++        __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx),               /* r2 = rx * rx + ry * ry */
++                                   _mm_mul_ps(xmm_ry, xmm_ry));
++        __m128 xmm_r2_4 = _mm_add_ps(_mm_mul_ps(xmm_rx_4, xmm_rx_4),
++                                     _mm_mul_ps(xmm_ry_4, xmm_ry_4));
++        __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2);                               /* invr2 = 1.0f / r2 */
++        __m128 xmm_invr2_4 = _mm_rcp_ps(xmm_r2_4);
++        xmm_nominator = _mm_add_ps(xmm_nominator,                            /* nominator += invr2 * pafZ[i] */
++                            _mm_mul_ps(xmm_invr2, _mm_load_ps(pafZ + i)));
++        xmm_nominator = _mm_add_ps(xmm_nominator,
++                            _mm_mul_ps(xmm_invr2_4, _mm_load_ps(pafZ + i + 4)));
++        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2);           /* denominator += invr2 */
++        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2_4);
++        mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)) |           /* if( r2 < fEpsilon) */
++              (_mm_movemask_ps(_mm_cmplt_ps(xmm_r2_4, xmm_small)) << 4);
++        if( mask )
++            break;
++    }
++#else
++#define LOOP_SIZE   4
++    size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
++    for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
++    {
++        __m128 xmm_rx = _mm_sub_ps(_mm_load_ps((float*)pafX + i), xmm_x);           /* rx = pafX[i] - fXPoint */
++        __m128 xmm_ry = _mm_sub_ps(_mm_load_ps((float*)pafY + i), xmm_y);           /* ry = pafY[i] - fYPoint */
++        __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx),              /* r2 = rx * rx + ry * ry */
++                                   _mm_mul_ps(xmm_ry, xmm_ry));
++        __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2);                              /* invr2 = 1.0f / r2 */
++        xmm_nominator = _mm_add_ps(xmm_nominator,                           /* nominator += invr2 * pafZ[i] */
++                            _mm_mul_ps(xmm_invr2, _mm_load_ps((float*)pafZ + i)));
++        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2);           /* denominator += invr2 */
++        mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small));            /* if( r2 < fEpsilon) */
++        if( mask )
++            break;
++    }
++#endif
++
++    /* Find which i triggered r2 < fEpsilon */
++    if( mask )
++    {
++        for(int j = 0; j < LOOP_SIZE; j++ )
++        {
++            if( mask & (1 << j) )
++            {
++                (*pdfValue) = (pafZ)[i + j];
++                return CE_None;
++            }
++        }
++    }
++
++    /* Get back nominator and denominator values for XMM registers */
++    float afNominator[4], afDenominator[4];
++    _mm_storeu_ps(afNominator, xmm_nominator);
++    _mm_storeu_ps(afDenominator, xmm_denominator);
++
++    float fNominator = afNominator[0] + afNominator[1] +
++                       afNominator[2] + afNominator[3];
++    float fDenominator = afDenominator[0] + afDenominator[1] +
++                         afDenominator[2] + afDenominator[3];
++
++    /* Do the few remaining loop iterations */
++    for ( ; i < nPoints; i++ )
++    {
++        const float fRX = pafX[i] - fXPoint;
++        const float fRY = pafY[i] - fYPoint;
++        const float fR2 =
++            fRX * fRX + fRY * fRY;
++
++        // If the test point is close to the grid node, use the point
++        // value directly as a node value to avoid singularity.
++        if ( fR2 < 0.0000000000001 )
++        {
++            break;
++        }
++        else
++        {
++            const float fInvR2 = 1.0f / fR2;
++            fNominator += fInvR2 * pafZ[i];
++            fDenominator += fInvR2;
++        }
++    }
++
++    if( i != nPoints )
++    {
++        (*pdfValue) = pafZ[i];
++    }
++    else
++    if ( fDenominator == 0.0 )
++    {
++        (*pdfValue) =
++            ((GDALGridInverseDistanceToAPowerOptions*)poOptions)->dfNoDataValue;
++    }
++    else
++        (*pdfValue) = fNominator / fDenominator;
++
++    return CE_None;
++}
++
++
++#endif
+--- gdal-1.11.0/alg/gdalgrid.cpp.orig  2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/gdalgrid.cpp       2014-05-11 21:27:49.735840961 +0200
+@@ -36,10 +36,6 @@
+ #include "cpl_multiproc.h"
+ #include "gdalgrid_priv.h"
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-#include <xmmintrin.h>
+-#endif
+-
+ CPL_CVSID("$Id: gdalgrid.cpp 27110 2014-03-28 21:29:20Z rouault $");
+ #define TO_RADIANS (3.14159265358979323846 / 180.0)
+@@ -53,74 +49,6 @@
+ #endif /* DBL_MAX */
+ /************************************************************************/
+-/*                          CPLHaveRuntimeSSE()                         */
+-/************************************************************************/
+-
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-
+-#define CPUID_SSE_EDX_BIT     25
+-
+-#if (defined(_M_X64) || defined(__x86_64))
+-
+-static int CPLHaveRuntimeSSE()
+-{
+-    return TRUE;
+-}
+-
+-#elif defined(__GNUC__) && defined(__i386__)
+-
+-static int CPLHaveRuntimeSSE()
+-{
+-    int cpuinfo[4] = {0,0,0,0};
+-    GCC_CPUID(1, cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
+-    return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
+-}
+-
+-#elif defined(_MSC_VER) && defined(_M_IX86)
+-
+-#if _MSC_VER <= 1310
+-static void inline __cpuid(int cpuinfo[4], int level)
+-{
+-    __asm 
+-    {
+-        push   ebx
+-        push   esi
+-
+-        mov    esi,cpuinfo
+-        mov    eax,level  
+-        cpuid  
+-        mov    dword ptr [esi], eax
+-        mov    dword ptr [esi+4],ebx  
+-        mov    dword ptr [esi+8],ecx  
+-        mov    dword ptr [esi+0Ch],edx 
+-
+-        pop    esi
+-        pop    ebx
+-    }
+-}
+-#else
+-#include <intrin.h>
+-#endif
+-
+-static int CPLHaveRuntimeSSE()
+-{
+-    int cpuinfo[4] = {0,0,0,0};
+-    __cpuid(cpuinfo, 1);
+-    return (cpuinfo[3] & (1 << CPUID_SSE_EDX_BIT)) != 0;
+-}
+-
+-#else
+-
+-static int CPLHaveRuntimeSSE()
+-{
+-    return FALSE;
+-}
+-
+-#endif
+-
+-#endif // HAVE_SSE_AT_COMPILE_TIME
+-
+-/************************************************************************/
+ /*                        GDALGridGetPointBounds()                      */
+ /************************************************************************/
+@@ -394,148 +322,6 @@
+ }
+ /************************************************************************/
+-/*         GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE()     */
+-/************************************************************************/
+-
+-#ifdef HAVE_SSE_AT_COMPILE_TIME
+-
+-static CPLErr
+-GDALGridInverseDistanceToAPower2NoSmoothingNoSearchSSE(
+-                                        const void *poOptions,
+-                                        GUInt32 nPoints,
+-                                        const double *unused_padfX,
+-                                        const double *unused_padfY,
+-                                        const double *unused_padfZ,
+-                                        double dfXPoint, double dfYPoint,
+-                                        double *pdfValue,
+-                                        void* hExtraParamsIn )
+-{
+-    size_t i = 0;
+-    GDALGridExtraParameters* psExtraParams = (GDALGridExtraParameters*) hExtraParamsIn;
+-    const float* pafX = psExtraParams->pafX;
+-    const float* pafY = psExtraParams->pafY;
+-    const float* pafZ = psExtraParams->pafZ;
+-
+-    const float fEpsilon = 0.0000000000001f;
+-    const float fXPoint = (float)dfXPoint;
+-    const float fYPoint = (float)dfYPoint;
+-    const __m128 xmm_small = _mm_load1_ps((float*)&fEpsilon);
+-    const __m128 xmm_x = _mm_load1_ps((float*)&fXPoint);
+-    const __m128 xmm_y = _mm_load1_ps((float*)&fYPoint);
+-    __m128 xmm_nominator = _mm_setzero_ps();
+-    __m128 xmm_denominator = _mm_setzero_ps();
+-    int mask = 0;
+-
+-#if defined(__x86_64) || defined(_M_X64)
+-    /* This would also work in 32bit mode, but there are only 8 XMM registers */
+-    /* whereas we have 16 for 64bit */
+-#define LOOP_SIZE   8
+-    size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
+-    for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
+-    {
+-        __m128 xmm_rx = _mm_sub_ps(_mm_load_ps(pafX + i), xmm_x);            /* rx = pafX[i] - fXPoint */
+-        __m128 xmm_rx_4 = _mm_sub_ps(_mm_load_ps(pafX + i + 4), xmm_x);
+-        __m128 xmm_ry = _mm_sub_ps(_mm_load_ps(pafY + i), xmm_y);            /* ry = pafY[i] - fYPoint */
+-        __m128 xmm_ry_4 = _mm_sub_ps(_mm_load_ps(pafY + i + 4), xmm_y);
+-        __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx),               /* r2 = rx * rx + ry * ry */
+-                                   _mm_mul_ps(xmm_ry, xmm_ry));
+-        __m128 xmm_r2_4 = _mm_add_ps(_mm_mul_ps(xmm_rx_4, xmm_rx_4),
+-                                     _mm_mul_ps(xmm_ry_4, xmm_ry_4));
+-        __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2);                               /* invr2 = 1.0f / r2 */
+-        __m128 xmm_invr2_4 = _mm_rcp_ps(xmm_r2_4);
+-        xmm_nominator = _mm_add_ps(xmm_nominator,                            /* nominator += invr2 * pafZ[i] */
+-                            _mm_mul_ps(xmm_invr2, _mm_load_ps(pafZ + i)));
+-        xmm_nominator = _mm_add_ps(xmm_nominator,
+-                            _mm_mul_ps(xmm_invr2_4, _mm_load_ps(pafZ + i + 4)));
+-        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2);           /* denominator += invr2 */
+-        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2_4);
+-        mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small)) |           /* if( r2 < fEpsilon) */
+-              (_mm_movemask_ps(_mm_cmplt_ps(xmm_r2_4, xmm_small)) << 4);
+-        if( mask )
+-            break;
+-    }
+-#else
+-#define LOOP_SIZE   4
+-    size_t nPointsRound = (nPoints / LOOP_SIZE) * LOOP_SIZE;
+-    for ( i = 0; i < nPointsRound; i += LOOP_SIZE )
+-    {
+-        __m128 xmm_rx = _mm_sub_ps(_mm_load_ps((float*)pafX + i), xmm_x);           /* rx = pafX[i] - fXPoint */
+-        __m128 xmm_ry = _mm_sub_ps(_mm_load_ps((float*)pafY + i), xmm_y);           /* ry = pafY[i] - fYPoint */
+-        __m128 xmm_r2 = _mm_add_ps(_mm_mul_ps(xmm_rx, xmm_rx),              /* r2 = rx * rx + ry * ry */
+-                                   _mm_mul_ps(xmm_ry, xmm_ry));
+-        __m128 xmm_invr2 = _mm_rcp_ps(xmm_r2);                              /* invr2 = 1.0f / r2 */
+-        xmm_nominator = _mm_add_ps(xmm_nominator,                           /* nominator += invr2 * pafZ[i] */
+-                            _mm_mul_ps(xmm_invr2, _mm_load_ps((float*)pafZ + i)));
+-        xmm_denominator = _mm_add_ps(xmm_denominator, xmm_invr2);           /* denominator += invr2 */
+-        mask = _mm_movemask_ps(_mm_cmplt_ps(xmm_r2, xmm_small));            /* if( r2 < fEpsilon) */
+-        if( mask )
+-            break;
+-    }
+-#endif
+-
+-    /* Find which i triggered r2 < fEpsilon */
+-    if( mask )
+-    {
+-        for(int j = 0; j < LOOP_SIZE; j++ )
+-        {
+-            if( mask & (1 << j) )
+-            {
+-                (*pdfValue) = (pafZ)[i + j];
+-                return CE_None;
+-            }
+-        }
+-    }
+-
+-    /* Get back nominator and denominator values for XMM registers */
+-    float afNominator[4], afDenominator[4];
+-    _mm_storeu_ps(afNominator, xmm_nominator);
+-    _mm_storeu_ps(afDenominator, xmm_denominator);
+-
+-    float fNominator = afNominator[0] + afNominator[1] +
+-                       afNominator[2] + afNominator[3];
+-    float fDenominator = afDenominator[0] + afDenominator[1] +
+-                         afDenominator[2] + afDenominator[3];
+-
+-    /* Do the few remaining loop iterations */
+-    for ( ; i < nPoints; i++ )
+-    {
+-        const float fRX = pafX[i] - fXPoint;
+-        const float fRY = pafY[i] - fYPoint;
+-        const float fR2 =
+-            fRX * fRX + fRY * fRY;
+-
+-        // If the test point is close to the grid node, use the point
+-        // value directly as a node value to avoid singularity.
+-        if ( fR2 < 0.0000000000001 )
+-        {
+-            break;
+-        }
+-        else
+-        {
+-            const float fInvR2 = 1.0f / fR2;
+-            fNominator += fInvR2 * pafZ[i];
+-            fDenominator += fInvR2;
+-        }
+-    }
+-
+-    if( i != nPoints )
+-    {
+-        (*pdfValue) = pafZ[i];
+-    }
+-    else
+-    if ( fDenominator == 0.0 )
+-    {
+-        (*pdfValue) =
+-            ((GDALGridInverseDistanceToAPowerOptions*)poOptions)->dfNoDataValue;
+-    }
+-    else
+-        (*pdfValue) = fNominator / fDenominator;
+-
+-    return CE_None;
+-}
+-#endif // HAVE_SSE_AT_COMPILE_TIME
+-
+-/************************************************************************/
+ /*                        GDALGridMovingAverage()                       */
+ /************************************************************************/
+@@ -1766,7 +1552,9 @@
+                             pabyX = pabyY = pabyZ = NULL;
+                         }
+                     }
++#  ifdef HAVE_SSE_AT_COMPILE_TIME
+                     else
++#  endif
+ #endif
+ #ifdef HAVE_SSE_AT_COMPILE_TIME
+--- gdal-1.11.0/alg/GNUmakefile.orig   2014-04-16 22:04:48.000000000 +0200
++++ gdal-1.11.0/alg/GNUmakefile        2014-05-11 21:56:55.699137906 +0200
+@@ -16,6 +16,10 @@
+ CPPFLAGS      :=      -DHAVE_AVX_AT_COMPILE_TIME $(CPPFLAGS)
+ endif
++ifeq ($(HAVE_SSE_AT_COMPILE_TIME),yes)
++CPPFLAGS      :=      -DHAVE_SSE_AT_COMPILE_TIME $(CPPFLAGS)
++endif
++
+ ifeq ($(HAVE_GEOS),yes)
+ CPPFLAGS      :=      -DHAVE_GEOS=1 $(GEOS_CFLAGS) $(CPPFLAGS)
+ endif
+@@ -26,11 +30,14 @@
+ CPPFLAGS      :=      $(GDAL_INCLUDE) $(CPPFLAGS) $(OPENCL_FLAGS)
+-default:      $(OBJ:.o=.$(OBJ_EXT)) gdalgridavx.$(OBJ_EXT)
++default:      $(OBJ:.o=.$(OBJ_EXT)) gdalgridavx.$(OBJ_EXT) gdalgridsse.$(OBJ_EXT)
+ gdalgridavx.$(OBJ_EXT):   gdalgridavx.cpp
+       $(CXX) $(CXXFLAGS) $(AVXFLAGS) $(CPPFLAGS) -c -o $@ $<
++gdalgridsse.$(OBJ_EXT):   gdalgridsse.cpp
++      $(CXX) $(CXXFLAGS) $(SSEFLAGS) $(CPPFLAGS) -c -o $@ $<
++
+ clean:
+       $(RM) *.o $(O_OBJ)
+--- gdal-1.11.0/configure.in.orig      2014-05-11 20:11:46.272602746 +0200
++++ gdal-1.11.0/configure.in   2014-05-11 22:00:20.125800312 +0200
+@@ -240,12 +240,12 @@
+     echo '#endif' >> detectsse.cpp
+     if test -z "`${CXX} ${CXXFLAGS} -o detectsse detectsse.cpp 2>&1`" ; then
+         AC_MSG_RESULT([yes])
+-        SSEFLAGS="-DHAVE_SSE_AT_COMPILE_TIME"
++        SSEFLAGS=""
+         HAVE_SSE_AT_COMPILE_TIME=yes
+     else
+         if test -z "`${CXX} ${CXXFLAGS} -msse -o detectsse detectsse.cpp 2>&1`" ; then
+             AC_MSG_RESULT([yes])
+-            SSEFLAGS="-msse -DHAVE_SSE_AT_COMPILE_TIME"
++            SSEFLAGS="-msse"
+             HAVE_SSE_AT_COMPILE_TIME=yes
+         else
+             AC_MSG_RESULT([no])
+@@ -279,16 +279,14 @@
+        esac
+     fi
+-    if test "$HAVE_SSE_AT_COMPILE_TIME" = "yes"; then
+-      CFLAGS="$CFLAGS $SSEFLAGS"
+-      CXXFLAGS="$CXXFLAGS $SSEFLAGS"
+-    fi
+-
+     rm -f detectsse*
+ else
+     AC_MSG_RESULT([no])
+ fi
++AC_SUBST(SSEFLAGS,$SSEFLAGS)
++AC_SUBST(HAVE_SSE_AT_COMPILE_TIME,$HAVE_SSE_AT_COMPILE_TIME)
++
+ dnl ---------------------------------------------------------------------------
+ dnl Check AVX availability
+ dnl ---------------------------------------------------------------------------
+--- gdal-1.11.0/GDALmake.opt.in.orig   2014-05-12 19:27:07.164191074 +0200
++++ gdal-1.11.0/GDALmake.opt.in        2014-05-12 20:39:04.850767745 +0200
+@@ -37,6 +37,8 @@
+               $(PCIDSK_LIB) $(RASDAMAN_LIB) $(CHARLS_LIB) $(SOSI_LIB) \
+               $(OPENCL_LIB) $(JVM_LIB) $(LIBICONV) $(FGDB_LIB) $(LIBXML2_LIB)
++SSEFLAGS = @SSEFLAGS@
++HAVE_SSE_AT_COMPILE_TIME = @HAVE_SSE_AT_COMPILE_TIME@
+ AVXFLAGS = @AVXFLAGS@
+ HAVE_AVX_AT_COMPILE_TIME = @HAVE_AVX_AT_COMPILE_TIME@
index 8988a60..2519269 100644 (file)
--- a/gdal.spec
+++ b/gdal.spec
@@ -7,6 +7,8 @@
 # - libkml (1.3.0 needed, not released yet)
 # - wait for newer pcidsk, switch to external again
 # - csharp, java
+# - DDS (--with-dds, BR [lib]crunch: http://code.google.com/p/crunch/)
+# - SOSI (--with-sosi, BR: libfyba libfygm libfyut: https://github.com/kartverket/fyba)
 # - additional, proprietary(?) formats support:
 #   - FMEObjects (http://www.safe.com/support/support-resources/fme-downloads/)
 #   - ESRI FileGDBAPI (http://resources.arcgis.com/content/geodatabases/10.0/file-gdb-api)
 #   - MSG/EUMETSAT (http://www.eumetsat.int/Home/Main/DataAccess/SupportSoftwareTools/index.htm)
 #   - Oracle/OCI >= 10.0.1 (for georaster); Oracle/OCI >= 8.1.7 (as DB)
 #   - Ingres (--with-ingres=/path)
-#   - Informix DB
+#   - Informix DB (--with-idb)
 #   - DWGdirect (members only? http://www.opendwg.org/)
 #   - ESRI SDE (http://www.esri.com/software/arcgis/arcsde/index.html)
 #
 # Conditional build:
 %bcond_without armadillo       # Armadillo support for faster TPS transform
 %bcond_without epsilon         # EPSILON wavelet compression support
+%bcond_with    grass           # GRASS support (note: dependency loop)
 %bcond_without gta             # GTA format support
 %bcond_without mysql           # MySQL DB support
+%bcond_with    oci             # ORACLE OCI DB and Georaster support
 %bcond_without odbc            # ODBC DB support
 %bcond_without opencl          # OpenCL (GPU) support
 %bcond_without openjpeg        # OpenJPEG 2 (JPEG2000) support
@@ -33,7 +37,7 @@
 %bcond_without spatialite      # SpatiaLite support
 %bcond_without xerces          # Xerces support
 %bcond_without java            # Java and MDB support
-%bcond_with    php             # PHP binding
+%bcond_without php             # PHP binding
 %bcond_without ruby            # Ruby binding
 
 %if %{with podofo}
 Summary:       Geospatial Data Abstraction Library
 Summary(pl.UTF-8):     Biblioteka abstrakcji danych dotyczÄ…cych powierzchni Ziemi
 Name:          gdal
-Version:       1.10.1
-Release:       6
+Version:       1.11.0
+Release:       1
 License:       BSD-like
 Group:         Libraries
 Source0:       http://download.osgeo.org/gdal/%{version}/%{name}-%{version}.tar.xz
-# Source0-md5: f354c614aea76e5630e4edbf06e5c292
+# Source0-md5: 31f2c4a7230b40e5fdc3cf12a100f96b
 Patch0:                %{name}-perl.patch
 Patch1:                %{name}-python_install.patch
 Patch2:                %{name}-php.patch
 Patch3:                %{name}-fpic.patch
 Patch4:                %{name}-format-security.patch
-Patch5:                gdal-bug-5284.patch
+Patch5:                %{name}-grass.patch
+Patch6:                %{name}-sse.patch
+Patch7:                %{name}-link.patch
 URL:           http://www.gdal.org/
 %{?with_opencl:BuildRequires:  OpenCL-devel >= 1.0}
 %{?with_armadillo:BuildRequires:       armadillo-devel}
@@ -65,13 +71,16 @@ BuildRequires:      doxygen >= 1.4.2
 %{?with_epsilon:BuildRequires: epsilon-compressor-devel}
 BuildRequires: expat-devel >= 1.95.0
 BuildRequires: freexl-devel >= 1.0
-BuildRequires: geos-devel >= 2.2.0
+BuildRequires: gcc >= 6:4.1
+BuildRequires: geos-devel >= 3.1.0
 BuildRequires: giflib-devel >= 4.0
+%{?with_grass:BuildRequires:   grass-devel >= 5.7}
 BuildRequires: hdf-devel >= 4.0
 BuildRequires: hdf5-devel
 BuildRequires: jasper-devel
 %{?with_java:BuildRequires:    jdk}
 %{?with_java:BuildRequires:    jpackage-utils}
+BuildRequires: json-c-devel >= 0.11
 BuildRequires: libcsf-devel
 BuildRequires: libdap-devel >= 3.10
 BuildRequires: libgeotiff-devel >= 1.2.1
@@ -85,11 +94,13 @@ BuildRequires:      libtiff-devel >= 4.0
 BuildRequires: libtool
 BuildRequires: libuuid-devel
 BuildRequires: libwebp-devel
-BuildRequires: libxml2-devel
+BuildRequires: libxml2-devel >= 2
 %{?with_mysql:BuildRequires:   mysql-devel}
 BuildRequires: netcdf-devel >= 4.1
 BuildRequires: ogdi-devel >= 3.1
 %{?with_openjpeg:BuildRequires:        openjpeg2-devel >= 2.0.0-2}
+# 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: perl-devel
 %{?with_php:BuildRequires:     php-devel}
@@ -109,6 +120,7 @@ BuildRequires:      rpmbuild(macros) >= 1.344
 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
@@ -118,7 +130,7 @@ BuildRequires:      texlive-latex
 BuildRequires: xz-devel
 BuildRequires: zlib-devel >= 1.1.4
 Requires:      freexl >= 1.0
-Requires:      geos >= 2.2.0
+Requires:      geos >= 3.1.0
 Requires:      libgeotiff >= 1.2.1
 Requires:      libpng >= 2:1.2.8
 Requires:      libtiff >= 4.0
@@ -152,11 +164,12 @@ Requires: curl-devel
 %{?with_epsilon:Requires:      epsilon-compressor-devel}
 Requires:      expat-devel >= 1.95.0
 Requires:      freexl-devel >= 1.0
-Requires:      geos-devel >= 2.2.0
+Requires:      geos-devel >= 3.1.0
 Requires:      giflib-devel >= 4.0
 Requires:      hdf-devel >= 4.0
 Requires:      hdf5-devel
 Requires:      jasper-devel
+Requires:      json-c-devel >= 0.11
 Requires:      libcsf-devel
 Requires:      libdap-devel >= 3.10
 Requires:      libgeotiff-devel >= 1.2.1
@@ -168,7 +181,7 @@ Requires:   libstdc++-devel
 Requires:      libtiff-devel >= 4.0
 Requires:      libuuid-devel
 Requires:      libwebp-devel
-Requires:      libxml2-devel
+Requires:      libxml2-devel >= 2
 %{?with_mysql:Requires:        mysql-devel}
 Requires:      netcdf-devel >= 4
 Requires:      ogdi-devel >= 3.1
@@ -255,18 +268,24 @@ osr.
 
 %prep
 %setup -q
-%{__aclocal}
-%{__autoconf}
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch5 -p3
-
-# 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}
-
+%patch5 -p1
+%patch6 -p1
+%patch7 -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
@@ -295,12 +314,14 @@ sed -i -e 's#^mandir=.*##g' configure.in
        --with-dods-root=/usr \
        %{?with_armadillo:--with-armadillo} \
        %{?with_epsilon:--with-epsilon} \
+       %{?with_grass:--with-grass} \
        %{!?with_gta:--without-gta} \
        --with-hide-internal-symbols \
        %{?with_java:--with-java=%{java_home}} \
        --with-liblzma \
        %{?with_java:--with-mdb --with-jvm-lib-add-rpath} \
        %{?with_mysql:--with-mysql} \
+       %{?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} \
@@ -314,7 +335,6 @@ sed -i -e 's#^mandir=.*##g' configure.in
        %{?with_xerces:--with-xerces} \
        --with-xerces-inc=/usr/include/xercesc \
        --with-xerces-lib="-lxerces-c" \
-       --without-grass \
        --without-libgrass
 #      --with-rasdaman
 #      --with-pcidsk=/usr (needs > 0.3)
@@ -369,8 +389,8 @@ EOF
 %{__rm} $RPM_BUILD_ROOT%{perl_vendorarch}/auto/Geo/OSR/.packlist
 
 # some doxygen trash
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdalmove.dox
-%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal_{edit,fillnodata,polygonize,proximity,sieve}.dox
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal{compare,move}.dox
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/gdal_{calc,edit,fillnodata,polygonize,proximity,sieve}.dox
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -403,6 +423,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/gdaladdo
 %attr(755,root,root) %{_bindir}/gdalbuildvrt
 %attr(755,root,root) %{_bindir}/gdalchksum.py
+%attr(755,root,root) %{_bindir}/gdalcompare.py
 %attr(755,root,root) %{_bindir}/gdaldem
 %attr(755,root,root) %{_bindir}/gdalenhance
 %attr(755,root,root) %{_bindir}/gdalident.py
@@ -420,6 +441,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/nearblack
 %attr(755,root,root) %{_bindir}/ogr2ogr
 %attr(755,root,root) %{_bindir}/ogrinfo
+%attr(755,root,root) %{_bindir}/ogrlineref
 %attr(755,root,root) %{_bindir}/ogrtindex
 %attr(755,root,root) %{_bindir}/pct2rgb.py
 %attr(755,root,root) %{_bindir}/rgb2pct.py
@@ -428,6 +450,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %ghost %{_libdir}/libgdal.so.1
 %{_datadir}/gdal
 %{_mandir}/man1/gdal2tiles.1*
+%{_mandir}/man1/gdal_calc.1*
 %{_mandir}/man1/gdal_contour.1*
 %{_mandir}/man1/gdal_edit.1*
 %{_mandir}/man1/gdal_fillnodata.1*
@@ -442,6 +465,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/gdal_utilities.1*
 %{_mandir}/man1/gdaladdo.1*
 %{_mandir}/man1/gdalbuildvrt.1*
+%{_mandir}/man1/gdalcompare.1*
 %{_mandir}/man1/gdaldem.1*
 %{_mandir}/man1/gdalinfo.1*
 %{_mandir}/man1/gdallocationinfo.1*
@@ -455,6 +479,7 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/ogr2ogr.1*
 %{_mandir}/man1/ogr_utilities.1*
 %{_mandir}/man1/ogrinfo.1*
+%{_mandir}/man1/ogrlineref.1*
 %{_mandir}/man1/ogrtindex.1*
 %{_mandir}/man1/pct2rgb.1*
 %{_mandir}/man1/rgb2pct.1*
@@ -465,6 +490,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/gdal-config
 %attr(755,root,root) %{_libdir}/libgdal.so
 %{_libdir}/libgdal.la
+%{_pkgconfigdir}/gdal.pc
 %{_includedir}/cpl_*.h
 %{_includedir}/cplkeywordparser.h
 %{_includedir}/gdal*.h
This page took 0.140757 seconds and 4 git commands to generate.