]>
Commit | Line | Data |
---|---|---|
f0a811fc JB |
1 | # |
2 | # Conditional build: | |
fbd99d14 JB |
3 | %bcond_without python2 # CPython 2.x module |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without tests # unit tests | |
f0a811fc JB |
6 | # |
7 | Summary: C Parser in Python 2 | |
8 | Summary(pl.UTF-8): Parser języka C w Pythonie 2 | |
9 | Name: python-pycparser | |
5c973245 | 10 | Version: 2.21 |
eed1ccf9 | 11 | Release: 2 |
f0a811fc JB |
12 | License: BSD |
13 | Group: Libraries/Python | |
fbd99d14 JB |
14 | #Source0Download: https://pypi.org/simple/pycparser/ |
15 | Source0: https://files.pythonhosted.org/packages/source/p/pycparser/pycparser-%{version}.tar.gz | |
5c973245 | 16 | # Source0-md5: 48f7d743bf018f7bb2ffc5fb976d1492 |
f0a811fc JB |
17 | URL: https://github.com/eliben/pycparser |
18 | %if %{with python2} | |
743f9224 JB |
19 | BuildRequires: python >= 1:2.7 |
20 | BuildRequires: python-modules >= 1:2.7 | |
21 | BuildRequires: python-setuptools | |
f0a811fc JB |
22 | %endif |
23 | %if %{with python3} | |
743f9224 JB |
24 | BuildRequires: python3 >= 1:3.4 |
25 | BuildRequires: python3-devel >= 1:3.4 | |
26 | BuildRequires: python3-setuptools | |
f0a811fc JB |
27 | %endif |
28 | BuildRequires: rpm-pythonprov | |
743f9224 JB |
29 | BuildRequires: rpmbuild(macros) >= 1.714 |
30 | Requires: python-modules >= 1:2.7 | |
f0a811fc JB |
31 | BuildArch: noarch |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
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. | |
38 | ||
39 | This package contains Python 2 module. | |
40 | ||
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. | |
45 | ||
46 | Ten pakiet zawiera moduł Pythona 2. | |
47 | ||
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 | |
743f9224 | 52 | Requires: python3-modules >= 1:3.4 |
f0a811fc JB |
53 | |
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. | |
58 | ||
59 | This package contains Python 3 module. | |
60 | ||
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. | |
65 | ||
66 | Ten pakiet zawiera moduł Pythona 3. | |
67 | ||
68 | %prep | |
fbd99d14 | 69 | %setup -q -n pycparser-%{version} |
f0a811fc JB |
70 | |
71 | %build | |
72 | %if %{with python2} | |
84437a10 | 73 | %py_build |
fbd99d14 JB |
74 | |
75 | %if %{with tests} | |
5c973245 | 76 | %{__python} tests/test_c_parser.py |
fbd99d14 | 77 | %endif |
f0a811fc | 78 | %endif |
fbd99d14 | 79 | |
f0a811fc | 80 | %if %{with python3} |
84437a10 | 81 | %py3_build |
fbd99d14 JB |
82 | |
83 | %if %{with tests} | |
5c973245 | 84 | %{__python3} tests/test_c_parser.py |
fbd99d14 | 85 | %endif |
f0a811fc JB |
86 | %endif |
87 | ||
88 | %install | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %if %{with python2} | |
84437a10 | 92 | %py_install |
f0a811fc JB |
93 | |
94 | %py_postclean | |
95 | %endif | |
96 | ||
97 | %if %{with python3} | |
84437a10 | 98 | %py3_install |
f0a811fc JB |
99 | %endif |
100 | ||
101 | %clean | |
102 | rm -rf $RPM_BUILD_ROOT | |
103 | ||
104 | %if %{with python2} | |
105 | %files | |
106 | %defattr(644,root,root,755) | |
fbd99d14 | 107 | %doc CHANGES LICENSE README.rst |
f0a811fc JB |
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 | |
114 | %endif | |
115 | ||
116 | %if %{with python3} | |
117 | %files -n python3-pycparser | |
118 | %defattr(644,root,root,755) | |
fbd99d14 | 119 | %doc CHANGES LICENSE README.rst |
f0a811fc JB |
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 | |
128 | %endif |