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
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
11 # keep 1.15.x here for python2 support
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
23 BuildRequires: python >= 1:2.6
24 BuildRequires: python-devel >= 1:2.6
25 BuildRequires: python-setuptools
27 BuildRequires: python-pycparser
28 BuildRequires: python-pytest
29 BuildRequires: rpm-build >= 4.6
30 BuildRequires: virtualenv
34 BuildRequires: python3 >= 1:3.2
35 BuildRequires: python3-devel >= 1:3.2
36 BuildRequires: python3-setuptools
38 BuildRequires: python3-pycparser
39 BuildRequires: python3-pytest
40 BuildRequires: virtualenv
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)
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.
55 This package contains Python 2 module.
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.
63 Ten pakiet zawiera moduł Pythona 2.
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
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.
77 This package contains Python 3 module.
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.
85 Ten pakiet zawiera moduł Pythona 3.
88 Summary: API documentation for Python CFFI module
89 Summary(pl.UTF-8): Dokumentacja API modułu Pythona CFFI
94 API documentation for Python CFFI module.
96 %description apidocs -l pl.UTF-8
97 Dokumentacja API modułu Pythona CFFI.
100 %setup -q -n cffi-%{version}
107 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
108 PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
109 %{__python} -m pytest c testing
117 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
118 PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
119 %{__python3} -m pytest c testing
124 %{__make} -C doc html
128 rm -rf $RPM_BUILD_ROOT
141 rm -rf $RPM_BUILD_ROOT
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
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
174 %defattr(644,root,root,755)
175 %doc doc/build/html/{_static,*.html,*.js}