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