Remove the isoschematron submodule

See https://gitlab.com/fedora/legal/fedora-license-data/-/issues/154

Cherry-picked from 7f6d5f61df

Co-Authored-By: Charalampos Stratakis <cstratak@redhat.com>
This commit is contained in:
Miro Hrončok 2023-04-07 13:33:26 +02:00 committed by churchyard
parent af2ab59687
commit 9d95f5a04e
4 changed files with 49 additions and 6 deletions

1
.gitignore vendored
View File

@ -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

29
get-lxml-source.sh Executable file
View File

@ -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}

View File

@ -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 <mhroncok@redhat.com> - 4.9.2-5
- Remove the isoschematron submodule
* Tue May 30 2023 Yaakov Selkowitz <yselkowi@redhat.com> - 4.9.2-4
- Disable extra subpackages in RHEL builds

View File

@ -1 +1 @@
SHA512 (lxml-4.9.2.tar.gz) = 4597784c96219145fef30607f257097ad312264a6796e65b3dc74463853cd29f55379b6a903b401c1120750126b57f58dd9fc459dd453e57030883fc76b87ea3
SHA512 (lxml-4.9.2-no-isoschematron.tar.gz) = 3ee80967dfa69c840a27ad99546727346f8bb058ed64bf93d2aa8959fb3000e78c1227f4b8709d25aaadeb9a4ccdf97a03eb53a1171de8feda93fbeaa15a8b39