]> git.pld-linux.org Git - packages/python-pycparser.git/blob - python-pycparser.spec
rebuild with python 3.10
[packages/python-pycparser.git] / python-pycparser.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_without  python3 # CPython 3.x module
5 %bcond_without  tests   # unit tests
6 #
7 Summary:        C Parser in Python 2
8 Summary(pl.UTF-8):      Parser języka C w Pythonie 2
9 Name:           python-pycparser
10 Version:        2.21
11 Release:        2
12 License:        BSD
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
18 %if %{with python2}
19 BuildRequires:  python >= 1:2.7
20 BuildRequires:  python-modules >= 1:2.7
21 BuildRequires:  python-setuptools
22 %endif
23 %if %{with python3}
24 BuildRequires:  python3 >= 1:3.4
25 BuildRequires:  python3-devel >= 1:3.4
26 BuildRequires:  python3-setuptools
27 %endif
28 BuildRequires:  rpm-pythonprov
29 BuildRequires:  rpmbuild(macros) >= 1.714
30 Requires:       python-modules >= 1:2.7
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
52 Requires:       python3-modules >= 1:3.4
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
69 %setup -q -n pycparser-%{version}
70
71 %build
72 %if %{with python2}
73 %py_build
74
75 %if %{with tests}
76 %{__python} tests/test_c_parser.py
77 %endif
78 %endif
79
80 %if %{with python3}
81 %py3_build
82
83 %if %{with tests}
84 %{__python3} tests/test_c_parser.py
85 %endif
86 %endif
87
88 %install
89 rm -rf $RPM_BUILD_ROOT
90
91 %if %{with python2}
92 %py_install
93
94 %py_postclean
95 %endif
96
97 %if %{with python3}
98 %py3_install
99 %endif
100
101 %clean
102 rm -rf $RPM_BUILD_ROOT
103
104 %if %{with python2}
105 %files
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
114 %endif
115
116 %if %{with python3}
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
128 %endif
This page took 0.043158 seconds and 3 git commands to generate.