RHEL: Import from Fedora

This commit is contained in:
Tomáš Hrnčiar 2025-09-01 14:40:03 +02:00 committed by Lumir Balhar
parent 12bd2ff893
commit 356aaa51a4
10 changed files with 1868 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

74
.gitignore vendored
View File

@ -0,0 +1,74 @@
lxml-2.2.7.tar.gz
lxml-2.2.7.tar.gz.asc
/lxml-2.2.8.tar.gz
/lxml-2.2.8.tar.gz.asc
/lxml-2.3.tar.gz
/lxml-2.3.tar.gz.asc
/lxml-2.3.1.tar.gz
/lxml-2.3.1.tar.gz.asc
/lxml-2.3.2.tar.gz
/lxml-2.3.2.tar.gz.asc
/lxml-2.3.3.tar.gz
/lxml-2.3.3.tar.gz.asc
/lxml-2.3.5.tar.gz
/lxml-2.3.5.tar.gz.asc
/lxml-3.0.tar.gz
/lxml-3.0.tar.gz.asc
/lxml-3.0.tgz
/lxml-3.0.tgz.asc
/lxml-3.0.1.tgz
/lxml-3.0.1.tgz.asc
/lxml-3.1.0.tgz
/lxml-3.1.0.tgz.asc
/lxml-3.2.0.tgz
/lxml-3.2.0.tgz.asc
/lxml-3.2.1.tgz
/lxml-3.2.1.tgz.asc
/lxml-3.2.3.tgz
/lxml-3.2.3.tgz.asc
/lxml-3.2.4.tgz
/lxml-3.2.4.tgz.asc
/lxml-3.3.0.tgz
/lxml-3.3.0.tgz.asc
/lxml-3.3.2.tgz
/lxml-3.3.2.tgz.asc
/lxml-3.3.3.tgz
/lxml-3.3.3.tgz.asc
/lxml-3.3.5.tgz
/lxml-3.3.5.tgz.asc
/lxml-3.3.6.tgz
/lxml-3.3.6.tgz.asc
/lxml-3.4.4.tgz
/lxml-3.4.4.tgz.asc
/lxml-3.6.4.tar.gz
/lxml-3.7.0.tar.gz
/lxml-3.7.1.tgz
/lxml-3.7.2.tgz
/lxml-3.8.0.tgz
/lxml-4.0.0.tgz
/lxml-4.1.1.tgz
/lxml-4.2.1.tgz
/lxml-4.2.3.tgz
/lxml-4.2.4.tgz
/lxml-4.2.5.tgz
/lxml-4.4.0.tgz
/lxml-4.4.1.tgz
/lxml-4.5.1.tgz
/lxml-4.6.2.tar.gz
/lxml-4.6.3.tar.gz
/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
/lxml-4.9.2-no-isoschematron-rng.tar.gz
/lxml-4.9.3-no-isoschematron-rng.tar.gz
/lxml-4.9.4-no-isoschematron-rng.tar.gz
/lxml-5.1.0-no-isoschematron-rng.tar.gz
/lxml-5.2.0-no-isoschematron-rng.tar.gz
/lxml-5.2.1-no-isoschematron-rng.tar.gz
/lxml-5.3.0-no-isoschematron-rng.tar.gz
/lxml-5.3.1-no-isoschematron-rng.tar.gz
/lxml-5.3.2-no-isoschematron-rng.tar.gz
/lxml-5.4.0-no-isoschematron-rng.tar.gz
/lxml-6.0.0-no-isoschematron-rng.tar.gz
/lxml-6.0.1-no-isoschematron-rng.tar.gz

1642
changelog Normal file

File diff suppressed because it is too large Load Diff

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

8
gating.yaml Normal file
View File

@ -0,0 +1,8 @@
--- !Policy
product_versions:
- fedora-*
decision_contexts:
- bodhi_update_push_testing
- bodhi_update_push_stable
rules:
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build./plans/smoke.functional}

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

