74d2bc
%global modname ply
74d2bc
74d2bc
%if 0%{?fedora} || 0%{?rhel} >= 8
74d2bc
%bcond_without python3
74d2bc
%else
74d2bc
%bcond_with python3
74d2bc
%endif
74d2bc
74d2bc
%if 0%{?rhel} > 7
74d2bc
# Disable python2 build by default
74d2bc
%bcond_with python2
74d2bc
%else
74d2bc
%bcond_without python2
74d2bc
%endif
74d2bc
74d2bc
Name:           python-%{modname}
74d2bc
Summary:        Python Lex-Yacc
74d2bc
Version:        3.9
bcf700
Release:        9%{?dist}
74d2bc
License:        BSD
74d2bc
URL:            http://www.dabeaz.com/ply/
74d2bc
Source0:        http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz
74d2bc
BuildArch:      noarch
74d2bc
dbac76
Patch1:         Make-MD5-fingerprint-FIPS-compatible.patch
dbac76
74d2bc
%description
74d2bc
PLY is a straightforward lex/yacc implementation. Here is a list of its 
74d2bc
essential features:
74d2bc
* It is implemented entirely in Python.
74d2bc
* It uses LR-parsing which is reasonably efficient and well suited for larger 
74d2bc
  grammars.
74d2bc
* PLY provides most of the standard lex/yacc features including support 
74d2bc
  for empty productions, precedence rules, error recovery, and support 
74d2bc
  for ambiguous grammars.
74d2bc
* PLY is straightforward to use and provides very extensive error checking.
74d2bc
* PLY doesn't try to do anything more or less than provide the basic lex/yacc 
74d2bc
  functionality. In other words, it's not a large parsing framework or a 
74d2bc
  component of some larger system. 
74d2bc
74d2bc
%if %{with python2}
74d2bc
%package -n python2-%{modname}
74d2bc
Summary:        Python Lex-Yacc
74d2bc
%{?python_provide:%python_provide python2-%{modname}}
74d2bc
BuildRequires:  python2-devel
74d2bc
BuildRequires:  python2-setuptools
74d2bc
74d2bc
%description -n python2-%{modname}
74d2bc
PLY is a straightforward lex/yacc implementation. Here is a list of its 
74d2bc
essential features:
74d2bc
* It is implemented entirely in Python.
74d2bc
* It uses LR-parsing which is reasonably efficient and well suited for larger 
74d2bc
  grammars.
74d2bc
* PLY provides most of the standard lex/yacc features including support 
74d2bc
  for empty productions, precedence rules, error recovery, and support 
74d2bc
  for ambiguous grammars.
74d2bc
* PLY is straightforward to use and provides very extensive error checking.
74d2bc
* PLY doesn't try to do anything more or less than provide the basic lex/yacc 
74d2bc
  functionality. In other words, it's not a large parsing framework or a 
74d2bc
  component of some larger system.
74d2bc
74d2bc
Python 2 version.
74d2bc
%endif # with python2
74d2bc
74d2bc
%if %{with python3}
74d2bc
%package -n python3-%{modname}
74d2bc
Summary:        Python Lex-Yacc
74d2bc
%{?python_provide:%python_provide python3-%{modname}}
74d2bc
BuildRequires:  python3-devel
74d2bc
BuildRequires:  python3-setuptools
74d2bc
74d2bc
%description -n python3-%{modname}
74d2bc
PLY is a straightforward lex/yacc implementation. Here is a list of its 
74d2bc
essential features:
74d2bc
* It is implemented entirely in Python.
74d2bc
* It uses LR-parsing which is reasonably efficient and well suited for larger 
74d2bc
  grammars.
74d2bc
* PLY provides most of the standard lex/yacc features including support 
74d2bc
  for empty productions, precedence rules, error recovery, and support 
74d2bc
  for ambiguous grammars.
74d2bc
* PLY is straightforward to use and provides very extensive error checking.
74d2bc
* PLY doesn't try to do anything more or less than provide the basic lex/yacc 
74d2bc
  functionality. In other words, it's not a large parsing framework or a 
