]> git.pld-linux.org Git - packages/python-cffi.git/blob - python-cffi.spec
- python2 note
[packages/python-cffi.git] / python-cffi.spec
1 #
2 # Conditional build:
3 %bcond_without  python2 # CPython 2.x module
4 %bcond_with     python3 # CPython 3.x module (built from python3-cffi.spec)
5 %bcond_without  doc     # Sphinx based documentation
6 %bcond_without  tests   # unit tests
7 #
8 Summary:        Foreign Function Interface for Python 2 calling C code
9 Summary(pl.UTF-8):      Interfejs funkcji obcych (FFI) dla Pythona 2 wywołującego kod w C
10 Name:           python-cffi
11 # keep 1.15.x here for python2 support
12 Version:        1.15.1
13 Release:        2
14 License:        MIT
15 Group:          Libraries/Python
16 #Source0Download: https://pypi.org/simple/cffi/
17 Source0:        https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
18 # Source0-md5:  f493860a6e98cd0c4178149568a6b4f6
19 URL:            http://cffi.readthedocs.org/
20 BuildRequires:  libffi-devel >= 3
21 BuildRequires:  pkgconfig
22 %if %{with python2}
23 BuildRequires:  python >= 1:2.6
24 BuildRequires:  python-devel >= 1:2.6
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-pycparser
28 BuildRequires:  python-pytest
29 BuildRequires:  rpm-build >= 4.6
30 BuildRequires:  virtualenv
31 %endif
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3 >= 1:3.2
35 BuildRequires:  python3-devel >= 1:3.2
36 BuildRequires:  python3-setuptools
37 %if %{with tests}
38 BuildRequires:  python3-pycparser
39 BuildRequires:  python3-pytest
40 BuildRequires:  virtualenv
41 %endif
42 %endif
43 BuildRequires:  rpm-pythonprov
44 BuildRequires:  rpmbuild(macros) >= 1.714
45 %{?with_doc:BuildRequires:      sphinx-pdg}
46 Requires:       python-modules >= 1:2.6
47 Requires:       python-pycparser
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 Foreign Function Interface for Python calling C code. The aim of this
52 project is to provide a convenient and reliable way of calling C code
53 from Python without learning additional language or API.
54
55 This package contains Python 2 module.
56
57 %description -l pl.UTF-8
58 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
59 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
60 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
61 potrzeby nauki dodatkowego języka lub API.
62
63 Ten pakiet zawiera moduł Pythona 2.
64
65 %package -n python3-cffi
66 Summary:        Foreign Function Interface for Python 3 calling C code
67 Summary(pl.UTF-8):      Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
68 Group:          Libraries/Python
69 Requires:       python3-modules >= 1:3.2
70 Requires:       python3-pycparser
71
72 %description -n python3-cffi
73 Foreign Function Interface for Python calling C code. The aim of this
74 project is to provide a convenient and reliable way of calling C code
75 from Python without learning additional language or API.
76
77 This package contains Python 3 module.
78
79 %description -n python3-cffi -l pl.UTF-8
80 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
81 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
82 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
83 potrzeby nauki dodatkowego języka lub API.
84
85 Ten pakiet zawiera moduł Pythona 3.
86
87 %package apidocs
88 Summary:        API documentation for Python CFFI module
89 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona CFFI
90 Group:          Documentation
91 BuildArch:      noarch
92
93 %description apidocs
94 API documentation for Python CFFI module.
95
96 %description apidocs -l pl.UTF-8
97 Dokumentacja API modułu Pythona CFFI.
98
99 %prep
100 %setup -q -n cffi-%{version}
101
102 %build
103 %if %{with python2}
104 %py_build
105
106 %if %{with tests}
107 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
108 PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
109 %{__python} -m pytest c testing
110 %endif
111 %endif
112
113 %if %{with python3}
114 %py3_build
115
116 %if %{with tests}
117 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
118 PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
119 %{__python3} -m pytest c testing
120 %endif
121 %endif
122
123 %if %{with doc}
124 %{__make} -C doc html
125 %endif
126
127 %install
128 rm -rf $RPM_BUILD_ROOT
129
130 %if %{with python2}
131 %py_install
132
133 %py_postclean
134 %endif
135
136 %if %{with python3}
137 %py3_install
138 %endif
139
140 %clean
141 rm -rf $RPM_BUILD_ROOT
142
143 %if %{with python2}
144 %files
145 %defattr(644,root,root,755)
146 %doc AUTHORS LICENSE README.md
147 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
148 %dir %{py_sitedir}/cffi
149 %{py_sitedir}/cffi/_cffi_errors.h
150 %{py_sitedir}/cffi/_cffi_include.h
151 %{py_sitedir}/cffi/_embedding.h
152 %{py_sitedir}/cffi/parse_c_type.h
153 %{py_sitedir}/cffi/*.py[co]
154 %{py_sitedir}/cffi-%{version}-py*.egg-info
155 %endif
156
157 %if %{with python3}
158 %files -n python3-cffi
159 %defattr(644,root,root,755)
160 %doc AUTHORS LICENSE README.md
161 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
162 %dir %{py3_sitedir}/cffi
163 %{py3_sitedir}/cffi/_cffi_errors.h
164 %{py3_sitedir}/cffi/_cffi_include.h
165 %{py3_sitedir}/cffi/_embedding.h
166 %{py3_sitedir}/cffi/parse_c_type.h
167 %{py3_sitedir}/cffi/*.py
168 %{py3_sitedir}/cffi/__pycache__
169 %{py3_sitedir}/cffi-%{version}-py*.egg-info
170 %endif
171
172 %if %{with doc}
173 %files apidocs
174 %defattr(644,root,root,755)
175 %doc doc/build/html/{_static,*.html,*.js}
176 %endif
This page took 0.300627 seconds and 3 git commands to generate.