From 60154772b479f435e0a24e4ebb9acec0960440d3 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 3 Jun 2021 20:16:31 +0200 Subject: [PATCH 1/3] Update the license information --- python-lxml.spec | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/python-lxml.spec b/python-lxml.spec index c799720..9e72f5d 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -2,10 +2,14 @@ Name: python-%{modname} Version: 4.6.3 -Release: 1%{?dist} +Release: 2%{?dist} Summary: XML processing library combining libxml2/libxslt with the ElementTree API -License: BSD +# The lxml project is licensed under BSD +# Some code is derived from ElementTree and cElementTree +# thus using the MIT-like elementtree license +# .xsl schematron files are under the MIT and zlib license +License: BSD and MIT and zlib URL: https://github.com/lxml/lxml Source0: %{pypi_source %{modname}} @@ -51,12 +55,15 @@ env WITH_CYTHON=true %py3_build %{__python3} setup.py test %files -n python3-%{modname} -%license doc/licenses/ZopePublicLicense.txt LICENSES.txt +%license LICENSES.txt doc/licenses/BSD.txt doc/licenses/elementtree.txt %doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt %{python3_sitearch}/%{modname}/ %{python3_sitearch}/%{modname}-*.egg-info/ %changelog +* Thu Jun 03 2021 Charalampos Stratakis - 4.6.3-2 +- Update the license information + * Thu May 20 2021 Charalampos Stratakis - 4.6.3-1 - Update to 4.6.3 - Fixes CVE-2021-28957 From 907f41ea4979449c7c3d3599e8cd1caa6c1974c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 26 Nov 2021 16:22:16 +0100 Subject: [PATCH 2/3] Actually run the tests during build Fixes https://bugzilla.redhat.com/2026941 --- 852ed1092b.patch | 25 +++++++++++++++++++++++++ python-lxml.spec | 15 +++++++++++++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 852ed1092b.patch diff --git a/852ed1092b.patch b/852ed1092b.patch new file mode 100644 index 0000000..26778f6 --- /dev/null +++ b/852ed1092b.patch @@ -0,0 +1,25 @@ +From 852ed1092bd80b6b9a51db24371047ec88843031 Mon Sep 17 00:00:00 2001 +From: Stefan Behnel +Date: Tue, 18 May 2021 22:02:02 +0200 +Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+. + +--- + src/lxml/tests/test_etree.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py +index 9cf70604b..42613dcbe 100644 +--- a/src/lxml/tests/test_etree.py ++++ b/src/lxml/tests/test_etree.py +@@ -3036,7 +3036,10 @@ def test_subelement_nsmap(self): + def test_html_prefix_nsmap(self): + etree = self.etree + el = etree.HTML('aa').find('.//page-description') +- self.assertEqual({'hha': None}, el.nsmap) ++ if etree.LIBXML_VERSION < (2, 9, 11): ++ self.assertEqual({'hha': None}, el.nsmap) ++ else: ++ self.assertEqual({}, el.nsmap) + + def test_getchildren(self): + Element = self.etree.Element diff --git a/python-lxml.spec b/python-lxml.spec index 9e72f5d..6715850 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -2,7 +2,7 @@ Name: python-%{modname} Version: 4.6.3 -Release: 2%{?dist} +Release: 3%{?dist} Summary: XML processing library combining libxml2/libxslt with the ElementTree API # The lxml project is licensed under BSD @@ -13,6 +13,9 @@ License: BSD and MIT and zlib URL: https://github.com/lxml/lxml Source0: %{pypi_source %{modname}} +# Adapt a test to a behavioural change in libxml2 2.9.11+ +Patch1: %{url}/commit/852ed1092b.patch + BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel @@ -52,7 +55,11 @@ env WITH_CYTHON=true %py3_build %py3_install %check -%{__python3} setup.py test +# The tests assume inplace build, so we copy the built library to source-dir. +# If not done that, Python can either import the tests or the extension modules, but not both. +cp -a build/lib.%{python3_platform}-%{python3_version}/* src/ +# The options are: verbose, unit, functional +%{python3} test.py -vuf %files -n python3-%{modname} %license LICENSES.txt doc/licenses/BSD.txt doc/licenses/elementtree.txt @@ -61,6 +68,10 @@ env WITH_CYTHON=true %py3_build %{python3_sitearch}/%{modname}-*.egg-info/ %changelog +* Fri Nov 26 2021 Miro Hrončok - 4.6.3-3 +- Run the tests during build +- Resolves: rhbz#2026941 + * Thu Jun 03 2021 Charalampos Stratakis - 4.6.3-2 - Update the license information From 6a88b90732ace9f4e34c3cdcd6bbc16b2b297c56 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 6 Jan 2022 16:38:36 +0100 Subject: [PATCH 3/3] Update to 4.6.5 Fixes CVE-2021-43818 Resolves: rhbz#2032572 --- .gitignore | 1 + 852ed1092b.patch | 25 ------------------------- python-lxml.spec | 12 +++++++----- sources | 2 +- 4 files changed, 9 insertions(+), 31 deletions(-) delete mode 100644 852ed1092b.patch diff --git a/.gitignore b/.gitignore index b3ed277..6d7a295 100644 --- a/.gitignore +++ b/.gitignore @@ -56,3 +56,4 @@ lxml-2.2.7.tar.gz.asc /lxml-4.5.1.tgz /lxml-4.6.2.tar.gz /lxml-4.6.3.tar.gz +/lxml-4.6.5.tar.gz diff --git a/852ed1092b.patch b/852ed1092b.patch deleted file mode 100644 index 26778f6..0000000 --- a/852ed1092b.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 852ed1092bd80b6b9a51db24371047ec88843031 Mon Sep 17 00:00:00 2001 -From: Stefan Behnel -Date: Tue, 18 May 2021 22:02:02 +0200 -Subject: [PATCH] Adapt a test to a behavioural change in libxml2 2.9.11+. - ---- - src/lxml/tests/test_etree.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py -index 9cf70604b..42613dcbe 100644 ---- a/src/lxml/tests/test_etree.py -+++ b/src/lxml/tests/test_etree.py -@@ -3036,7 +3036,10 @@ def test_subelement_nsmap(self): - def test_html_prefix_nsmap(self): - etree = self.etree - el = etree.HTML('aa').find('.//page-description') -- self.assertEqual({'hha': None}, el.nsmap) -+ if etree.LIBXML_VERSION < (2, 9, 11): -+ self.assertEqual({'hha': None}, el.nsmap) -+ else: -+ self.assertEqual({}, el.nsmap) - - def test_getchildren(self): - Element = self.etree.Element diff --git a/python-lxml.spec b/python-lxml.spec index 6715850..af77ac4 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -1,8 +1,8 @@ %global modname lxml Name: python-%{modname} -Version: 4.6.3 -Release: 3%{?dist} +Version: 4.6.5 +Release: 1%{?dist} Summary: XML processing library combining libxml2/libxslt with the ElementTree API # The lxml project is licensed under BSD @@ -13,9 +13,6 @@ License: BSD and MIT and zlib URL: https://github.com/lxml/lxml Source0: %{pypi_source %{modname}} -# Adapt a test to a behavioural change in libxml2 2.9.11+ -Patch1: %{url}/commit/852ed1092b.patch - BuildRequires: gcc BuildRequires: libxml2-devel BuildRequires: libxslt-devel @@ -68,6 +65,11 @@ cp -a build/lib.%{python3_platform}-%{python3_version}/* src/ %{python3_sitearch}/%{modname}-*.egg-info/ %changelog +* Thu Jan 06 2022 Charalampos Stratakis - 4.6.5-1 +- Update to 4.6.5 +- Fixes CVE-2021-43818 +- Resolves: rhbz#2032572 + * Fri Nov 26 2021 Miro Hrončok - 4.6.3-3 - Run the tests during build - Resolves: rhbz#2026941 diff --git a/sources b/sources index 6844eb7..28ad44f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (lxml-4.6.3.tar.gz) = 57489c42257afd00376886d6873c97088778afa8009fa644e2660722d134f346030218c24be6329ee828f73f5164cdd1dad583c17addbdf3e0c84e4d8ab9e176 +SHA512 (lxml-4.6.5.tar.gz) = b9d2398b7c50539add66a82635fc869694d0a9facf17fc0f4182f2449f6a226e19007b48036f954637651e3319d2f877f38d667bcd414a6c6b72850b710a306b