@ -0,0 +1,28 @@
#! /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-rng.tar.gz
if [ ! -e ${orig_archive} ]; then
wget -N https://files.pythonhosted.org/packages/source/l/lxml/${orig_archive}
fi
deleted_directory=lxml-${version}/src/lxml/isoschematron/resources/rng
# 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_directory}
gzip -cf ${orig_archive//.gz} > ${new_archive}

View File

@ -0,0 +1,7 @@
import lxml.etree as et
s = '<foo><bar baz="xyzzy">a<![CDATA[b]]>c</bar></foo>'
x = et.fromstring(s)
t = x.find('bar').text
print(t)
if t != 'abc':
raise Exception()

12
plans/smoke.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Basic smoke test
discover:
how: shell
tests:
- name: /smoke/import-python-module
test: |
python3 -c 'import importlib as il; print(il.import_module("lxml"))'
- name: /smoke/etree-fromstring
test: |
python3 plans/etree-fromstring.py
execute:
how: tmt

94
python-lxml.spec Normal file
View File

@ -0,0 +1,94 @@
Name: python-lxml
Version: 6.0.1
Release: %autorelease
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
URL: https://github.com/lxml/lxml
# We use the get-lxml-source.sh script to generate the tarball
# without the isoschematron RNG validation file under a problematic license.
# See: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/154
Source0: lxml-%{version}-no-isoschematron-rng.tar.gz
Source1: get-lxml-source.sh
BuildRequires: gcc
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: python3-devel
# Some of the extras create a build dependency loop.
# - [cssselect] Requires cssselect BuildRequires lxml
# - [html5] Requires html5lib BuildRequires lxml
# - [htmlsoup] Requires beautifulsoup4 Requires lxml
# - [html_clean] Requires lxml-html-clean Requires lxml
# Hence we provide a bcond to disable the extras altogether.
# By default, the extras are disabled in RHEL, to avoid dependencies.
%bcond extras %{undefined rhel}
%global _description \
lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It\
provides safe and convenient access to these libraries using the ElementTree It\
extends the ElementTree API significantly to offer support for XPath, RelaxNG,\
XML Schema, XSLT, C14N and much more.
%description %{_description}
%package -n python3-lxml
Summary: %{summary}
%if %{with extras}
Suggests: python3-lxml+cssselect
Suggests: python3-lxml+html5
Suggests: python3-lxml+htmlsoup
Suggests: python3-lxml+html_clean
%endif
%description -n python3-lxml %{_description}
Python 3 version.
%if %{with extras}
%pyproject_extras_subpkg -n python3-lxml cssselect html5 htmlsoup html_clean
%endif
%prep
%autosetup -n lxml-%{version} -p1
# Don't run html5lib tests --without extras
%{!?without_extras:rm src/lxml/html/tests/test_html5parser.py}
# Remove limit for version of Cython
sed -i "s/Cython.*/Cython/" requirements.txt
sed -i 's/"Cython.*",/"Cython",/' pyproject.toml
%generate_buildrequires
%pyproject_buildrequires -x source%{?with_extras:,cssselect,html5,htmlsoup,html_clean}
%build
# Remove pregenerated Cython C sources
# We need to do this after %%pyproject_buildrequires because setup.py errors
# without Cython and without the .c files.
find -type f -name '*.c' -print -delete >&2
export WITH_CYTHON=true
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files lxml
%check
# 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}-*/* src/
# The options are: verbose, unit, functional
%{python3} test.py -vuf
%files -n python3-lxml -f %{pyproject_files}
%license doc/licenses/BSD.txt doc/licenses/elementtree.txt
%doc README.rst
%changelog
%autochangelog

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (lxml-6.0.1-no-isoschematron-rng.tar.gz) = e503880792636b01755b1d7aad29ee29fe9af77a295811050b763162a79fa54a08d5a73ced1de9fec6e93696bcb75e6050034696bb4daba3f9a5ed1695359937