From 9a305f2cc0dc5aae0ee6e8545a1d467e5c8c1ede Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Fri, 25 Nov 2022 18:09:00 +0100 Subject: [PATCH] RHEL: Import from Fedora Resolves: rhbz#2157718 --- .gitignore | 1 + pyparsing.spec | 127 +++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 129 insertions(+) create mode 100644 pyparsing.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..75c853b 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pyparsing-3.0.7.tar.gz diff --git a/pyparsing.spec b/pyparsing.spec new file mode 100644 index 0000000..fa93106 --- /dev/null +++ b/pyparsing.spec @@ -0,0 +1,127 @@ +%global srcname pyparsing + +# when bootstrapping Python 3, pyparsing needs to be rebuilt before dependency generator is available +%bcond_with bootstrap +%if %{without bootstrap} +%global build_wheel 1 +%global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl +%endif + + +Summary: Python package with an object-oriented approach to text processing +Name: pyparsing +Version: 3.0.7 +Release: 1%{?dist} + +License: MIT +URL: https://github.com/pyparsing/pyparsing +Source0: https://github.com/%{name}/%{name}/archive/%{name}_%{version}/%{name}-%{version}.tar.gz + +BuildArch: noarch +BuildRequires: dos2unix +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools + +%if %{without bootstrap} +BuildRequires: python%{python3_pkgversion}-sphinx +%endif + +%if 0%{?build_wheel} +BuildRequires: python%{python3_pkgversion}-pip +BuildRequires: python%{python3_pkgversion}-wheel +%endif + +BuildRequires: python%{python3_pkgversion}-pytest + +%description +pyparsing is a module that can be used to easily and directly configure syntax +definitions for any number of text parsing applications. + + +%package -n python%{python3_pkgversion}-pyparsing +Summary: %{summary} +%if %{with bootstrap} +Provides: python%{python3_pkgversion}dist(pyparsing) = %{version} +Provides: python%{python3_version}dist(pyparsing) = %{version} +Requires: python(abi) = %{python3_version} +%endif + +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} + +%description -n python%{python3_pkgversion}-pyparsing +pyparsing is a module that can be used to easily and directly configure syntax +definitions for any number of text parsing applications. + + +%if %{without bootstrap} +%package doc +Summary: Documentation for %{name} + +# Most examples are under the project's license, MIT +# pymicko.py is under GPLv3+ +# snmp_api.h is under CMU-UC (MIT) +# sparser.py is under GPLv2+ +# searchparser.py is under BSD (3-clause, with advertising) +# btpyparse.py is under "Simplified BSD license" +License: MIT and GPLv2+ and GPLv3+ and BSD + +%description doc +The package contains documentation for pyparsing. +%endif + + +%prep +%autosetup -p1 -n %{name}-%{name}_%{version} + +dos2unix -k examples/* + + +%if 0%{?build_wheel} +%generate_buildrequires +%pyproject_buildrequires -t +%endif + +%build +%if 0%{?build_wheel} +%pyproject_wheel +%else +%py3_build +%endif + +%if %{without bootstrap} +# build docs +pushd docs +# Theme is not available +sed -i '/alabaster/d' conf.py +sphinx-build -b html . html +popd +%endif + +%install +%if 0%{?build_wheel} +%pyproject_install +%else +%py3_install +%endif + + +%check +%pytest -v + + +%files -n python%{python3_pkgversion}-pyparsing +%license LICENSE +%doc CHANGES README.rst +%{python3_sitelib}/pyparsing/ +%{python3_sitelib}/pyparsing-%{version}.dist-info/ + +%if %{without bootstrap} +%files doc +%license LICENSE +%doc CHANGES README.rst docs/html examples +%endif + + +%changelog +* Fri Nov 25 2022 Charalampos Stratakis - 3.0.7-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..98e5dd6 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (pyparsing-3.0.7.tar.gz) = d5d5547188ebda6fb7f45928174314d3d4d10302acc8fb476cd6590fb4a75167dee5f6397ab0b63efd4cb55c0765708ffd432bcfecf28d8f808815e62615f447