From 7f6d5f61df3d053b7cc392f03b12f059fb97a4a3 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Thu, 16 Feb 2023 05:24:25 +0100 Subject: [PATCH] Remove the isoschematron submodule Resolves: rhbz#2157708 --- .gitignore | 1 + get-lxml-source.sh | 29 +++++++++++++++++++++++++++++ python3.11-lxml.spec | 20 +++++++++++++++++--- sources | 2 +- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100755 get-lxml-source.sh diff --git a/.gitignore b/.gitignore index f3c0026..d2660f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /lxml-4.9.1.tar.gz /lxml-4.9.2.tar.gz +/lxml-4.9.2-no-isoschematron.tar.gz diff --git a/get-lxml-source.sh b/get-lxml-source.sh new file mode 100755 index 0000000..9d79f3a --- /dev/null +++ b/get-lxml-source.sh @@ -0,0 +1,29 @@ +#! /bin/bash -ex + +# Download a release of lxml (if missing) and remove the isoschematron module from it + +version=$1 + +if [ -z "${version}" ]; then + echo "Usage: $0 VERSION" >& 2 + echo "" >& 2 + echo "example: $0 4.9.2" >& 2 + exit 1 +fi + +versionedname=lxml-${version} +orig_archive=${versionedname}.tar.gz +new_archive=${versionedname}-no-isoschematron.tar.gz + +if [ ! -e ${orig_archive} ]; then + wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive} +fi + +deleted_module=lxml-${version}/src/lxml/isoschematron/ +deleted_test=lxml-${version}/src/lxml/tests/test_isoschematron.py + +# tar --delete does not operate on compressed archives, so do +# gz decompression explicitly +gzip --decompress ${orig_archive} +tar -v --delete -f ${orig_archive//.gz} {$deleted_module,$deleted_test} +gzip -cf ${orig_archive//.gz} > ${new_archive} diff --git a/python3.11-lxml.spec b/python3.11-lxml.spec index 2fc2154..e3d2ccc 100644 --- a/python3.11-lxml.spec +++ b/python3.11-lxml.spec @@ -3,7 +3,7 @@ Name: python%{python3_pkgversion}-lxml Version: 4.9.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: XML processing library combining libxml2/libxslt with the ElementTree API # The lxml project is licensed under BSD-3-Clause @@ -12,7 +12,12 @@ Summary: XML processing library combining libxml2/libxslt with the Elemen # .xsl schematron files are under the MIT license License: BSD and MIT URL: https://github.com/lxml/lxml -Source: %{pypi_source lxml} +# We use the get-lxml-source.sh script to generate the tarball +# without the isoschematron submodule as it contains a problematic +# license. +# See: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/154 +Source0: lxml-%{version}-no-isoschematron.tar.gz +Source1: get-lxml-source.sh BuildRequires: gcc BuildRequires: libxml2-devel @@ -34,6 +39,12 @@ XML Schema, XSLT, C14N and much more. %prep %autosetup -n lxml-%{version} -p1 +# Remove isoschematron module due to problematic license +sed -i "s/, 'lxml.isoschematron'//" setup.py +# Remove the doctests for it (the documentation is not shipped) +# The command [d]eletes all lines from the first pattern to the second +sed -Ei '/^Schematron$/,/^\(Pre-ISO-Schematron\)$/d' doc/validation.txt + # Remove pregenerated Cython C sources # We need to do this after %%pyproject_buildrequires because setup.py errors # without Cython and without the .c files. @@ -54,11 +65,14 @@ cp -a build/lib.%{python3_platform}-*/* src/ %files -n python%{python3_pkgversion}-lxml %license doc/licenses/BSD.txt doc/licenses/elementtree.txt -%doc README.rst src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +%doc README.rst %{python3_sitearch}/lxml/ %{python3_sitearch}/lxml-*.egg-info/ %changelog +* Thu Feb 16 2023 Charalampos Stratakis - 4.9.2-3 +- Remove the isoschematron submodule + * Fri Feb 10 2023 Charalampos Stratakis - 4.9.2-2 - Remove the extras subpackages diff --git a/sources b/sources index ff93acf..2599e86 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (lxml-4.9.2.tar.gz) = 4597784c96219145fef30607f257097ad312264a6796e65b3dc74463853cd29f55379b6a903b401c1120750126b57f58dd9fc459dd453e57030883fc76b87ea3 +SHA512 (lxml-4.9.2-no-isoschematron.tar.gz) = 3ee80967dfa69c840a27ad99546727346f8bb058ed64bf93d2aa8959fb3000e78c1227f4b8709d25aaadeb9a4ccdf97a03eb53a1171de8feda93fbeaa15a8b39