]>
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 |
d2a4c9c8 | 11 | Release: 4 |
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/ |
7a98a9f2 | 17 | BuildRequires: rpm-pythonprov |
80f0263f | 18 | BuildRequires: rpmbuild(macros) >= 1.710 |
3bb04556 | 19 | %if %{with python2} |
60e81977 | 20 | BuildRequires: python-devel >= 1:2.5 |
7a98a9f2 | 21 | BuildRequires: python-distribute |
c25047aa | 22 | BuildRequires: python-modules |
3bb04556 JR |
23 | %endif |
24 | %if %{with python3} | |
25 | BuildRequires: python3-devel | |
26 | BuildRequires: python3-distribute | |
27 | BuildRequires: python3-modules | |
28 | %endif | |
7a98a9f2 | 29 | Requires: python-libs |
cd580c6e MG |
30 | BuildArch: noarch |
31 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
32 | ||
33 | %description | |
34 | The parsing module is an alternative approach to creating and | |
35 | executing simple grammars, vs. the traditional lex/yacc approach, or | |
36 | the use of regular expressions. The parsing module provides a library | |
37 | of classes that client code uses to construct the grammar directly in | |
38 | Python code. | |
39 | ||
bd64dee0 JR |
40 | %description -l pl.UTF-8 |
41 | Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w | |
42 | sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie | |
43 | pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę | |
44 | klas, przy pomocy których gramatyka tworzona jest wprost w kodzie | |
cd580c6e MG |
45 | Pythona. |
46 | ||
3bb04556 JR |
47 | %package -n python3-%{module} |
48 | Summary: pyparsing - a Python3 module for creating executing simple grammars | |
49 | Summary(pl.UTF-8): pyparsing - moduł Pythona3 umożliwiający tworzenie i parsowanie prostych gramatyk | |
50 | Group: Libraries/Python | |
51 | ||
52 | %description -n python3-%{module} | |
53 | The parsing module is an alternative approach to creating and | |
54 | executing simple grammars, vs. the traditional lex/yacc approach, or | |
55 | the use of regular expressions. The parsing module provides a library | |
56 | of classes that client code uses to construct the grammar directly in | |
57 | Python code. | |
58 | ||
59 | %description -n python3-%{module} -l pl.UTF-8 | |
60 | Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w | |
61 | sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie | |
62 | pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę | |
63 | klas, przy pomocy których gramatyka tworzona jest wprost w kodzie | |
64 | Pythona. | |
65 | ||
cd580c6e MG |
66 | %package doc |
67 | Summary: Documentation for pyparsing module | |
4c41b8a1 | 68 | Summary(pl.UTF-8): Dokumentacja do modułu pyparsing |
cd580c6e MG |
69 | Group: Libraries/Python |
70 | Requires: %{name} = %{version}-%{release} | |
71 | ||
72 | %description doc | |
73 | This package contains documentation files for pyparsing Python module. | |
74 | ||
bd64dee0 JR |
75 | %description doc -l pl.UTF-8 |
76 | Pakiet zawierający dokumentację dla modułu Pythona pyparsing. | |
cd580c6e MG |
77 | |
78 | %package examples | |
79 | Summary: Examples for pyparsing module | |
4c41b8a1 | 80 | Summary(pl.UTF-8): Przykłady do modułu pyparsing |
cd580c6e MG |
81 | Group: Libraries/Python |
82 | Requires: %{name} = %{version}-%{release} | |
83 | ||
84 | %description examples | |
85 | This package contains example files for pyparsing Python module. | |
86 | ||
bd64dee0 JR |
87 | %description examples -l pl.UTF-8 |
88 | Pakiet zawierający przykładowe skrypty dla modułu Pythona pyparsing. | |
cd580c6e MG |
89 | |
90 | %prep | |
91 | %setup -q -n %{module}-%{version} | |
92 | ||
93 | %build | |
3bb04556 | 94 | %if %{with python2} |
f6ee4061 | 95 | %py_build |
3bb04556 JR |
96 | %endif |
97 | ||
98 | %if %{with python3} | |
7a98a9f2 | 99 | CFLAGS="%{rpmcppflags} %{rpmcflags}" \ |
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) | |
125 | %doc CHANGES 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) | |
133 | %doc CHANGES README | |
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} |