commit d8c84977a17148fe5cddbc5b0169c4df4deb0225 Author: overweight <5324761+overweight@user.noreply.gitee.com> Date: Mon Sep 30 11:15:20 2019 -0400 Package init diff --git a/ply-3.9.tar.gz b/ply-3.9.tar.gz new file mode 100644 index 0000000..20573df Binary files /dev/null and b/ply-3.9.tar.gz differ diff --git a/python-ply.spec b/python-ply.spec new file mode 100644 index 0000000..9a1b800 --- /dev/null +++ b/python-ply.spec @@ -0,0 +1,112 @@ +%global modname ply +%bcond_without python3 +%global _description \ +PLY is an implementation of lex and yacc parsing tools for Python.\ +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. + +Name: python-%{modname} +Summary: Python Lex-Yacc +Version: 3.9 +Release: 9 +License: BSD +URL: http://www.dabeaz.com/ply/ +Source0: http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz +BuildArch: noarch + +%description %{_description} + +%package -n python2-%{modname} +Summary: Python Lex-Yacc +%{?python_provide:%python_provide python2-%{modname}} +BuildRequires: python2-devel python2-setuptools + +%description -n python2-%{modname} %{_description} + +%if %{with python3} +%package -n python3-%{modname} +Summary: Python Lex-Yacc +%{?python_provide:%python_provide python3-%{modname}} +BuildRequires: python3-devel python3-setuptools + +%description -n python3-%{modname} %{_description} +%endif + +%package_help + +%prep +%autosetup -c +mv %{modname}-%{version} python2 +find python2/example/ -type f -exec chmod -x {} ';' +find python2/example/ -type f -name '*.py' -exec sed -i \ + -e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \ + {} ';' +rm -rf python2/*.egg-info + +%if %{with python3} +cp -ai python2 python3 +%endif + +%build +pushd python2 + %py2_build +popd + +%if 0%{?with_python3} +pushd python3 + %py3_build +popd +%endif + +%install +pushd python2 + %py2_install +popd + +%if %{with python3} +pushd python3 + %py3_install +popd +%endif + +%check +pushd python2/test + ./cleanup.sh + %{__python2} testlex.py + %{__python2} testyacc.py +popd + +%if %{with python3} +pushd python3/test + ./cleanup.sh + %{__python3} testlex.py + %{__python3} testyacc.py +popd +%endif + +%files -n python2-%{modname} +%{python2_sitelib}/%{modname}/ +%{python2_sitelib}/%{modname}-%{version}-*.egg-info/ + +%if %{with python3} +%files -n python3-%{modname} +%{python3_sitelib}/%{modname}/ +%{python3_sitelib}/%{modname}-%{version}-*.egg-info/ +%endif + +%files help +%doc python2/CHANGES +%doc python3/CHANGES + +%changelog +* Mon Sep 16 2019 openEuler Buildteam - 3.9-9 +- Package init