]>
Commit | Line | Data |
---|---|---|
3bb04556 JR |
1 | # |
2 | # Conditional build: | |
f3ca9dc4 | 3 | %bcond_without doc # Sphinx documentation |
f0b5730f | 4 | %bcond_without tests # unit tests |
cd580c6e | 5 | |
cd580c6e | 6 | %define module pyparsing |
f0b5730f JB |
7 | Summary: pyparsing - Python 3 module for creating executing simple grammars |
8 | Summary(pl.UTF-8): pyparsing - moduł Pythona 3 umożliwiający tworzenie i parsowanie prostych gramatyk | |
9 | Name: python3-%{module} | |
10 | Version: 3.0.7 | |
ec8a8ad9 | 11 | Release: 3 |
cd580c6e MG |
12 | License: MIT |
13 | Group: Libraries/Python | |
f3ca9dc4 JB |
14 | #Source0Download: https://pypi.org/simple/pyparsing/ |
15 | Source0: https://files.pythonhosted.org/packages/source/p/pyparsing/%{module}-%{version}.tar.gz | |
f0b5730f | 16 | # Source0-md5: 9d38774991175444e21a3dfa865876cc |
f3ca9dc4 | 17 | URL: https://github.com/pyparsing/pyparsing/ |
f0b5730f JB |
18 | BuildRequires: python3-devel >= 1:3.6 |
19 | BuildRequires: python3-modules >= 1:3.6 | |
f3ca9dc4 | 20 | BuildRequires: python3-setuptools |
f0b5730f | 21 | %if %{with tests} |
49892887 | 22 | BuildRequires: python3-jinja2 |
f0b5730f | 23 | BuildRequires: python3-pytest |
49892887 | 24 | BuildRequires: python3-railroad-diagrams |
3bb04556 | 25 | %endif |
f0b5730f JB |
26 | BuildRequires: rpm-pythonprov |
27 | BuildRequires: rpmbuild(macros) >= 1.714 | |
28 | %{?with_doc:BuildRequires: sphinx-pdg-3} | |
29 | Requires: python3-modules >= 1:3.6 | |
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 | ||
47 | %package doc | |
48 | Summary: Documentation for pyparsing module | |
4c41b8a1 | 49 | Summary(pl.UTF-8): Dokumentacja do modułu pyparsing |
cd580c6e MG |
50 | Group: Libraries/Python |
51 | Requires: %{name} = %{version}-%{release} | |
52 | ||
53 | %description doc | |
54 | This package contains documentation files for pyparsing Python module. | |
55 | ||
bd64dee0 JR |
56 | %description doc -l pl.UTF-8 |
57 | Pakiet zawierający dokumentację dla modułu Pythona pyparsing. | |
cd580c6e MG |
58 | |
59 | %package examples | |
60 | Summary: Examples for pyparsing module | |
4c41b8a1 | 61 | Summary(pl.UTF-8): Przykłady do modułu pyparsing |
cd580c6e MG |
62 | Group: Libraries/Python |
63 | Requires: %{name} = %{version}-%{release} | |
64 | ||
65 | %description examples | |
66 | This package contains example files for pyparsing Python module. | |
67 | ||
bd64dee0 JR |
68 | %description examples -l pl.UTF-8 |
69 | Pakiet zawierający przykładowe skrypty dla modułu Pythona pyparsing. | |
cd580c6e MG |
70 | |
71 | %prep | |
72 | %setup -q -n %{module}-%{version} | |
73 | ||
74 | %build | |
f6ee4061 | 75 | %py3_build |
f0b5730f JB |
76 | |
77 | %if %{with tests} | |
78 | PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \ | |
79 | %{__python3} -m pytest tests | |
3bb04556 | 80 | %endif |
cd580c6e | 81 | |
f3ca9dc4 | 82 | %if %{with doc} |
3f2e1d07 | 83 | %{__make} -C docs html \ |
f0b5730f | 84 | SPHINXBUILD=sphinx-build-3 |
f3ca9dc4 JB |
85 | %endif |
86 | ||
cd580c6e MG |
87 | %install |
88 | rm -rf $RPM_BUILD_ROOT | |
f0b5730f | 89 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} |
cd580c6e | 90 | |
f6ee4061 | 91 | %py3_install |
cd580c6e MG |
92 | |
93 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
94 | ||
95 | %clean | |
96 | rm -rf $RPM_BUILD_ROOT | |
97 | ||
98 | %files | |
99 | %defattr(644,root,root,755) | |
f3ca9dc4 | 100 | %doc CHANGES LICENSE README.rst |
f0b5730f | 101 | %{py3_sitescriptdir}/pyparsing |
3bb04556 | 102 | %{py3_sitescriptdir}/pyparsing-*.egg-info |
cd580c6e | 103 | |
2199724f | 104 | %if %{with doc} |
cd580c6e MG |
105 | %files doc |
106 | %defattr(644,root,root,755) | |
f3ca9dc4 | 107 | %doc docs/_build/html/{_static,*.html,*.js} |
2199724f | 108 | %endif |
cd580c6e MG |
109 | |
110 | %files examples | |
111 | %defattr(644,root,root,755) | |
112 | %{_examplesdir}/%{name}-%{version} |