74d2bc
  component of some larger system.
74d2bc
74d2bc
Python 3 version.
74d2bc
%endif # with python3
74d2bc
74d2bc
%prep
dbac76
%autosetup -c -N
dbac76
dbac76
pushd %{modname}-%{version}
dbac76
%patch1 -p1
dbac76
popd
dbac76
74d2bc
%if %{with python2}
74d2bc
cp -ai %{modname}-%{version} python2
74d2bc
find python2/example/ -type f -exec chmod -x {} ';'
74d2bc
find python2/example/ -type f -name '*.py' -exec sed -i \
74d2bc
  -e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \
74d2bc
  {} ';'
74d2bc
rm -rf python2/*.egg-info
bcf700
# extract license block from beginning of README.md
bcf700
grep -B1000 "POSSIBILITY OF SUCH DAMAGE" python2/README.md > python2/LICENSE
74d2bc
%endif # with python2
74d2bc
74d2bc
%if %{with python3}
74d2bc
cp -ai %{modname}-%{version} python3
bcf700
# extract license block from beginning of README.md
bcf700
grep -B1000 "POSSIBILITY OF SUCH DAMAGE" python3/README.md > python3/LICENSE
74d2bc
%endif # with python3
74d2bc
74d2bc
%build
74d2bc
%if %{with python2}
74d2bc
pushd python2
74d2bc
  %py2_build
74d2bc
popd
74d2bc
%endif # with python2
74d2bc
74d2bc
%if 0%{?with_python3}
74d2bc
pushd python3
74d2bc
  %py3_build
74d2bc
popd
74d2bc
%endif # with python3
74d2bc
74d2bc
%install
74d2bc
%if %{with python2}
74d2bc
pushd python2
74d2bc
  %py2_install
74d2bc
popd
74d2bc
%endif # with python2
74d2bc
74d2bc
%if %{with python3}
74d2bc
pushd python3
74d2bc
  %py3_install
74d2bc
popd
74d2bc
%endif # with python3
74d2bc
74d2bc
%check
74d2bc
%if %{with python2}
74d2bc
pushd python2/test
74d2bc
  ./cleanup.sh
74d2bc
  %{__python2} testlex.py
74d2bc
  %{__python2} testyacc.py
74d2bc
popd
74d2bc
%endif # with python2
74d2bc
74d2bc
%if %{with python3}
74d2bc
pushd python3/test
74d2bc
  ./cleanup.sh
74d2bc
  %{__python3} testlex.py
74d2bc
  %{__python3} testyacc.py
74d2bc
popd
74d2bc
%endif # with python3
74d2bc
74d2bc
%if %{with python2}
74d2bc
%files -n python2-%{modname}
bcf700
%doc python2/CHANGES python2/README.md
bcf700
%license python2/LICENSE
74d2bc
%{python2_sitelib}/%{modname}/
74d2bc
%{python2_sitelib}/%{modname}-%{version}-*.egg-info/
74d2bc
%endif # with python2
74d2bc
74d2bc
%if %{with python3}
74d2bc
%files -n python3-%{modname}
bcf700
%doc python3/CHANGES python3/README.md
bcf700
%license python3/LICENSE
74d2bc
%{python3_sitelib}/%{modname}/
74d2bc
%{python3_sitelib}/%{modname}-%{version}-*.egg-info/
74d2bc
%endif # with python3
74d2bc
74d2bc
%changelog
bcf700
* Wed Jan  6 14:57:34 CET 2021 Christian Heimes <cheimes@redhat.com> - 3.9-9
bcf700
- Include README.MD and LICENSE (#1464435)
bcf700
dbac76
* Mon Nov 11 2019 Christian Heimes <cheimes@redhat.com> - 3.9-8
dbac76
- Make MD5 fingerprint FIPS compliant
dbac76
- Resolves: rhbz#1747490
dbac76
74d2bc
* Fri Jun 15 2018 Charalampos Stratakis <cstratak@redhat.com> - 3.9-7
74d2bc
- Conditionalize the python2 subpackage
74d2bc
74d2bc
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.9-6
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
74d2bc
74d2bc
* Wed Sep 27 2017 Troy Dawson <tdawson@redhat.com> - 3.9-5
74d2bc
- Cleanup spec file conditionals
74d2bc
74d2bc
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9-4
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
74d2bc
74d2bc
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9-3
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
74d2bc
74d2bc
* Fri Dec 09 2016 Charalampos Stratakis <cstratak@redhat.com> - 3.9-2
74d2bc
- Rebuild for Python 3.6
74d2bc
74d2bc
* Tue Nov 8 2016 Orion Poplawski <orion@cora.nwra.com> - 3.9-1
74d2bc
- Update to 3.9
74d2bc
74d2bc
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.8-2
74d2bc
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
74d2bc
74d2bc
* Sun Apr 10 2016 Igor Gnatenko <ignatenko@redhat.com> - 3.8-1
74d2bc
- Update to 3.8
74d2bc
- Follow new packaging guidelines
74d2bc
- Run tests
74d2bc
74d2bc
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.6-4
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
74d2bc
74d2bc
* Tue Oct 13 2015 Robert Kuska <rkuska@redhat.com> - 3.6-3
74d2bc
- Rebuilt for Python3.5 rebuild
74d2bc
74d2bc
* Tue Aug 18 2015 Stephen Gallagher <sgallagh@redhat.com> 3.6-2
74d2bc
- Fixes for chromium and SlimIt
74d2bc
- Resolves: rhbz#1242929
74d2bc
- Resolves: rhbz#1254372
74d2bc
74d2bc
* Tue Jul 14 2015 Stephen Gallagher <sgallagh@redhat.com> 3.6-1
74d2bc
- Update to latest ply 3.6 for Python 3 fixes
74d2bc
74d2bc
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-8
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
74d2bc
74d2bc
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-7
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
74d2bc
74d2bc
* Mon May 12 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 3.4-6
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
74d2bc
74d2bc
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-5
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
74d2bc
74d2bc
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-4
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
74d2bc
74d2bc
* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 3.4-3
74d2bc
- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
74d2bc
74d2bc
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.4-2
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
74d2bc
74d2bc
* Mon Mar 19 2012 Tom Callaway <spot@fedoraproject.org> - 3.4-1
74d2bc
- update to 3.4
74d2bc
74d2bc
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-6
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
74d2bc
74d2bc
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.3-5
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
74d2bc
74d2bc
* Wed Aug 25 2010 Thomas Spura <tomspur@fedoraproject.org> - 3.3-4
74d2bc
- update to most recent python packaging guidelines
74d2bc
- rebuild with python3.2
74d2bc
  http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html
74d2bc
74d2bc
* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 3.3-3
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
74d2bc
74d2bc
* Sat Apr  3 2010 David Malcolm <dmalcolm@redhat.com> - 3.3-2
74d2bc
- add python3-ply subpackage
74d2bc
74d2bc
* Mon Oct 19 2009 Tom "spot" Callaway <tcallawa@redhat.com> - 3.3-1
74d2bc
- update to 3.3
74d2bc
74d2bc
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.2-2
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
74d2bc
74d2bc
* Wed Apr 22 2009 Tom "spot" Callaway <tcallawa@redhat.com> 3.2-1
74d2bc
- update to 3.2, license change to BSD
74d2bc
74d2bc
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-3
74d2bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
74d2bc
74d2bc
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.5-2
74d2bc
- Rebuild for Python 2.6
74d2bc
74d2bc
* Fri Oct 17 2008 Tom "spot" Callaway <tcallawa@redhat.com> 2.5-1
74d2bc
- update to 2.5
74d2bc
74d2bc
* Mon Mar 24 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2.3-2
74d2bc
- add example dir as doc
74d2bc
74d2bc
* Sat Mar 15 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.2.3-1
74d2bc
- Initial package for Fedora