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