]> git.pld-linux.org Git - packages/python-ply.git/blob - python-ply.spec
9c85ad9b8b3f03215d19ff7bec2d3acc1fbe343b
[packages/python-ply.git] / python-ply.spec
1 #
2 # Conditional build:
3 %bcond_without  tests   # unit/functional tests
4 %bcond_without  python2 # CPython 2.x module
5 %bcond_without  python3 # CPython 3.x module
6 #
7 %define         module  ply
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
12 Version:        3.11
13 Release:        3
14 License:        BSD
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
20 %if %{with python3}
21 BuildRequires:  python >= 1:2.7
22 %if %{with tests}
23 BuildRequires:  python-setuptools
24 %endif
25 %endif
26 %if %{with python3}
27 BuildRequires:  python3 >= 1:3.2
28 %if %{with tests}
29 BuildRequires:  python3-setuptools
30 %endif
31 %endif
32 Requires:       python-modules >= 1:2.7
33 Obsoletes:      ply
34 BuildArch:      noarch
35 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
36
37 %description
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
42   larger grammars.
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
47   checking.
48
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
54   większych gramatyk.
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ę
59   błędów.
60
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
66
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
72   larger grammars.
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
77   checking.
78
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
84   większych gramatyk.
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ę
89   błędów.
90
91 %package examples
92 Summary:        Python Lex-Yacc - examples
93 Summary(pl.UTF-8):      lex i yacc dla Pythona - przykłady
94 Group:          Development/Languages/Python
95
96 %description examples
97 Python Lex-Yacc - examples.
98
99 %description examples -l pl.UTF-8
100 lex i yacc dla Pythona - przykłady.
101
102 %prep
103 %setup -q -n %{module}-%{version}
104
105 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' \
106         example/{,new}classcalc/calc.py
107
108 %build
109 %if %{with python2}
110 %py_build %{?with_tests:test}
111 %endif
112
113 %if %{with python3}
114 %py3_build %{?with_tests:test}
115 %endif
116
117 %install
118 rm -rf $RPM_BUILD_ROOT
119 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
120
121 %if %{with python2}
122 %py_install
123 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
124 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
125
126 %py_postclean
127 %endif
128
129 %if %{with python3}
130 %py3_install
131 %endif
132
133 cp -Rf example/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
134
135 %clean
136 rm -rf $RPM_BUILD_ROOT
137
138 %if %{with python2}
139 %files
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
145 %endif
146
147 %if %{with python3}
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
153 %endif
154
155 %files examples
156 %defattr(644,root,root,755)
157 %{_examplesdir}/%{name}-%{version}
This page took 0.066089 seconds and 2 git commands to generate.