%global python3_pkgversion 3.14 %global modname ply %bcond_without tests Name: python%{python3_pkgversion}-%{modname} Summary: Python Lex-Yacc Version: 3.11 Release: 29%{?dist} License: BSD-3-Clause 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}-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} %patch -P0 -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 * Thu Sep 04 2025 Tomáš Hrnčiar - 3.11-29 - Initial package Fedora contributions by: Bohuslav Kabrda Charalampos Stratakis Christian Heimes David Malcolm Ignacio Vazquez-Abrams Igor Gnatenko Miro Hrončok Orion Poplawski Rob Crittenden Robert Kuska Stephen Gallagher Thomas Spura Tom Callaway Troy Dawson