---- libxml2-2.10.0/xmlIO.c.orig 2022-08-18 16:29:32.843322082 +0200
-+++ libxml2-2.10.0/xmlIO.c 2022-08-18 16:32:12.985787850 +0200
-@@ -1115,8 +1115,33 @@ xmlGzfileOpen_real (const char *filename
+--- libxml2-2.13.0/xmlIO.c.orig 2024-06-14 12:32:12.257784372 +0200
++++ libxml2-2.13.0/xmlIO.c 2024-06-14 19:23:06.355299914 +0200
+@@ -547,6 +547,29 @@
+ fd = open(filename, flags, 0777);
+ #endif /* WIN32 */
- if (path == NULL)
- return(NULL);
-- if (!xmlCheckFilename(path))
-- return(NULL);
-+ if (!xmlCheckFilename(path)) {
-+ /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
-+ * append .gz only if filename doesn't alreay end with .gz. */
-+ if (strlen(path) < 3 || strcmp(path + strlen(path) - 3, ".gz") != 0) {
-+ char *gz_filename = xmlMalloc(strlen(path) + 4);
++#ifdef LIBXML_ZLIB_ENABLED
++ if (fd < 0 && errno == ENOENT) {
++ /* If we cannot open `foo.xml', we try `foo.xml.gz'. However we i
++ * append .gz only if filename doesn't alreay end with .gz. */
++ if (strlen(filename) < 3 || strcmp(filename + strlen(filename) - 3, ".gz") != 0) {
++ char *gz_filename = xmlMalloc(strlen(filename) + 4);
++ int gz_fd;
+
-+ if (gz_filename == NULL) {
-+ xmlGenericError(xmlGenericErrorContext,
-+ "xmlGzfileOpen: %s\n",
-+ "Failure allocating buffer for filename.");
-+ return NULL;
-+ }
++ if (gz_filename != NULL) {
++ strcpy(gz_filename, filename);
++ strcat(gz_filename, ".gz");
++ }
+
-+ strcpy(gz_filename, path);
-+ strcat(gz_filename, ".gz");
++ gz_fd = open(gz_filename, flags, 0777);
+
-+ fd = NULL;
++ if (gz_fd >= 0)
++ fd = gz_fd;
+
-+ if (xmlCheckFilename(gz_filename))
-+ fd = gzopen(gz_filename, "rb");
-+
-+ xmlFree(gz_filename);
-+
-+ return((void *) fd);
-+ } else
-+ return NULL;
++ xmlFree(gz_filename);
++ }
+ }
-
- #if defined(_WIN32)
- fd = xmlWrapGzOpenUtf8(path, "rb");
++
++#endif /* LIBXML_ZLIB_ENABLED */
+ if (fd < 0) {
+ /*
+ * Windows and possibly other platforms return EINVAL
%bcond_without python3 # CPython 3.x module
%bcond_without static_libs # static library
%bcond_without zlib # zlib support
-%bcond_with mem_debug # libxml2 memory debuging
%bcond_without tests # "make check" call
Summary: libXML library version 2
Summary(pl.UTF-8): Biblioteka libXML wersja 2
Summary(pt_BR.UTF-8): Biblioteca libXML versão 2
Name: libxml2
-Version: 2.12.6
+Version: 2.13.1
Release: 1
Epoch: 1
License: MIT
Group: Libraries
#Source0: ftp://xmlsoft.org/libxml2/%{name}-%{version}.tar.gz
-Source0: https://download.gnome.org/sources/libxml2/2.12/%{name}-%{version}.tar.xz
-# Source0-md5: 37fab9ace78d8a085af81dc9a19f36d9
+Source0: https://download.gnome.org/sources/libxml2/2.13/%{name}-%{version}.tar.xz
+# Source0-md5: d76c4742c94adb5d027c718fdeb726c8
Patch0: %{name}-open.gz.patch
Patch1: %{name}-largefile.patch
Patch2: %{name}-libx32.patch
--disable-silent-rules \
%{?with_static_libs:--enable-static} \
%{?with_ftp:--with-ftp} \
+ --with-http \
%{?with_legacy:--with-legacy} \
--with-lzma \
- --with-mem-debug%{!?with_mem_debug:=no} \
--without-python \
- %{!?with_zlib:--without-zlib}
+ --with-tls \
+ %{?with_zlib:--with-zlib}
%{__make}
cd ..
%endif
-install -d $RPM_BUILD_ROOT%{_examplesdir}
-%{__mv} $RPM_BUILD_ROOT%{_docdir}/libxml2/examples $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%if %{with apidocs}
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -p example/*.{c,xml} $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+%endif
# install catalog file
install -d $RPM_BUILD_ROOT%{_sysconfdir}/xml