]>
Commit | Line | Data |
---|---|---|
3bb04556 JR |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
cd580c6e | 5 | |
cd580c6e | 6 | %define module pyparsing |
cd580c6e | 7 | Summary: pyparsing - a Python module for creating executing simple grammars |
4c41b8a1 | 8 | Summary(pl.UTF-8): pyparsing - moduł Pythona umożliwiający tworzenie i parsowanie prostych gramatyk |
cd580c6e | 9 | Name: python-%{module} |
21d49c02 | 10 | Version: 2.0.1 |
3bb04556 | 11 | Release: 2 |
cd580c6e MG |
12 | License: MIT |
13 | Group: Libraries/Python | |
82d465d9 | 14 | Source0: http://downloads.sourceforge.net/pyparsing/%{module}-%{version}.tar.gz |
21d49c02 | 15 | # Source0-md5: 37adec94104b98591507218bc82e7c31 |
cd580c6e | 16 | URL: http://pyparsing.sourceforge.net/ |
3bb04556 | 17 | %if %{with python2} |
60e81977 | 18 | BuildRequires: python-devel >= 1:2.5 |
c25047aa | 19 | BuildRequires: python-modules |
3bb04556 JR |
20 | %endif |
21 | %if %{with python3} | |
22 | BuildRequires: python3-devel | |
23 | BuildRequires: python3-distribute | |
24 | BuildRequires: python3-modules | |
25 | %endif | |
60e81977 | 26 | BuildRequires: rpm-pythonprov |
c00b69a0 | 27 | %pyrequires_eq python-libs |
cd580c6e MG |
28 | BuildArch: noarch |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
32 | The parsing module is an alternative approach to creating and | |
33 | executing simple grammars, vs. the traditional lex/yacc approach, or | |
34 | the use of regular expressions. The parsing module provides a library | |
35 | of classes that client code uses to construct the grammar directly in | |
36 | Python code. | |
37 | ||
bd64dee0 JR |
38 | %description -l pl.UTF-8 |
39 | Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w | |
40 | sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie | |
41 | pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę | |
42 | klas, przy pomocy których gramatyka tworzona jest wprost w kodzie | |
cd580c6e MG |
43 | Pythona. |
44 | ||
3bb04556 JR |
45 | %package -n python3-%{module} |
46 | Summary: pyparsing - a Python3 module for creating executing simple grammars | |
47 | Summary(pl.UTF-8): pyparsing - moduł Pythona3 umożliwiający tworzenie i parsowanie prostych gramatyk | |
48 | Group: Libraries/Python | |
49 | ||
50 | %description -n python3-%{module} | |
51 | The parsing module is an alternative approach to creating and | |
52 | executing simple grammars, vs. the traditional lex/yacc approach, or | |
53 | the use of regular expressions. The parsing module provides a library | |
54 | of classes that client code uses to construct the grammar directly in | |
55 | Python code. | |
56 | ||
57 | %description -n python3-%{module} -l pl.UTF-8 | |
58 | Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w | |
59 | sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie | |
60 | pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę | |
61 | klas, przy pomocy których gramatyka tworzona jest wprost w kodzie | |
62 | Pythona. | |
63 | ||
cd580c6e MG |
64 | %package doc |
65 | Summary: Documentation for pyparsing module | |
4c41b8a1 | 66 | Summary(pl.UTF-8): Dokumentacja do modułu pyparsing |
cd580c6e MG |
67 | Group: Libraries/Python |
68 | Requires: %{name} = %{version}-%{release} | |
69 | ||
70 | %description doc | |
71 | This package contains documentation files for pyparsing Python module. | |
72 | ||
bd64dee0 JR |
73 | %description doc -l pl.UTF-8 |
74 | Pakiet zawierający dokumentację dla modułu Pythona pyparsing. | |
cd580c6e MG |
75 | |
76 | %package examples | |
77 | Summary: Examples for pyparsing module | |
4c41b8a1 | 78 | Summary(pl.UTF-8): Przykłady do modułu pyparsing |
cd580c6e MG |
79 | Group: Libraries/Python |
80 | Requires: %{name} = %{version}-%{release} | |
81 | ||
82 | %description examples | |
83 | This package contains example files for pyparsing Python module. | |
84 | ||
bd64dee0 JR |
85 | %description examples -l pl.UTF-8 |
86 | Pakiet zawierający przykładowe skrypty dla modułu Pythona pyparsing. | |
cd580c6e MG |
87 | |
88 | %prep | |
89 | %setup -q -n %{module}-%{version} | |
90 | ||
91 | %build | |
3bb04556 JR |
92 | rm -rf build-2 build-3 |
93 | install -d build-2 build-3 | |
94 | %if %{with python2} | |
95 | cp -a [^b]* build-2 | |
96 | cd build-2 | |
82d465d9 | 97 | %{__python} setup.py build_ext |
3bb04556 JR |
98 | cd .. |
99 | %endif | |
100 | ||
101 | %if %{with python3} | |
102 | cp -a [^b]* build-3 | |
103 | cd build-3 | |
104 | %{__python3} setup.py build_ext | |
105 | cd .. | |
106 | %endif | |
cd580c6e MG |
107 | |
108 | %install | |
109 | rm -rf $RPM_BUILD_ROOT | |
110 | install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{_examplesdir}/%{name}-%{version}} | |
111 | ||
3bb04556 JR |
112 | %if %{with python2} |
113 | cd build-2 | |
114 | %{__python} setup.py \ | |
115 | install \ | |
116 | --optimize=2 \ | |
117 | --root=$RPM_BUILD_ROOT | |
cd580c6e | 118 | |
60e81977 | 119 | %py_postclean |
3bb04556 JR |
120 | cd .. |
121 | %endif | |
122 | ||
123 | %if %{with python3} | |
124 | cd build-3 | |
125 | %{__python3} setup.py \ | |
126 | install \ | |
127 | --optimize=2 \ | |
128 | --root=$RPM_BUILD_ROOT | |
129 | cd .. | |
130 | %endif | |
cd580c6e MG |
131 | |
132 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
133 | ||
134 | %clean | |
135 | rm -rf $RPM_BUILD_ROOT | |
136 | ||
3bb04556 | 137 | %if %{with python2} |
cd580c6e MG |
138 | %files |
139 | %defattr(644,root,root,755) | |
140 | %doc CHANGES README | |
60e81977 JB |
141 | %{py_sitescriptdir}/pyparsing.py[co] |
142 | %{py_sitescriptdir}/pyparsing-*.egg-info | |
3bb04556 JR |
143 | %endif |
144 | ||
145 | %if %{with python3} | |
146 | %files -n python3-%{module} | |
147 | %defattr(644,root,root,755) | |
148 | %doc CHANGES README | |
149 | %{py3_sitescriptdir}/pyparsing.py | |
150 | %{py3_sitescriptdir}/__pycache__/pyparsing*.py[co] | |
151 | %{py3_sitescriptdir}/pyparsing-*.egg-info | |
152 | %endif | |
cd580c6e MG |
153 | |
154 | %files doc | |
155 | %defattr(644,root,root,755) | |
156 | %doc HowToUsePyparsing.html htmldoc pyparsingClassDiagram.{JPG,PNG} | |
157 | ||
158 | %files examples | |
159 | %defattr(644,root,root,755) | |
160 | %{_examplesdir}/%{name}-%{version} |