Blame SPECS/python3.11-lxml.spec

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