3 %bcond_without doc # Sphinx documentation
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module pyparsing
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
10 Name: python-%{module}
11 # keep 2.x here for python2 support
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/pyparsing/
17 Source0: https://files.pythonhosted.org/packages/source/p/pyparsing/%{module}-%{version}.tar.gz
18 # Source0-md5: f0953e47a0112f7a65aec2305ffdf7b4
19 URL: https://github.com/pyparsing/pyparsing/
20 BuildRequires: rpm-pythonprov
21 BuildRequires: rpmbuild(macros) >= 1.714
23 BuildRequires: python-devel >= 1:2.6
24 BuildRequires: python-modules >= 1:2.6
25 BuildRequires: python-setuptools
28 BuildRequires: python3-devel >= 1:3.3
29 BuildRequires: python3-modules >= 1:3.3
30 BuildRequires: python3-setuptools
32 %{?with_doc:BuildRequires: sphinx-pdg-2}
33 Requires: python-modules >= 1:2.6
35 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38 The parsing module is an alternative approach to creating and
39 executing simple grammars, vs. the traditional lex/yacc approach, or
40 the use of regular expressions. The parsing module provides a library
41 of classes that client code uses to construct the grammar directly in
44 %description -l pl.UTF-8
45 Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w
46 sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie
47 pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę
48 klas, przy pomocy których gramatyka tworzona jest wprost w kodzie
51 %package -n python3-%{module}
52 Summary: pyparsing - Python 3 module for creating executing simple grammars
53 Summary(pl.UTF-8): pyparsing - moduł Pythona 3 umożliwiający tworzenie i parsowanie prostych gramatyk
54 Group: Libraries/Python
55 Requires: python3-modules >= 1:3.3
57 %description -n python3-%{module}
58 The parsing module is an alternative approach to creating and
59 executing simple grammars, vs. the traditional lex/yacc approach, or
60 the use of regular expressions. The parsing module provides a library
61 of classes that client code uses to construct the grammar directly in
64 %description -n python3-%{module} -l pl.UTF-8
65 Moduł pyparsing umożliwia tworzenie i parsowanie prostych gramatyk w
66 sposób odmienny od podejścia tradycyjnego, jakim jest zwykle użycie
67 pary lex/yacc lub wyrażeń regularnych. Moduł ten udostępnia bibliotekę
68 klas, przy pomocy których gramatyka tworzona jest wprost w kodzie
72 Summary: Documentation for pyparsing module
73 Summary(pl.UTF-8): Dokumentacja do modułu pyparsing
74 Group: Libraries/Python
75 Requires: %{name} = %{version}-%{release}
78 This package contains documentation files for pyparsing Python module.
80 %description doc -l pl.UTF-8
81 Pakiet zawierający dokumentację dla modułu Pythona pyparsing.
84 Summary: Examples for pyparsing module
85 Summary(pl.UTF-8): Przykłady do modułu pyparsing
86 Group: Libraries/Python
87 Requires: %{name} = %{version}-%{release}
90 This package contains example files for pyparsing Python module.
92 %description examples -l pl.UTF-8
93 Pakiet zawierający przykładowe skrypty dla modułu Pythona pyparsing.
96 %setup -q -n %{module}-%{version}
108 %{__make} -C docs html \
109 SPHINXBUILD=sphinx-build-2
113 rm -rf $RPM_BUILD_ROOT
114 install -d $RPM_BUILD_ROOT{%{py_sitescriptdir},%{_examplesdir}/%{name}-%{version}}
126 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
129 rm -rf $RPM_BUILD_ROOT
133 %defattr(644,root,root,755)
134 %doc CHANGES LICENSE README.rst
135 %{py_sitescriptdir}/pyparsing.py[co]
136 %{py_sitescriptdir}/pyparsing-*.egg-info
140 %files -n python3-%{module}
141 %defattr(644,root,root,755)
142 %doc CHANGES LICENSE README.rst
143 %{py3_sitescriptdir}/pyparsing.py
144 %{py3_sitescriptdir}/__pycache__/pyparsing*.py[co]
145 %{py3_sitescriptdir}/pyparsing-*.egg-info
150 %defattr(644,root,root,755)
151 %doc docs/_build/html/{_static,*.html,*.js}
155 %defattr(644,root,root,755)
156 %{_examplesdir}/%{name}-%{version}