3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without tests # unit tests
7 Summary: C Parser in Python 2
8 Summary(pl.UTF-8): Parser języka C w Pythonie 2
13 Group: Libraries/Python
14 #Source0Download: https://pypi.org/simple/pycparser/
15 Source0: https://files.pythonhosted.org/packages/source/p/pycparser/pycparser-%{version}.tar.gz
16 # Source0-md5: 48f7d743bf018f7bb2ffc5fb976d1492
17 URL: https://github.com/eliben/pycparser
19 BuildRequires: python >= 1:2.7
20 BuildRequires: python-modules >= 1:2.7
21 BuildRequires: python-setuptools
24 BuildRequires: python3 >= 1:3.4
25 BuildRequires: python3-devel >= 1:3.4
26 BuildRequires: python3-setuptools
28 BuildRequires: rpm-pythonprov
29 BuildRequires: rpmbuild(macros) >= 1.714
30 Requires: python-modules >= 1:2.7
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 pycparser is a parser for the C language, written in pure Python. It
36 is a module designed to be easily integrated into applications that
37 need to parse C source code.
39 This package contains Python 2 module.
41 %description -l pl.UTF-8
42 pycparser to parser języka C napisany w czystym Pythonie. Jest to
43 moduł zaprojektowany tak, aby można go było łatwo zintegrować w
44 aplikacjach wymagających analizy kodu źródłowego w C.
46 Ten pakiet zawiera moduł Pythona 2.
48 %package -n python3-pycparser
49 Summary: C Parser in Python 3
50 Summary(pl.UTF-8): Parser języka C w Pythonie 3
51 Group: Libraries/Python
52 Requires: python3-modules >= 1:3.4
54 %description -n python3-pycparser
55 pycparser is a parser for the C language, written in pure Python. It
56 is a module designed to be easily integrated into applications that
57 need to parse C source code.
59 This package contains Python 3 module.
61 %description -n python3-pycparser -l pl.UTF-8
62 pycparser to parser języka C napisany w czystym Pythonie. Jest to
63 moduł zaprojektowany tak, aby można go było łatwo zintegrować w
64 aplikacjach wymagających analizy kodu źródłowego w C.
66 Ten pakiet zawiera moduł Pythona 3.
69 %setup -q -n pycparser-%{version}
76 %{__python} tests/test_c_parser.py
84 %{__python3} tests/test_c_parser.py
89 rm -rf $RPM_BUILD_ROOT
102 rm -rf $RPM_BUILD_ROOT
106 %defattr(644,root,root,755)
107 %doc CHANGES LICENSE README.rst
108 %dir %{py_sitescriptdir}/pycparser
109 %{py_sitescriptdir}/pycparser/*.py[co]
110 %{py_sitescriptdir}/pycparser/_c_ast.cfg
111 %dir %{py_sitescriptdir}/pycparser/ply
112 %{py_sitescriptdir}/pycparser/ply/*.py[co]
113 %{py_sitescriptdir}/pycparser-%{version}-py*.egg-info
117 %files -n python3-pycparser
118 %defattr(644,root,root,755)
119 %doc CHANGES LICENSE README.rst
120 %dir %{py3_sitescriptdir}/pycparser
121 %{py3_sitescriptdir}/pycparser/*.py
122 %{py3_sitescriptdir}/pycparser/_c_ast.cfg
123 %{py3_sitescriptdir}/pycparser/__pycache__
124 %dir %{py3_sitescriptdir}/pycparser/ply
125 %{py3_sitescriptdir}/pycparser/ply/*.py
126 %{py3_sitescriptdir}/pycparser/ply/__pycache__
127 %{py3_sitescriptdir}/pycparser-%{version}-py*.egg-info