diff --git a/pyparsing.spec b/pyparsing.spec new file mode 100644 index 0000000000000000000000000000000000000000..66385325b7cb8b0864299d3bcbadb2a6e863c41e --- /dev/null +++ b/pyparsing.spec @@ -0,0 +1,97 @@ +%global build_wheel 1 +%global python_wheelname pyparsing-%{version}-py3-none-any.whl + +# Disable tests by default because they fail to run inside mock builds. +# at the moment, but can run locally. To build and run tests, do: +# rpmbuild -ba --with runtests pyparsing.spec +%bcond_with runtests + +Name: pyparsing +Version: 3.0.7 +Release: 1%{?dist} +Summary: Python library for creating PEG parsers + +License: MIT +URL: https://github.com/pyparsing/pyparsing +Source0: https://github.com/pyparsing/pyparsing/archive/refs/tags/%{name}_%{version}.tar.gz + +BuildArch: noarch + +BuildRequires: dos2unix +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%if 0%{?build_wheel} +BuildRequires: python3-sphinx +BuildRequires: python3-pip +BuildRequires: python3-wheel +%endif + + +%description +The pyparsing module is an alternative approach to creating and executing +simple grammars, vs. the traditional lex/yacc approach, or the use of regular +expressions. The pyparsing module provides a library of classes that client +code uses to construct the grammar directly in Python code. + +%package doc +Summary: Documentation for pyparsing python package +License: MIT and GPLv2+ and GPLv3+ and BSD + +%description doc +The package contains documentation for pyparsing. + +%package -n python3-pyparsing +Summary: %{summary} + +%{?python_provide:%python_provide python3-pyparsing} + +%description -n python3-pyparsing +The pyparsing module is an alternative approach to creating and executing +simple grammars, vs. the traditional lex/yacc approach, or the use of regular +expressions. The pyparsing module provides a library of classes that client +code uses to construct the grammar directly in Python code. + + +%prep +%autosetup -n %{name}-%{name}_%{version} -p1 +dos2unix -k CHANGES LICENSE + + +%build +%py3_build_wheel + +# build docs +pushd docs +# Theme is not available +sed -i '/alabaster/d' conf.py +sphinx-build -b html . html +popd + + +%install +%py3_install_wheel %{python_wheelname} + + +%check +%if %{with runtests} +pip3 install -r tests/requirements.txt +pre-commit install +python3 -m unittest discover tests +%endif + + +%files -n python3-pyparsing +%license LICENSE +%doc CHANGES README.rst +%{python3_sitelib}/pyparsing/ +%{python3_sitelib}/pyparsing-*-info/ + +%files doc +%license LICENSE +%doc CHANGES README.rst docs/html examples + + +%changelog +* Wed Apr 13 2022 happy_orange 3.0.7-1 +- Init package from upstream 3.0.7 diff --git a/pyparsing_3.0.7.tar.gz b/pyparsing_3.0.7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..416bac748071d73a530495635871f6356b2b33ac Binary files /dev/null and b/pyparsing_3.0.7.tar.gz differ