%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 %global modname ply %bcond_without tests Name: python%{python3_pkgversion}-%{modname} Summary: Python Lex-Yacc Version: 3.11 Release: 1%{?dist} License: BSD URL: http://www.dabeaz.com/ply/ Source0: http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz # Fix build against Python 3.11 # https://github.com/dabeaz/ply/pull/262 Patch0: 262.patch BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-rpm-macros BuildRequires: python%{python3_pkgversion}-setuptools %description PLY is a straightforward lex/yacc implementation. Here is a list of its essential features: * It is implemented entirely in Python. * It uses LR-parsing which is reasonably efficient and well suited for larger grammars. * PLY provides most of the standard lex/yacc features including support for empty productions, precedence rules, error recovery, and support for ambiguous grammars. * PLY is straightforward to use and provides very extensive error checking. * PLY doesn't try to do anything more or less than provide the basic lex/yacc functionality. In other words, it's not a large parsing framework or a component of some larger system. %prep %setup -n %{modname}-%{version} %patch0 -p1 -b .262 find example/ -type f -executable -exec chmod -x {} ';' find example/ -type f -name '*.py' -exec sed -i \ -e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \ {} ';' rm -rf *.egg-info # extract license block from beginning of README.md grep -B1000 "POSSIBILITY OF SUCH DAMAGE" README.md > LICENSE %build %py3_build %install %py3_install %if %{with tests} %check pushd test ./cleanup.sh %{__python3} testlex.py %{__python3} testyacc.py popd %endif %files -n python%{python3_pkgversion}-%{modname} %doc CHANGES README.md %license LICENSE %{python3_sitelib}/%{modname}/ %{python3_sitelib}/%{modname}-%{version}-*.egg-info/ %changelog * Fri Nov 11 2022 Charalampos Stratakis - 3.11-1 - Initial package - Fedora contributions by: Bill Nottingham Charalampos Stratakis Christian Heimes David Malcolm Dennis Gilmore Ignacio Vazquez-Abrams Igor Gnatenko Jesse Keating Miro HronĨok Orion Poplawski Patrik Kopkan Robert Kuska Slavek Kabrda Stephen Gallagher Thomas Spura Tom spot Callaway Troy Dawson