From af3796900136983563c7e23e015496d5e7b9aa1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sat, 19 Aug 2017 09:38:54 -0400 Subject: [PATCH 01/26] Python 2 binary package renamed to python2-libxml2 --- libxml2.spec | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 065b9c9..ba50ee4 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -3,7 +3,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.4 -Release: 4%{?dist}%{?extra_release} +Release: 5%{?dist}%{?extra_release} License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -62,14 +62,15 @@ Requires: libxml2 = %{version}-%{release} Static library for libxml2 provided for specific uses or shaving a few microseconds when parsing, do not link to them for generic purpose packages. -%package -n python-%{name} +%package -n python2-%{name} +%{?python_provide:%python_provide python2-%{name}} Summary: Python bindings for the libxml2 library Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} Provides: %{name}-python = %{version}-%{release} -%description -n python-%{name} +%description -n python2-%{name} The libxml2-python package contains a Python 2 module that permits applications written in the Python programming language, version 2, to use the interface supplied by the libxml2 library to manipulate XML files. @@ -190,7 +191,7 @@ rm -fr %{buildroot} %{_libdir}/*a -%files -n python-%{name} +%files -n python2-%{name} %defattr(-, root, root) %{_libdir}/python2*/site-packages/libxml2.py* @@ -217,6 +218,10 @@ rm -fr %{buildroot} %changelog +* Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 2.9.4-5 +- Python 2 binary package renamed to python2-libxml2 + See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 + * Thu Aug 03 2017 Fedora Release Engineering - 2.9.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild From 72e4478789a0052ec0417feb8ca651782d6480a2 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 4 Sep 2017 18:22:44 +0200 Subject: [PATCH 02/26] Update to 2.9.5 --- libxml2.spec | 7 +++++-- sources | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index ba50ee4..cad04f5 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -2,8 +2,8 @@ Summary: Library providing XML and HTML support Name: libxml2 -Version: 2.9.4 -Release: 5%{?dist}%{?extra_release} +Version: 2.9.5 +Release: 1%{?dist}%{?extra_release} License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -218,6 +218,9 @@ rm -fr %{buildroot} %changelog +* Mon Sep 4 2017 Daniel Veillard - 2.9.5-1 +- update to 2.9.5 + * Sat Aug 19 2017 Zbigniew Jędrzejewski-Szmek - 2.9.4-5 - Python 2 binary package renamed to python2-libxml2 See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3 diff --git a/sources b/sources index 4166ed0..b340bec 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libxml2-2.9.4.tar.gz) = f5174ab1a3a0ec0037a47f47aa47def36674e02bfb42b57f609563f84c6247c585dbbb133c056953a5adb968d328f18cbc102eb0d00d48eb7c95478389e5daf9 +SHA512 (libxml2-2.9.5.tar.gz) = 197dbd1722e5f90eea43837323352f48d215e198aa6b95685645ef7511e2beba8aadc0dd67e099c945120c5dbe7f8c9da5f376b22f447059e9ffa941c1bfd175 From 09a4a286a958dec3aee16598ca0228e152b08baa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Fri, 22 Sep 2017 12:26:42 +0200 Subject: [PATCH 03/26] Fix reporting error about undefined XPath variables --- ...defined-XPath-variable-error-message.patch | 54 +++++++++++++++++++ libxml2.spec | 9 +++- 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch diff --git a/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch b/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch new file mode 100644 index 0000000..1b62d69 --- /dev/null +++ b/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch @@ -0,0 +1,54 @@ +From 3157cf4e53c03bc3da604472c015c63141907db8 Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Wed, 20 Sep 2017 16:13:29 +0200 +Subject: [PATCH] Report undefined XPath variable error message +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit c851970 removed a redundant error message if XPath evaluation +failed. This uncovered a case where an undefined XPath variable error +wasn't reported correctly. + +Thanks to Petr Pisar for the report. + +Fixes bug 787941. + +Signed-off-by: Petr Písař +--- + xpath.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +diff --git a/xpath.c b/xpath.c +index 2c1b2681..94815075 100644 +--- a/xpath.c ++++ b/xpath.c +@@ -13531,10 +13531,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); + if (op->value5 == NULL) { + val = xmlXPathVariableLookup(ctxt->context, op->value4); +- if (val == NULL) { +- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; +- return(0); +- } ++ if (val == NULL) ++ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + valuePush(ctxt, val); + } else { + const xmlChar *URI; +@@ -13549,10 +13547,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) + } + val = xmlXPathVariableLookupNS(ctxt->context, + op->value4, URI); +- if (val == NULL) { +- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; +- return(0); +- } ++ if (val == NULL) ++ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); + valuePush(ctxt, val); + } + return (total); +-- +2.13.5 + diff --git a/libxml2.spec b/libxml2.spec index cad04f5..f0c1a2a 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -3,7 +3,7 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.5 -Release: 1%{?dist}%{?extra_release} +Release: 2%{?dist}%{?extra_release} License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz @@ -21,6 +21,9 @@ Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 Patch2: libxml2-2.9.4-remove-pyverify_fd.patch +# Fix reporting error about undefined XPath variables, bug #1493613, +# Gnome bug #787941, fixed in upstream after 2.9.5 +Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch %description This library allows to manipulate XML files. It includes support @@ -107,6 +110,7 @@ at parse time or later once the document has been modified. %if 0%{?fedora} > 25 %patch2 -p1 %endif +%patch3 -p1 mkdir py3doc cp doc/*.py py3doc @@ -218,6 +222,9 @@ rm -fr %{buildroot} %changelog +* Fri Sep 22 2017 Petr Pisar - 2.9.5-2 +- Fix reporting error about undefined XPath variables (bug #1493613) + * Mon Sep 4 2017 Daniel Veillard - 2.9.5-1 - update to 2.9.5 From 69de1731a71d66d687bb80e43ae47162c7308620 Mon Sep 17 00:00:00 2001 From: Iryna Shcherbina Date: Tue, 9 Jan 2018 19:03:28 +0100 Subject: [PATCH 04/26] Update Python 2 dependency declarations to new packaging standards --- libxml2.spec | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index f0c1a2a..e29bb40 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -3,12 +3,12 @@ Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.5 -Release: 2%{?dist}%{?extra_release} +Release: 3%{?dist}%{?extra_release} License: MIT Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root -BuildRequires: python-devel +BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel %endif # with_python3 @@ -222,6 +222,10 @@ rm -fr %{buildroot} %changelog +* Tue Jan 09 2018 Iryna Shcherbina - 2.9.5-3 +- Update Python 2 dependency declarations to new packaging standards + (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) + * Fri Sep 22 2017 Petr Pisar - 2.9.5-2 - Fix reporting error about undefined XPath variables (bug #1493613) From 7f247aa046d6155c4ecbbe4eff2b63da46db7782 Mon Sep 17 00:00:00 2001 From: Troy Dawson Date: Mon, 22 Jan 2018 14:27:36 -0800 Subject: [PATCH 05/26] Cleanup conditional --- libxml2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index e29bb40..2d0ca0c 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -107,9 +107,7 @@ at parse time or later once the document has been modified. %patch0 -p1 # workaround for #877567 - Very weird bug gzip decompression bug in "recent" libxml2 versions %patch1 -p1 -b .do-not-check-crc -%if 0%{?fedora} > 25 %patch2 -p1 -%endif %patch3 -p1 mkdir py3doc From 673dee43faab71e6692c7a71d7063bc1c2142c64 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:42:07 +0100 Subject: [PATCH 06/26] remove Group tag Signed-off-by: Igor Gnatenko --- libxml2.spec | 5 ----- 1 file changed, 5 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 2d0ca0c..0c82434 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -5,7 +5,6 @@ Name: libxml2 Version: 2.9.5 Release: 3%{?dist}%{?extra_release} License: MIT -Group: Development/Libraries Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python2-devel @@ -38,7 +37,6 @@ URI library. %package devel Summary: Libraries, includes, etc. to develop XML and HTML applications -Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Requires: zlib-devel Requires: xz-devel @@ -58,7 +56,6 @@ URI library. %package static Summary: Static library for libxml2 -Group: Development/Libraries Requires: libxml2 = %{version}-%{release} %description static @@ -68,7 +65,6 @@ microseconds when parsing, do not link to them for generic purpose packages. %package -n python2-%{name} %{?python_provide:%python_provide python2-%{name}} Summary: Python bindings for the libxml2 library -Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} Provides: %{name}-python = %{version}-%{release} @@ -86,7 +82,6 @@ at parse time or later once the document has been modified. %if 0%{?with_python3} %package -n python3-%{name} Summary: Python 3 bindings for the libxml2 library -Group: Development/Libraries Requires: libxml2 = %{version}-%{release} Obsoletes: %{name}-python3 < %{version}-%{release} Provides: %{name}-python3 = %{version}-%{release} From 2ee1a5c1bebfc1f4a47de21b95d16d02b5626161 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:42:23 +0100 Subject: [PATCH 07/26] remove BuildRoot tag Signed-off-by: Igor Gnatenko --- libxml2.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/libxml2.spec b/libxml2.spec index 0c82434..674739a 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -6,7 +6,6 @@ Version: 2.9.5 Release: 3%{?dist}%{?extra_release} License: MIT Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-root BuildRequires: python2-devel %if 0%{?with_python3} BuildRequires: python3-devel From 965bdac3f238f3d4ba32afafecdb78420cb217ad Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:42:37 +0100 Subject: [PATCH 08/26] remove %clean section Signed-off-by: Igor Gnatenko --- libxml2.spec | 3 --- 1 file changed, 3 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 674739a..b380716 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -139,9 +139,6 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %check make runtests -%clean -rm -fr %{buildroot} - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig From db8ab5e3518b707485f286a8ab9a9be2ad43f2c1 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:43:02 +0100 Subject: [PATCH 09/26] remove %defattr declarations Signed-off-by: Igor Gnatenko --- libxml2.spec | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index b380716..308ec2a 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -144,8 +144,6 @@ make runtests %postun -p /sbin/ldconfig %files -%defattr(-, root, root) - %{!?_licensedir:%global license %%doc} %license Copyright %doc AUTHORS NEWS README TODO @@ -158,8 +156,6 @@ make runtests %{_bindir}/xmlcatalog %files devel -%defattr(-, root, root) - %doc %{_mandir}/man1/xml2-config.1* %doc AUTHORS NEWS README Copyright %doc doc/*.html doc/html doc/*.gif doc/*.png @@ -180,13 +176,9 @@ make runtests %{_libdir}/cmake/libxml2/libxml2-config.cmake %files static -%defattr(-, root, root) - %{_libdir}/*a %files -n python2-%{name} -%defattr(-, root, root) - %{_libdir}/python2*/site-packages/libxml2.py* %{_libdir}/python2*/site-packages/drv_libxml2.py* %{_libdir}/python2*/site-packages/libxml2mod* @@ -197,8 +189,6 @@ make runtests %if 0%{?with_python3} %files -n python3-%{name} -%defattr(-, root, root) - %{_libdir}/python3*/site-packages/libxml2.py* %{_libdir}/python3*/site-packages/drv_libxml2.py* %{_libdir}/python3*/site-packages/__pycache__/*py* From 056dc2a1a6146453e28172107d442376a3fa2737 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:43:35 +0100 Subject: [PATCH 10/26] remove useless %with_python3 Signed-off-by: Igor Gnatenko --- libxml2.spec | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 308ec2a..e632317 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,5 +1,3 @@ -%global with_python3 1 - Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.5 @@ -7,9 +5,7 @@ Release: 3%{?dist}%{?extra_release} License: MIT Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz BuildRequires: python2-devel -%if 0%{?with_python3} BuildRequires: python3-devel -%endif # with_python3 BuildRequires: zlib-devel BuildRequires: pkgconfig BuildRequires: xz-devel @@ -78,7 +74,6 @@ to read, modify and write XML and HTML files. There is DTDs support this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. -%if 0%{?with_python3} %package -n python3-%{name} Summary: Python 3 bindings for the libxml2 library Requires: libxml2 = %{version}-%{release} @@ -94,7 +89,6 @@ This library allows to manipulate XML files. It includes support to read, modify and write XML and HTML files. There is DTDs support this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. -%endif # with_python3 %prep %setup -q @@ -119,11 +113,9 @@ rm -fr %{buildroot} make install DESTDIR=%{buildroot} -%if 0%{?with_python3} make clean %configure --with-python=%{__python3} make install DESTDIR=%{buildroot} -%endif # with_python3 # multiarch crazyness on timestamp differences or Makefile/binaries for examples touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config @@ -187,7 +179,6 @@ make runtests %doc doc/*.py %doc doc/python.html -%if 0%{?with_python3} %files -n python3-%{name} %{_libdir}/python3*/site-packages/libxml2.py* %{_libdir}/python3*/site-packages/drv_libxml2.py* @@ -197,8 +188,6 @@ make runtests %doc python/libxml2class.txt %doc py3doc/*.py %doc doc/python.html -%endif # with_python3 - %changelog * Tue Jan 09 2018 Iryna Shcherbina - 2.9.5-3 From 72593ec17b858467559b390c558a95892794c963 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:45:25 +0100 Subject: [PATCH 11/26] reorder preamble Signed-off-by: Igor Gnatenko --- libxml2.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index e632317..8f40559 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,15 +1,11 @@ -Summary: Library providing XML and HTML support Name: libxml2 Version: 2.9.5 Release: 3%{?dist}%{?extra_release} +Summary: Library providing XML and HTML support + License: MIT -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz -BuildRequires: python2-devel -BuildRequires: python3-devel -BuildRequires: zlib-devel -BuildRequires: pkgconfig -BuildRequires: xz-devel URL: http://xmlsoft.org/ +Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz Patch0: libxml2-multilib.patch Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more @@ -19,6 +15,12 @@ Patch2: libxml2-2.9.4-remove-pyverify_fd.patch # Gnome bug #787941, fixed in upstream after 2.9.5 Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch +BuildRequires: python2-devel +BuildRequires: python3-devel +BuildRequires: zlib-devel +BuildRequires: pkgconfig +BuildRequires: xz-devel + %description This library allows to manipulate XML files. It includes support to read, modify and write XML and HTML files. There is DTDs support From b48abf9eb2cbeedef2d98f31aae9555a8baeeeff Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:47:18 +0100 Subject: [PATCH 12/26] indent Signed-off-by: Igor Gnatenko --- libxml2.spec | 62 ++++++++++++++++++++++++++-------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 8f40559..e432ba9 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,25 +1,25 @@ -Name: libxml2 -Version: 2.9.5 -Release: 3%{?dist}%{?extra_release} -Summary: Library providing XML and HTML support +Name: libxml2 +Version: 2.9.5 +Release: 3%{?dist}%{?extra_release} +Summary: Library providing XML and HTML support -License: MIT -URL: http://xmlsoft.org/ -Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz -Patch0: libxml2-multilib.patch -Patch1: libxml2-2.9.0-do-not-check-crc.patch +License: MIT +URL: http://xmlsoft.org/ +Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz +Patch0: libxml2-multilib.patch +Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 -Patch2: libxml2-2.9.4-remove-pyverify_fd.patch +Patch2: libxml2-2.9.4-remove-pyverify_fd.patch # Fix reporting error about undefined XPath variables, bug #1493613, # Gnome bug #787941, fixed in upstream after 2.9.5 -Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch +Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch -BuildRequires: python2-devel -BuildRequires: python3-devel -BuildRequires: zlib-devel -BuildRequires: pkgconfig -BuildRequires: xz-devel +BuildRequires: python2-devel +BuildRequires: python3-devel +BuildRequires: zlib-devel +BuildRequires: pkgconfig +BuildRequires: xz-devel %description This library allows to manipulate XML files. It includes support @@ -33,11 +33,11 @@ available, with existing HTTP and FTP modules and combined to an URI library. %package devel -Summary: Libraries, includes, etc. to develop XML and HTML applications -Requires: libxml2 = %{version}-%{release} -Requires: zlib-devel -Requires: xz-devel -Requires: pkgconfig +Summary: Libraries, includes, etc. to develop XML and HTML applications +Requires: libxml2 = %{version}-%{release} +Requires: zlib-devel +Requires: xz-devel +Requires: pkgconfig %description devel Libraries, include files, etc you can use to develop XML applications. @@ -52,8 +52,8 @@ available, with existing HTTP and FTP modules and combined to an URI library. %package static -Summary: Static library for libxml2 -Requires: libxml2 = %{version}-%{release} +Summary: Static library for libxml2 +Requires: libxml2 = %{version}-%{release} %description static Static library for libxml2 provided for specific uses or shaving a few @@ -61,10 +61,10 @@ microseconds when parsing, do not link to them for generic purpose packages. %package -n python2-%{name} %{?python_provide:%python_provide python2-%{name}} -Summary: Python bindings for the libxml2 library -Requires: libxml2 = %{version}-%{release} -Obsoletes: %{name}-python < %{version}-%{release} -Provides: %{name}-python = %{version}-%{release} +Summary: Python bindings for the libxml2 library +Requires: libxml2 = %{version}-%{release} +Obsoletes: %{name}-python < %{version}-%{release} +Provides: %{name}-python = %{version}-%{release} %description -n python2-%{name} The libxml2-python package contains a Python 2 module that permits applications @@ -77,10 +77,10 @@ this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. %package -n python3-%{name} -Summary: Python 3 bindings for the libxml2 library -Requires: libxml2 = %{version}-%{release} -Obsoletes: %{name}-python3 < %{version}-%{release} -Provides: %{name}-python3 = %{version}-%{release} +Summary: Python 3 bindings for the libxml2 library +Requires: libxml2 = %{version}-%{release} +Obsoletes: %{name}-python3 < %{version}-%{release} +Provides: %{name}-python3 = %{version}-%{release} %description -n python3-%{name} The libxml2-python3 package contains a Python 3 module that permits From 4a557f56ebcaecb04f9584d7d2969442c0887001 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:51:55 +0100 Subject: [PATCH 13/26] Update to 2.9.7 Signed-off-by: Igor Gnatenko --- .gitignore | 1 + ...defined-XPath-variable-error-message.patch | 54 ------------------- libxml2.spec | 8 +-- sources | 2 +- 4 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch diff --git a/.gitignore b/.gitignore index d989436..3d089c0 100644 --- a/.gitignore +++ b/.gitignore @@ -34,3 +34,4 @@ libxml2-2.7.7.tar.gz /libxml2-2.9.2.tar.gz /libxml2-2.9.3.tar.gz /libxml2-2.9.4.tar.gz +/libxml2-2.9.7.tar.gz diff --git a/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch b/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch deleted file mode 100644 index 1b62d69..0000000 --- a/libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 3157cf4e53c03bc3da604472c015c63141907db8 Mon Sep 17 00:00:00 2001 -From: Nick Wellnhofer -Date: Wed, 20 Sep 2017 16:13:29 +0200 -Subject: [PATCH] Report undefined XPath variable error message -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Commit c851970 removed a redundant error message if XPath evaluation -failed. This uncovered a case where an undefined XPath variable error -wasn't reported correctly. - -Thanks to Petr Pisar for the report. - -Fixes bug 787941. - -Signed-off-by: Petr Písař ---- - xpath.c | 12 ++++-------- - 1 file changed, 4 insertions(+), 8 deletions(-) - -diff --git a/xpath.c b/xpath.c -index 2c1b2681..94815075 100644 ---- a/xpath.c -+++ b/xpath.c -@@ -13531,10 +13531,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) - xmlXPathCompOpEval(ctxt, &comp->steps[op->ch1]); - if (op->value5 == NULL) { - val = xmlXPathVariableLookup(ctxt->context, op->value4); -- if (val == NULL) { -- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; -- return(0); -- } -+ if (val == NULL) -+ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); - valuePush(ctxt, val); - } else { - const xmlChar *URI; -@@ -13549,10 +13547,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op) - } - val = xmlXPathVariableLookupNS(ctxt->context, - op->value4, URI); -- if (val == NULL) { -- ctxt->error = XPATH_UNDEF_VARIABLE_ERROR; -- return(0); -- } -+ if (val == NULL) -+ XP_ERROR0(XPATH_UNDEF_VARIABLE_ERROR); - valuePush(ctxt, val); - } - return (total); --- -2.13.5 - diff --git a/libxml2.spec b/libxml2.spec index e432ba9..c792340 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -1,6 +1,6 @@ Name: libxml2 -Version: 2.9.5 -Release: 3%{?dist}%{?extra_release} +Version: 2.9.7 +Release: 1%{?dist} Summary: Library providing XML and HTML support License: MIT @@ -11,9 +11,6 @@ Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 Patch2: libxml2-2.9.4-remove-pyverify_fd.patch -# Fix reporting error about undefined XPath variables, bug #1493613, -# Gnome bug #787941, fixed in upstream after 2.9.5 -Patch3: libxml2-2.9.5-Report-undefined-XPath-variable-error-message.patch BuildRequires: python2-devel BuildRequires: python3-devel @@ -98,7 +95,6 @@ at parse time or later once the document has been modified. # workaround for #877567 - Very weird bug gzip decompression bug in "recent" libxml2 versions %patch1 -p1 -b .do-not-check-crc %patch2 -p1 -%patch3 -p1 mkdir py3doc cp doc/*.py py3doc diff --git a/sources b/sources index b340bec..b2fb4ec 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libxml2-2.9.5.tar.gz) = 197dbd1722e5f90eea43837323352f48d215e198aa6b95685645ef7511e2beba8aadc0dd67e099c945120c5dbe7f8c9da5f376b22f447059e9ffa941c1bfd175 +SHA512 (libxml2-2.9.7.tar.gz) = da06cb7c5032ef4b7c8e902fabb9d2c74634c42c161be07a7c66a00d53a68029f89b0d4de32a6b9d4ff338c2d1d9c4e53aefb9cf50cb1c2d6c6b06b442ef42d5 From 09ddbc50ac6ecbd8aaae78ee2e812bb38c8b4fd5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:52:18 +0100 Subject: [PATCH 14/26] use %autosetup Signed-off-by: Igor Gnatenko --- libxml2.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index c792340..8d8a9ab 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -7,6 +7,7 @@ License: MIT URL: http://xmlsoft.org/ Source: ftp://xmlsoft.org/libxml2/libxml2-%{version}.tar.gz Patch0: libxml2-multilib.patch +# workaround for #877567 - Very weird bug gzip decompression bug in "recent" libxml2 versions Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 @@ -90,11 +91,7 @@ this includes parsing and validation even with complex DTDs, either at parse time or later once the document has been modified. %prep -%setup -q -%patch0 -p1 -# workaround for #877567 - Very weird bug gzip decompression bug in "recent" libxml2 versions -%patch1 -p1 -b .do-not-check-crc -%patch2 -p1 +%autosetup -p1 mkdir py3doc cp doc/*.py py3doc From ee9b54e2b402e14ebc22cf0cc5d0d84aad199945 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 06:52:51 +0100 Subject: [PATCH 15/26] use %make_build/%make_install Signed-off-by: Igor Gnatenko --- libxml2.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 8d8a9ab..1d94460 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -99,18 +99,18 @@ sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py %build %configure -make %{_smp_mflags} +%make_build find doc -type f -exec chmod 0644 \{\} \; %install rm -fr %{buildroot} -make install DESTDIR=%{buildroot} +%make_install make clean %configure --with-python=%{__python3} -make install DESTDIR=%{buildroot} +%make_install # multiarch crazyness on timestamp differences or Makefile/binaries for examples touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config From 8ea19b7e2d9598431e4e4c05438ef09e87856287 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:00:54 +0100 Subject: [PATCH 16/26] use separate build directories Signed-off-by: Igor Gnatenko --- libxml2.spec | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 1d94460..53cacbe 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -98,19 +98,20 @@ cp doc/*.py py3doc sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py %build -%configure -%make_build +mkdir py2 py3 +%global _configure ../configure +( cd py2 && %configure --cache-file=../config.cache --with-python=%{__python2} ) +( cd py3 && %configure --cache-file=../config.cache --with-python=%{__python3} ) +%make_build -C py2 +%make_build -C py3 find doc -type f -exec chmod 0644 \{\} \; %install rm -fr %{buildroot} -%make_install - -make clean -%configure --with-python=%{__python3} -%make_install +%make_install -C py2 +%make_install -C py3 # multiarch crazyness on timestamp differences or Makefile/binaries for examples touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config @@ -120,11 +121,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/* rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/* -(cd doc/examples ; make clean ; rm -rf .deps Makefile) +#(cd doc/examples ; make clean ; rm -rf .deps Makefile) gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %check -make runtests +%make_build runtests -C py2 +%make_build runtests -C py3 %post -p /sbin/ldconfig From bca8735c76df35518e1a5f57689eee7d4581dd14 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:07:42 +0100 Subject: [PATCH 17/26] remove useless conditional define for _licensedir Signed-off-by: Igor Gnatenko --- libxml2.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/libxml2.spec b/libxml2.spec index 53cacbe..815155f 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -133,7 +133,6 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %postun -p /sbin/ldconfig %files -%{!?_licensedir:%global license %%doc} %license Copyright %doc AUTHORS NEWS README TODO %doc %{_mandir}/man1/xmllint.1* From 04921ce29557970f294264660eb2f65ad0349f50 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:12:55 +0100 Subject: [PATCH 18/26] fix BuildRequires/Requires/Provides Signed-off-by: Igor Gnatenko --- libxml2.spec | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 815155f..ca4826f 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -13,11 +13,10 @@ Patch1: libxml2-2.9.0-do-not-check-crc.patch # http://bugs.python.org/issue23524 Patch2: libxml2-2.9.4-remove-pyverify_fd.patch -BuildRequires: python2-devel -BuildRequires: python3-devel -BuildRequires: zlib-devel -BuildRequires: pkgconfig -BuildRequires: xz-devel +BuildRequires: gcc +BuildRequires: cmake-rpm-macros +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(liblzma) %description This library allows to manipulate XML files. It includes support @@ -32,10 +31,9 @@ URI library. %package devel Summary: Libraries, includes, etc. to develop XML and HTML applications -Requires: libxml2 = %{version}-%{release} -Requires: zlib-devel -Requires: xz-devel -Requires: pkgconfig +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: zlib-devel%{?_isa} +Requires: xz-devel%{?_isa} %description devel Libraries, include files, etc you can use to develop XML applications. @@ -51,7 +49,6 @@ URI library. %package static Summary: Static library for libxml2 -Requires: libxml2 = %{version}-%{release} %description static Static library for libxml2 provided for specific uses or shaving a few @@ -60,7 +57,8 @@ microseconds when parsing, do not link to them for generic purpose packages. %package -n python2-%{name} %{?python_provide:%python_provide python2-%{name}} Summary: Python bindings for the libxml2 library -Requires: libxml2 = %{version}-%{release} +BuildRequires: python2-devel +Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python < %{version}-%{release} Provides: %{name}-python = %{version}-%{release} @@ -76,7 +74,8 @@ at parse time or later once the document has been modified. %package -n python3-%{name} Summary: Python 3 bindings for the libxml2 library -Requires: libxml2 = %{version}-%{release} +BuildRequires: python3-devel +Requires: %{name}%{?_isa} = %{version}-%{release} Obsoletes: %{name}-python3 < %{version}-%{release} Provides: %{name}-python3 = %{version}-%{release} From aa634eccad09ebae197d4a4ade1a34efba1e356f Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:13:48 +0100 Subject: [PATCH 19/26] =?UTF-8?q?$RPM=5FBUILD=5FROOT=20=E2=86=92=20%{build?= =?UTF-8?q?root}?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- libxml2.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index ca4826f..c0ebfbd 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -113,13 +113,13 @@ rm -fr %{buildroot} %make_install -C py3 # multiarch crazyness on timestamp differences or Makefile/binaries for examples -touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config +touch -m --reference=%{buildroot}%{_includedir}/libxml2/libxml/parser.h %{buildroot}%{_bindir}/xml2-config -rm -f $RPM_BUILD_ROOT%{_libdir}/*.la -rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a -rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/* -rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/* +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{_libdir}/python*/site-packages/*.a +rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la +rm -rf %{buildroot}%{_datadir}/doc/libxml2-%{version}/* +rm -rf %{buildroot}%{_datadir}/doc/libxml2-python-%{version}/* #(cd doc/examples ; make clean ; rm -rf .deps Makefile) gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz From 294ae933dbd0319333aa9eb0b10879ce86dad8d2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:29:51 +0100 Subject: [PATCH 20/26] move chmod to %prep Signed-off-by: Igor Gnatenko --- libxml2.spec | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index c0ebfbd..7b9ee4a 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -91,10 +91,7 @@ at parse time or later once the document has been modified. %prep %autosetup -p1 - -mkdir py3doc -cp doc/*.py py3doc -sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py +find doc -type f -executable -print -exec chmod 0644 {} ';' %build mkdir py2 py3 @@ -104,8 +101,6 @@ mkdir py2 py3 %make_build -C py2 %make_build -C py3 -find doc -type f -exec chmod 0644 \{\} \; - %install rm -fr %{buildroot} From 06d7baf88759ae25ef6b52c1aaa97c535296b5dc Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:30:29 +0100 Subject: [PATCH 21/26] make build verbose Signed-off-by: Igor Gnatenko --- libxml2.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/libxml2.spec b/libxml2.spec index 7b9ee4a..74c680b 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -96,6 +96,7 @@ find doc -type f -executable -print -exec chmod 0644 {} ';' %build mkdir py2 py3 %global _configure ../configure +%global _configure_disable_silent_rules 1 ( cd py2 && %configure --cache-file=../config.cache --with-python=%{__python2} ) ( cd py3 && %configure --cache-file=../config.cache --with-python=%{__python3} ) %make_build -C py2 From 83cd9dc6dedfb15dcda14102dd32dc92c0bad901 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:30:47 +0100 Subject: [PATCH 22/26] don't remove buildroot in %install Signed-off-by: Igor Gnatenko --- libxml2.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 74c680b..4461c28 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -103,8 +103,6 @@ mkdir py2 py3 %make_build -C py3 %install -rm -fr %{buildroot} - %make_install -C py2 %make_install -C py3 From 203f3720a75957d9bc014304e6f8aa53ec31df7d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:31:04 +0100 Subject: [PATCH 23/26] cleanup filelist Signed-off-by: Igor Gnatenko --- libxml2.spec | 59 +++++++++++++++++++++++----------------------------- 1 file changed, 26 insertions(+), 33 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 4461c28..4a69b2e 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -128,55 +128,48 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %files %license Copyright %doc AUTHORS NEWS README TODO -%doc %{_mandir}/man1/xmllint.1* -%doc %{_mandir}/man1/xmlcatalog.1* -%doc %{_mandir}/man3/libxml.3* - -%{_libdir}/lib*.so.* +%{_libdir}/libxml2.so.2* +%{_mandir}/man3/libxml.3* %{_bindir}/xmllint +%{_mandir}/man1/xmllint.1* %{_bindir}/xmlcatalog +%{_mandir}/man1/xmlcatalog.1* %files devel -%doc %{_mandir}/man1/xml2-config.1* -%doc AUTHORS NEWS README Copyright %doc doc/*.html doc/html doc/*.gif doc/*.png %doc doc/tutorial doc/libxml2-api.xml.gz %doc doc/examples -%doc %dir %{_datadir}/gtk-doc/html/libxml2 -%doc %{_datadir}/gtk-doc/html/libxml2/*.devhelp -%doc %{_datadir}/gtk-doc/html/libxml2/*.html -%doc %{_datadir}/gtk-doc/html/libxml2/*.png -%doc %{_datadir}/gtk-doc/html/libxml2/*.css - -%{_libdir}/lib*.so -%{_libdir}/*.sh -%{_includedir}/* +%dir %{_datadir}/gtk-doc +%dir %{_datadir}/gtk-doc/html +%{_datadir}/gtk-doc/html/libxml2/ +%{_libdir}/libxml2.so +%{_libdir}/xml2Conf.sh +%{_includedir}/libxml2/ %{_bindir}/xml2-config +%{_mandir}/man1/xml2-config.1* %{_datadir}/aclocal/libxml.m4 %{_libdir}/pkgconfig/libxml-2.0.pc -%{_libdir}/cmake/libxml2/libxml2-config.cmake +%{_libdir}/cmake/libxml2/ %files static -%{_libdir}/*a +%license Copyright +%{_libdir}/libxml2.a %files -n python2-%{name} -%{_libdir}/python2*/site-packages/libxml2.py* -%{_libdir}/python2*/site-packages/drv_libxml2.py* -%{_libdir}/python2*/site-packages/libxml2mod* -%doc python/TODO -%doc python/libxml2class.txt -%doc doc/*.py -%doc doc/python.html +%doc python/TODO python/libxml2class.txt +%doc doc/*.py doc/python.html +%{python2_sitearch}/libxml2.py* +%{python2_sitearch}/drv_libxml2.py* +%{python2_sitearch}/libxml2mod.so %files -n python3-%{name} -%{_libdir}/python3*/site-packages/libxml2.py* -%{_libdir}/python3*/site-packages/drv_libxml2.py* -%{_libdir}/python3*/site-packages/__pycache__/*py* -%{_libdir}/python3*/site-packages/libxml2mod* -%doc python/TODO -%doc python/libxml2class.txt -%doc py3doc/*.py -%doc doc/python.html +%doc python/TODO python/libxml2class.txt +%doc doc/*.py doc/python.html +%{python3_sitearch}/libxml2.py +%{python3_sitearch}/__pycache__/libxml2.* +%{python3_sitearch}/drv_libxml2.py +%{python3_sitearch}/__pycache__/drv_libxml2.* +%{python3_sitearch}/libxml2mod.so %changelog * Tue Jan 09 2018 Iryna Shcherbina - 2.9.5-3 From 3d86e10029f182b48678aaac88d71ca94a417895 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:40:17 +0100 Subject: [PATCH 24/26] further cleanups Signed-off-by: Igor Gnatenko --- libxml2.spec | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libxml2.spec b/libxml2.spec index 4a69b2e..4fd3979 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -109,11 +109,8 @@ mkdir py2 py3 # multiarch crazyness on timestamp differences or Makefile/binaries for examples touch -m --reference=%{buildroot}%{_includedir}/libxml2/libxml/parser.h %{buildroot}%{_bindir}/xml2-config -rm -f %{buildroot}%{_libdir}/*.la -rm -f %{buildroot}%{_libdir}/python*/site-packages/*.a -rm -f %{buildroot}%{_libdir}/python*/site-packages/*.la -rm -rf %{buildroot}%{_datadir}/doc/libxml2-%{version}/* -rm -rf %{buildroot}%{_datadir}/doc/libxml2-python-%{version}/* +find %{buildroot} -type f -name '*.a' -o -name '*.la' -print -delete +rm -vrf %{buildroot}%{_datadir}/doc/ #(cd doc/examples ; make clean ; rm -rf .deps Makefile) gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz From ebf18892c23fc8df213b3969145c5f07cfde177f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= Date: Wed, 24 Jan 2018 07:43:52 +0100 Subject: [PATCH 25/26] add patch for CVE-2016-9597 Signed-off-by: Igor Gnatenko --- libxml2-CVE-2016-9597.patch | 191 ++++++++++++++++++++++++++++++++++++ libxml2.spec | 2 + 2 files changed, 193 insertions(+) create mode 100644 libxml2-CVE-2016-9597.patch diff --git a/libxml2-CVE-2016-9597.patch b/libxml2-CVE-2016-9597.patch new file mode 100644 index 0000000..43f0243 --- /dev/null +++ b/libxml2-CVE-2016-9597.patch @@ -0,0 +1,191 @@ +Make the XML entity recursion check more precise. + +libxml doesn't detect entity recursion specifically but has a variety +of related checks, such as entities not expanding too deeply or +producing exponential blow-ups in content. + +Because entity declarations are parsed in a separate context with +their own element recursion budget, a recursive entity can overflow +the stack using a lot of open elements (but within the per-context +limit) as it slowly consumes (but does not exhaust) the entity depth +budget. + +This adds a specific, precise check for recursive entities that +detects entity recursion specifically and fails immediately. + +The existing entity expansion depth checks are still relevant for long +chains of different entities. + +BUG=628581 + +Review-Url: https://codereview.chromium.org/2539003002 +Cr-Commit-Position: refs/heads/master@{#436899} + + +Index: libxml2-2.9.4/entities.c +=================================================================== +--- libxml2-2.9.4.orig/entities.c ++++ libxml2-2.9.4/entities.c +@@ -159,6 +159,7 @@ xmlCreateEntity(xmlDictPtr dict, const x + memset(ret, 0, sizeof(xmlEntity)); + ret->type = XML_ENTITY_DECL; + ret->checked = 0; ++ ret->guard = XML_ENTITY_NOT_BEING_CHECKED; + + /* + * fill the structure. +@@ -931,6 +932,7 @@ xmlCopyEntity(xmlEntityPtr ent) { + cur->orig = xmlStrdup(ent->orig); + if (ent->URI != NULL) + cur->URI = xmlStrdup(ent->URI); ++ cur->guard = 0; + return(cur); + } + +Index: libxml2-2.9.4/include/libxml/entities.h +=================================================================== +--- libxml2-2.9.4.orig/include/libxml/entities.h ++++ libxml2-2.9.4/include/libxml/entities.h +@@ -30,6 +30,11 @@ typedef enum { + XML_INTERNAL_PREDEFINED_ENTITY = 6 + } xmlEntityType; + ++typedef enum { ++ XML_ENTITY_NOT_BEING_CHECKED, ++ XML_ENTITY_BEING_CHECKED /* entity check is in progress */ ++} xmlEntityRecursionGuard; ++ + /* + * An unit of storage for an entity, contains the string, the value + * and the linkind data needed for the linking in the hash table. +@@ -60,6 +65,7 @@ struct _xmlEntity { + /* this is also used to count entities + * references done from that entity + * and if it contains '<' */ ++ xmlEntityRecursionGuard guard; + }; + + /* +Index: libxml2-2.9.4/parser.c +=================================================================== +--- libxml2-2.9.4.orig/parser.c ++++ libxml2-2.9.4/parser.c +@@ -133,6 +133,10 @@ xmlParserEntityCheck(xmlParserCtxtPtr ct + if (ctxt->lastError.code == XML_ERR_ENTITY_LOOP) + return (1); + ++ if ((ent != NULL) && (ent->guard == XML_ENTITY_BEING_CHECKED)) { ++ xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); ++ return (1); ++ } + /* + * This may look absurd but is needed to detect + * entities problems +@@ -143,12 +147,14 @@ xmlParserEntityCheck(xmlParserCtxtPtr ct + unsigned long oldnbent = ctxt->nbentities; + xmlChar *rep; + ++ ent->guard = XML_ENTITY_BEING_CHECKED; + ent->checked = 1; + + ++ctxt->depth; + rep = xmlStringDecodeEntities(ctxt, ent->content, + XML_SUBSTITUTE_REF, 0, 0, 0); + --ctxt->depth; ++ ent->guard = XML_ENTITY_NOT_BEING_CHECKED; + if (ctxt->errNo == XML_ERR_ENTITY_LOOP) { + ent->content[0] = 0; + } +@@ -7337,23 +7343,28 @@ xmlParseReference(xmlParserCtxtPtr ctxt) + * if its replacement text matches the production labeled + * content. + */ +- if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) { +- ctxt->depth++; +- ret = xmlParseBalancedChunkMemoryInternal(ctxt, ent->content, +- user_data, &list); +- ctxt->depth--; +- +- } else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) { +- ctxt->depth++; +- ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, ctxt->sax, +- user_data, ctxt->depth, ent->URI, +- ent->ExternalID, &list); +- ctxt->depth--; +- } else { +- ret = XML_ERR_ENTITY_PE_INTERNAL; +- xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, +- "invalid entity type found\n", NULL); +- } ++ if (ent->guard == XML_ENTITY_BEING_CHECKED) { ++ ret = XML_ERR_ENTITY_LOOP; ++ } else { ++ ent->guard = XML_ENTITY_BEING_CHECKED; ++ if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) { ++ ctxt->depth++; ++ ret = xmlParseBalancedChunkMemoryInternal(ctxt, ent->content, ++ user_data, &list); ++ ctxt->depth--; ++ } else if (ent->etype == XML_EXTERNAL_GENERAL_PARSED_ENTITY) { ++ ctxt->depth++; ++ ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, ctxt->sax, ++ user_data, ctxt->depth, ent->URI, ++ ent->ExternalID, &list); ++ ctxt->depth--; ++ } else { ++ ret = XML_ERR_ENTITY_PE_INTERNAL; ++ xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, ++ "invalid entity type found\n", NULL); ++ } ++ ent->guard = XML_ENTITY_NOT_BEING_CHECKED; ++ } + + /* + * Store the number of entities needing parsing for this entity +@@ -7456,23 +7467,29 @@ xmlParseReference(xmlParserCtxtPtr ctxt) + else + user_data = ctxt->userData; + +- if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) { +- ctxt->depth++; +- ret = xmlParseBalancedChunkMemoryInternal(ctxt, +- ent->content, user_data, NULL); +- ctxt->depth--; +- } else if (ent->etype == +- XML_EXTERNAL_GENERAL_PARSED_ENTITY) { +- ctxt->depth++; +- ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, +- ctxt->sax, user_data, ctxt->depth, +- ent->URI, ent->ExternalID, NULL); +- ctxt->depth--; +- } else { +- ret = XML_ERR_ENTITY_PE_INTERNAL; +- xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, +- "invalid entity type found\n", NULL); +- } ++ if (ent->guard == XML_ENTITY_BEING_CHECKED) { ++ ret = XML_ERR_ENTITY_LOOP; ++ } else { ++ ent->guard = XML_ENTITY_BEING_CHECKED; ++ if (ent->etype == XML_INTERNAL_GENERAL_ENTITY) { ++ ctxt->depth++; ++ ret = xmlParseBalancedChunkMemoryInternal(ctxt, ++ ent->content, user_data, NULL); ++ ctxt->depth--; ++ } else if (ent->etype == ++ XML_EXTERNAL_GENERAL_PARSED_ENTITY) { ++ ctxt->depth++; ++ ret = xmlParseExternalEntityPrivate(ctxt->myDoc, ctxt, ++ ctxt->sax, user_data, ctxt->depth, ++ ent->URI, ent->ExternalID, NULL); ++ ctxt->depth--; ++ } else { ++ ret = XML_ERR_ENTITY_PE_INTERNAL; ++ xmlErrMsgStr(ctxt, XML_ERR_INTERNAL_ERROR, ++ "invalid entity type found\n", NULL); ++ } ++ ent->guard = XML_ENTITY_NOT_BEING_CHECKED; ++ } + if (ret == XML_ERR_ENTITY_LOOP) { + xmlFatalErr(ctxt, XML_ERR_ENTITY_LOOP, NULL); + return; diff --git a/libxml2.spec b/libxml2.spec index 4fd3979..a3e1a27 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -12,6 +12,8 @@ Patch1: libxml2-2.9.0-do-not-check-crc.patch # In python3.6 _PyVerify_fd is no more # http://bugs.python.org/issue23524 Patch2: libxml2-2.9.4-remove-pyverify_fd.patch +# https://codereview.chromium.org/2539003002 +Patch3: libxml2-CVE-2016-9597.patch BuildRequires: gcc BuildRequires: cmake-rpm-macros From 83b0a3e530379b1ad59fc0d455a911b471ce0be5 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 24 Jan 2018 07:44:56 +0100 Subject: [PATCH 26/26] add %changelog entry Signed-off-by: Igor Gnatenko --- libxml2.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libxml2.spec b/libxml2.spec index a3e1a27..3740918 100644 --- a/libxml2.spec +++ b/libxml2.spec @@ -171,6 +171,10 @@ gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz %{python3_sitearch}/libxml2mod.so %changelog +* Wed Jan 24 2018 Igor Gnatenko - 2.9.7-1 +- Update to 2.9.7 +- Cleanups in packaging + * Tue Jan 09 2018 Iryna Shcherbina - 2.9.5-3 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)