--- /dev/null
+From 7a18e2669a733ebe3544e4f5c735fd4d2ded5fa3 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder@redhat.com>
+Date: Thu, 10 Dec 2020 14:02:44 +0100
+Subject: [PATCH] Add some missing <limits> includes
+
+Otherwise, the builds fails with either gcc11 or recent clang.
+---
+ gdal/ogr/ogrsf_frmts/cad/libopencad/cadobjects.cpp | 1 +
+ gdal/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp | 1 +
+ gdal/third_party/LercLib/Lerc2.h | 1 +
+ 3 files changed, 3 insertions(+)
+
+diff --git a/gdal/ogr/ogrsf_frmts/cad/libopencad/cadobjects.cpp b/gdal/ogr/ogrsf_frmts/cad/libopencad/cadobjects.cpp
+index f59f7d50e2f5..edff5100e1f4 100644
+--- a/gdal/ogr/ogrsf_frmts/cad/libopencad/cadobjects.cpp
++++ b/gdal/ogr/ogrsf_frmts/cad/libopencad/cadobjects.cpp
+@@ -31,6 +31,7 @@
+
+ #include "cadobjects.h"
+
++#include <limits>
+ #include <math.h>
+ #include <algorithm>
+
+diff --git a/gdal/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp b/gdal/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp
+index 83951fd7e7fc..6ae837da6467 100644
+--- a/gdal/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp
++++ b/gdal/ogr/ogrsf_frmts/cad/libopencad/dwg/r2000.cpp
+@@ -36,6 +36,7 @@
+ #include <cassert>
+ #include <cstring>
+ #include <iostream>
++#include <limits>
+ #include <memory>
+ #include <string>
+
+diff --git a/gdal/third_party/LercLib/Lerc2.h b/gdal/third_party/LercLib/Lerc2.h
+index feec95529c83..564f928ee672 100644
+--- a/gdal/third_party/LercLib/Lerc2.h
++++ b/gdal/third_party/LercLib/Lerc2.h
+@@ -27,6 +27,7 @@ Contributors: Thomas Maurer
+ #include <algorithm>
+ #include <cfloat>
+ #include <cmath>
++#include <limits>
+ #include <string>
+ #include <typeinfo>
+ #include "Defines.h"
Patch7: decl.patch
Patch8: %{name}_tirpcinc.patch
Patch9: jasper.patch
+Patch10: gcc11.patch
URL: http://www.gdal.org/
# 1.x or 2.x supported
BuildRequires: CharLS-devel
%patch7 -p1
%patch8 -p1
%patch9 -p2
+%patch10 -p2
# 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}