3 %bcond_without tests # unit/functional tests
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
8 Summary: Python 2 Lex-Yacc
9 Summary(pl.UTF-8): lex i yacc dla Pythona 2
10 Name: python-%{module}
11 # note: keep 3.x here for python2 support; for 4+ create python3- .spec instead
15 Group: Libraries/Python
16 Source0: http://www.dabeaz.com/ply/ply-%{version}.tar.gz
17 # Source0-md5: 6465f602e656455affcd7c5734c638f8
18 URL: http://www.dabeaz.com/ply/
19 BuildRequires: rpmbuild(macros) >= 1.714
21 BuildRequires: python >= 1:2.7
23 BuildRequires: python-setuptools
27 BuildRequires: python3 >= 1:3.2
29 BuildRequires: python3-setuptools
32 Requires: python-modules >= 1:2.7
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 PLY is yet another implementation of lex and yacc for Python. Although
39 several other parsing tools are available for Python, there are
40 several reasons why you might want to take a look at PLY:
41 - It uses LR-parsing which is reasonably efficient and well suited for
43 - PLY provides most of the standard lex/yacc features including
44 support for empty productions, precedence rules, error recovery, and
45 support for ambiguous grammars.
46 - PLY is extremely easy to use and provides very extensive error
49 %description -l pl.UTF-8
50 PLY to kolejna implementacja narzędzi lex i yacc dla Pythona. Mimo iż
51 istnieje kilka innych analizatorów dla Pythona, to istnieje kilka
52 powodów, dla których można zainteresować się PLY:
53 - Używa on analizy LR, która jest w miarę wydajna i dość dobra dla
55 - Udostępnia większość możliwości standardowych lex/yacc, w tym
56 obsługę pustych produkcji, reguł poprzedzania, rekompensowania błędów
57 oraz obsługę niejednoznacznych gramatyk.
58 - Jest niezwykle łatwy w użyciu oraz zapewnia rozległą kontrolę
61 %package -n python3-%{module}
62 Summary: Python 3 Lex-Yacc
63 Summary(pl.UTF-8): lex i yacc dla Pythona 3
64 Group: Libraries/Python
65 Requires: python3-modules >= 1:3.2
67 %description -n python3-%{module}
68 PLY is yet another implementation of lex and yacc for Python. Although
69 several other parsing tools are available for Python, there are
70 several reasons why you might want to take a look at PLY:
71 - It uses LR-parsing which is reasonably efficient and well suited for
73 - PLY provides most of the standard lex/yacc features including
74 support for empty productions, precedence rules, error recovery, and
75 support for ambiguous grammars.
76 - PLY is extremely easy to use and provides very extensive error
79 %description -n python3-%{module} -l pl.UTF-8
80 PLY to kolejna implementacja narzędzi lex i yacc dla Pythona. Mimo iż
81 istnieje kilka innych analizatorów dla Pythona, to istnieje kilka
82 powodów, dla których można zainteresować się PLY:
83 - Używa on analizy LR, która jest w miarę wydajna i dość dobra dla
85 - Udostępnia większość możliwości standardowych lex/yacc, w tym
86 obsługę pustych produkcji, reguł poprzedzania, rekompensowania błędów
87 oraz obsługę niejednoznacznych gramatyk.
88 - Jest niezwykle łatwy w użyciu oraz zapewnia rozległą kontrolę
92 Summary: Python Lex-Yacc - examples
93 Summary(pl.UTF-8): lex i yacc dla Pythona - przykłady
94 Group: Development/Languages/Python
97 Python Lex-Yacc - examples.
99 %description examples -l pl.UTF-8
100 lex i yacc dla Pythona - przykłady.
103 %setup -q -n %{module}-%{version}
105 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' \
106 example/{,new}classcalc/calc.py
110 %py_build %{?with_tests:test}
114 %py3_build %{?with_tests:test}
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
123 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
124 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
133 cp -Rf example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
136 rm -rf $RPM_BUILD_ROOT
140 %defattr(644,root,root,755)
141 %doc ANNOUNCE CHANGES README.md TODO doc/*.html
142 %dir %{py_sitescriptdir}/ply
143 %{py_sitescriptdir}/ply/*.py[co]
144 %{py_sitescriptdir}/ply-%{version}-py*.egg-info
148 %files -n python3-%{module}
149 %defattr(644,root,root,755)
150 %doc ANNOUNCE CHANGES README.md TODO doc/*.html
151 %{py3_sitescriptdir}/ply
152 %{py3_sitescriptdir}/ply-%{version}-py*.egg-info
156 %defattr(644,root,root,755)
157 %{_examplesdir}/%{name}-%{version}