Blame SPECS/python3.11-lxml.spec

4bf35c
%global __python3 /usr/bin/python3.11
4bf35c
%global python3_pkgversion 3.11
4bf35c
4bf35c
Name:           python%{python3_pkgversion}-lxml
4bf35c
Version:        4.9.2
4bf35c
Release:        3%{?dist}
4bf35c
Summary:        XML processing library combining libxml2/libxslt with the ElementTree API
4bf35c
4bf35c
# The lxml project is licensed under BSD-3-Clause
4bf35c
# Some code is derived from ElementTree and cElementTree
4bf35c
# thus using the MIT-CMU elementtree license
4bf35c
# .xsl schematron files are under the MIT license
4bf35c
License:        BSD and MIT
4bf35c
URL:            https://github.com/lxml/lxml
4bf35c
# We use the get-lxml-source.sh script to generate the tarball
4bf35c
# without the isoschematron submodule as it contains a problematic
4bf35c
# license.
4bf35c
# See: https://gitlab.com/fedora/legal/fedora-license-data/-/issues/154
4bf35c
Source0:         lxml-%{version}-no-isoschematron.tar.gz
4bf35c
Source1:         get-lxml-source.sh
4bf35c
4bf35c
BuildRequires:  gcc
4bf35c
BuildRequires:  libxml2-devel
4bf35c
BuildRequires:  libxslt-devel
4bf35c
4bf35c
BuildRequires:  python%{python3_pkgversion}-devel
4bf35c
BuildRequires:  python%{python3_pkgversion}-rpm-macros
4bf35c
BuildRequires:  python%{python3_pkgversion}-setuptools
4bf35c
BuildRequires:  python%{python3_pkgversion}-Cython
4bf35c
4bf35c
%global _description \
4bf35c
lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It\
4bf35c
provides safe and convenient access to these libraries using the ElementTree It\
4bf35c
extends the ElementTree API significantly to offer support for XPath, RelaxNG,\
4bf35c
XML Schema, XSLT, C14N and much more.
4bf35c
4bf35c
%description %{_description}
4bf35c
4bf35c
%prep
4bf35c
%autosetup -n lxml-%{version} -p1
4bf35c
4bf35c
# Remove isoschematron module due to problematic license
4bf35c
sed -i "s/, 'lxml.isoschematron'//" setup.py
4bf35c
# Remove the doctests for it (the documentation is not shipped)
4bf35c
# The command [d]eletes all lines from the first pattern to the second
4bf35c
sed -Ei '/^Schematron$/,/^\(Pre-ISO-Schematron\)$/d' doc/validation.txt
4bf35c
4bf35c
# Remove pregenerated Cython C sources
4bf35c
# We need to do this after %%pyproject_buildrequires because setup.py errors
4bf35c
# without Cython and without the .c files.
4bf35c
find -type f -name '*.c' -print -delete >&2
4bf35c
4bf35c
%build
4bf35c
env WITH_CYTHON=true %py3_build
4bf35c
4bf35c
%install
4bf35c
%py3_install
4bf35c
4bf35c
%check
4bf35c
# The tests assume inplace build, so we copy the built library to source-dir.
4bf35c
# If not done that, Python can either import the tests or the extension modules, but not both.
4bf35c
cp -a build/lib.%{python3_platform}-*/* src/
4bf35c
# The options are: verbose, unit, functional
4bf35c
%{python3} test.py -vuf
4bf35c
4bf35c
%files -n python%{python3_pkgversion}-lxml
4bf35c
%license doc/licenses/BSD.txt doc/licenses/elementtree.txt
4bf35c
%doc README.rst
4bf35c
%{python3_sitearch}/lxml/
4bf35c
%{python3_sitearch}/lxml-*.egg-info/
4bf35c
4bf35c
%changelog
4bf35c
* Thu Feb 16 2023 Charalampos Stratakis <cstratak@redhat.com> - 4.9.2-3
4bf35c
- Remove the isoschematron submodule
4bf35c
4bf35c
* Fri Feb 10 2023 Charalampos Stratakis <cstratak@redhat.com> - 4.9.2-2
4bf35c
- Bump release
4bf35c
4bf35c
* Mon Nov 14 2022 Charalampos Stratakis <cstratak@redhat.com> - 4.9.2-1
4bf35c
- Initial package
4bf35c
- Fedora contributions by:
4bf35c
      Alexander Todorov <atodorov@redhat.com>
4bf35c
      Bill Nottingham <notting@fedoraproject.org>
4bf35c
      Charalampos Stratakis <cstratak@redhat.com>
4bf35c
      Dan Horák <dan@danny.cz>
4bf35c
      David Malcolm <dmalcolm@redhat.com>
4bf35c
      Dennis Gilmore <dennis@ausil.us>
4bf35c
      Fabio Alessandro Locati <fale@redhat.com>
4bf35c
      Igor Raits <ignatenkobrain@fedoraproject.org>
4bf35c
      Jason ティビツ <tibbs@fedoraproject.org>
4bf35c
      Jeffrey C. Ollie <jcollie@fedoraproject.org>
4bf35c
      Jesse Keating <jkeating@fedoraproject.org>
4bf35c
      Kevin Fenzi <kevin@scrye.com>
4bf35c
      Lumir Balhar <lbalhar@redhat.com>
4bf35c
      Mikolaj Izdebski <mizdebsk@redhat.com>
4bf35c
      Miro Hrončok <miro@hroncok.cz>
4bf35c
      Peter Robinson <pbrobinson@gmail.com>
4bf35c
      Robert Kuska <rkuska@redhat.com>
4bf35c
      Shahms King <shahms@fedoraproject.org>
4bf35c
      Slavek Kabrda <bkabrda@redhat.com>
4bf35c
      tomspur <tomspur@fedoraproject.org>
4bf35c
      Ville Skyttä <scop@fedoraproject.org>