59f4a81
Summary:        Python package with an object-oriented approach to text processing
a3002fe
Name:           pyparsing
ab78d78
Version:        3.1.2
8a92544
Release:        %autorelease
c2627a1
b313099
# SPDX
5f051aa
License:        MIT
a077473
URL:            https://github.com/pyparsing/pyparsing
ab78d78
Source0:        https://github.com/%{name}/%{name}/archive/%{name}_%{version}/%{name}-%{version}.tar.gz
5f051aa
BuildArch:      noarch
05d7628
BuildRequires:  dos2unix
7aa63dd
7aa63dd
# python3 bootstrap: this is built before the final build of python3, which
7aa63dd
# adds the dependency on python3-rpm-generators, so we require it manually
7aa63dd
# (python BuildRequires systemtap-sdt-devel which requires python3-pyparsing)
7aa63dd
BuildRequires:  python3-rpm-generators
7aa63dd
# We need those for the same reason:
7aa63dd
%bcond doc      1
7aa63dd
%bcond tests    1
7aa63dd
72af38d
BuildRequires:  python%{python3_pkgversion}-devel
7aa63dd
7aa63dd
%if %{with doc}
72af38d
BuildRequires:  python%{python3_pkgversion}-sphinx
7aa63dd
%endif
7aa63dd
%if %{with tests}
3333be1
BuildRequires:  python%{python3_pkgversion}-pytest
7aa63dd
%endif
7aa63dd
3333be1
5f051aa
%description
5f051aa
pyparsing is a module that can be used to easily and directly configure syntax
5f051aa
definitions for any number of text parsing applications.
5f051aa
c2627a1
59f4a81
%package -n python%{python3_pkgversion}-pyparsing
59f4a81
Summary:        %{summary}
59f4a81
59f4a81
%description -n python%{python3_pkgversion}-pyparsing
59f4a81
pyparsing is a module that can be used to easily and directly configure syntax
59f4a81
definitions for any number of text parsing applications.
59f4a81
59f4a81
7aa63dd
%if %{with doc}
a3002fe
%package        doc
59f4a81
Summary:        Documentation for %{name}
05d7628
efe5375
# Most examples are under the project's license, MIT
b313099
# pymicko.py is under GPL-3.0-or-later
b313099
# snmp_api.h is under MIT-CMU
b313099
# sparser.py is under GPL-2.0-or-later
b313099
# searchparser.py and booleansearchparser.py are under BSD-3-Clause
b313099
# btpyparse.py is under "Simplified BSD license" -> BSD-2-Clause
b313099
License:        MIT AND MIT-CMU AND GPL-2.0-or-later AND GPL-3.0-or-later AND BSD-3-Clause AND BSD-2-Clause
efe5375
a3002fe
%description    doc
05d7628
The package contains documentation for pyparsing.
7aa63dd
%endif
05d7628
c2627a1
5f051aa
%prep
21ee08b
%autosetup -p1 -n %{name}-%{name}_%{version}
ea6fb2f
3333be1
dos2unix -k examples/*
3333be1
a077473
3333be1
%generate_buildrequires
805a3ec
# tox lists only the [diagrams] extra and coverage as deps, so we bypass it
7aa63dd
%pyproject_buildrequires %{?with_tests:-x diagrams}
fb214d6
5f051aa
5f051aa
%build
3333be1
%pyproject_wheel
5f051aa
7aa63dd
%if %{with doc}
5cc7f74
pushd docs
5cc7f74
# Theme is not available
5cc7f74
sed -i '/alabaster/d' conf.py
5cc7f74
sphinx-build -b html . html
5cc7f74
popd
7aa63dd
%endif
fb214d6
a077473
5f051aa
%install
3333be1
%pyproject_install
fb214d6
%pyproject_save_files pyparsing
5f051aa
c2627a1
a077473
%check
7aa63dd
%pyproject_check_import %{!?with_tests:-e pyparsing.diagram}
7aa63dd
%if %{with tests}
3333be1
%pytest -v
7aa63dd
%endif
a077473
a077473
fb214d6
%files -n python%{python3_pkgversion}-pyparsing -f %{pyproject_files}
a3002fe
%license LICENSE
5cc7f74
%doc CHANGES README.rst
05d7628
7aa63dd
%if %{with doc}
05d7628
%files doc
a3002fe
%license LICENSE
5cc7f74
%doc CHANGES README.rst docs/html examples
7aa63dd
%endif
a077473
5f051aa
5f051aa
%changelog
8a92544
%autochangelog