diff --git a/.gitignore b/.gitignore index 8ae519b..d44f10e 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,4 @@ lxml-2.2.7.tar.gz.asc /lxml-4.7.1.tar.gz /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/python-lxml.spec b/python-lxml.spec index 7e618b2..686452b 100644 --- a/python-lxml.spec +++ b/python-lxml.spec @@ -1,15 +1,20 @@ Name: python-lxml Version: 4.9.2 -Release: 4%{?dist} +Release: 5%{?dist} Summary: XML processing library combining libxml2/libxslt with the ElementTree API # The lxml project is licensed under BSD-3-Clause # Some code is derived from ElementTree and cElementTree # thus using the MIT-CMU elementtree license -# .xsl schematron files are under the MIT license -License: BSD-3-Clause AND MIT-CMU AND MIT +License: BSD-3-Clause AND MIT-CMU 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 # Upstream issue: https://bugs.launchpad.net/lxml/+bug/2016939 Patch: Skip-failing-test-test_html_prefix_nsmap.patch @@ -53,6 +58,11 @@ Python 3 version. %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 %generate_buildrequires %pyproject_buildrequires -x source%{?with_extras:,cssselect,html5,htmlsoup} @@ -78,9 +88,12 @@ cp -a build/lib.%{python3_platform}-*/* src/ %files -n python3-lxml -f %{pyproject_files} %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 %changelog +* Wed May 31 2023 Miro HronĨok - 4.9.2-5 +- Remove the isoschematron submodule + * Tue May 30 2023 Yaakov Selkowitz - 4.9.2-4 - Disable extra subpackages in RHEL builds 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