3 %bcond_without tests # do not perform "make test"
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
7 %define module spark_parser
8 %define egg_name spark_parser
9 %define pypi_name spark_parser
10 Summary: An Early-Algorithm Context-free grammar Parser
11 Name: python-%{module}
15 Group: Libraries/Python
16 Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
17 # Source0-md5: e3c8f2e41572075d9e08daabb5f24253
18 URL: https://github.com/rocky/python-spark/
19 BuildRequires: rpm-pythonprov
20 BuildRequires: rpmbuild(macros) >= 1.714
22 BuildRequires: python-nose >= 1.0
23 BuildRequires: python-setuptools
26 BuildRequires: python3-nose >= 1.0
27 BuildRequires: python3-setuptools
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 SPARK stands for Scanning, Parsing, and Rewriting Kit. It uses Jay
34 Early's algorithm for parsing context free grammars, and comes with
35 some generic Abstract Syntax Tree routines. There is also a prototype
36 scanner which does its job by combining Python regular expressions.
38 Note: Early algorithm parsers are almost linear when given an LR
39 grammar. These are grammars which are left-recursive.
41 %package -n python3-%{module}
42 Summary: An Early-Algorithm LR Parser
43 Group: Libraries/Python
45 %description -n python3-%{module}
46 SPARK stands for Scanning, Parsing, and Rewriting Kit. It uses Jay
47 Early's algorithm for parsing context free grammars, and comes with
48 some generic Abstract Syntax Tree routines. There is also a prototype
49 scanner which does its job by combining Python regular expressions.
51 Note: Early algorithm parsers are almost linear when given an LR
52 grammar. These are grammars which are left-recursive.
55 %setup -q -n %{module}-%{version}
57 # Remove bundled egg-info
58 %{__rm} -r %{module}.egg-info
62 %py_build %{?with_tests:test}
66 %py3_build %{?with_tests:test}
70 rm -rf $RPM_BUILD_ROOT
81 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %doc README.rst LICENSE
87 %{py_sitescriptdir}/%{module}
88 %{py_sitescriptdir}/%{module}-%{version}-py*.egg-info
92 %files -n python3-%{module}
93 %defattr(644,root,root,755)
94 %doc README.rst LICENSE
95 %{py3_sitescriptdir}/%{module}
96 %{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info