3 %bcond_without python2 # CPython 2.x module
4 %bcond_with python3 # CPython 3.x module
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
14 Group: Libraries/Python
15 #Source0Download: https://pypi.org/simple/cffi/
16 Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
17 # Source0-md5: f493860a6e98cd0c4178149568a6b4f6
18 URL: http://cffi.readthedocs.org/
19 BuildRequires: libffi-devel >= 3
20 BuildRequires: pkgconfig
22 BuildRequires: python >= 1:2.6
23 BuildRequires: python-devel >= 1:2.6
24 BuildRequires: python-setuptools
26 BuildRequires: python-pycparser
27 BuildRequires: python-pytest
28 BuildRequires: rpm-build >= 4.6
29 BuildRequires: virtualenv
33 BuildRequires: python3 >= 1:3.2
34 BuildRequires: python3-devel >= 1:3.2
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-pycparser
38 BuildRequires: python3-pytest
39 BuildRequires: virtualenv
42 BuildRequires: rpm-pythonprov
43 BuildRequires: rpmbuild(macros) >= 1.714
44 %{?with_doc:BuildRequires: sphinx-pdg}
45 Requires: python-modules >= 1:2.6
46 Requires: python-pycparser
47 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
50 Foreign Function Interface for Python calling C code. The aim of this
51 project is to provide a convenient and reliable way of calling C code
52 from Python without learning additional language or API.
54 This package contains Python 2 module.
56 %description -l pl.UTF-8
57 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
58 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
59 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
60 potrzeby nauki dodatkowego języka lub API.
62 Ten pakiet zawiera moduł Pythona 2.
64 %package -n python3-cffi
65 Summary: Foreign Function Interface for Python 3 calling C code
66 Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
67 Group: Libraries/Python
68 Requires: python3-modules >= 1:3.2
69 Requires: python3-pycparser
71 %description -n python3-cffi
72 Foreign Function Interface for Python calling C code. The aim of this
73 project is to provide a convenient and reliable way of calling C code
74 from Python without learning additional language or API.
76 This package contains Python 3 module.
78 %description -n python3-cffi -l pl.UTF-8
79 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
80 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
81 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
82 potrzeby nauki dodatkowego języka lub API.
84 Ten pakiet zawiera moduł Pythona 3.
87 Summary: API documentation for Python CFFI module
88 Summary(pl.UTF-8): Dokumentacja API modułu Pythona CFFI
93 API documentation for Python CFFI module.
95 %description apidocs -l pl.UTF-8
96 Dokumentacja API modułu Pythona CFFI.
99 %setup -q -n cffi-%{version}
106 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
107 PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
108 %{__python} -m pytest c testing
116 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
117 PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
118 %{__python3} -m pytest c testing
123 %{__make} -C doc html
127 rm -rf $RPM_BUILD_ROOT
140 rm -rf $RPM_BUILD_ROOT
144 %defattr(644,root,root,755)
145 %doc AUTHORS LICENSE README.md
146 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
147 %dir %{py_sitedir}/cffi
148 %{py_sitedir}/cffi/_cffi_errors.h
149 %{py_sitedir}/cffi/_cffi_include.h
150 %{py_sitedir}/cffi/_embedding.h
151 %{py_sitedir}/cffi/parse_c_type.h
152 %{py_sitedir}/cffi/*.py[co]
153 %{py_sitedir}/cffi-%{version}-py*.egg-info
157 %files -n python3-cffi
158 %defattr(644,root,root,755)
159 %doc AUTHORS LICENSE README.md
160 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
161 %dir %{py3_sitedir}/cffi
162 %{py3_sitedir}/cffi/_cffi_errors.h
163 %{py3_sitedir}/cffi/_cffi_include.h
164 %{py3_sitedir}/cffi/_embedding.h
165 %{py3_sitedir}/cffi/parse_c_type.h
166 %{py3_sitedir}/cffi/*.py
167 %{py3_sitedir}/cffi/__pycache__
168 %{py3_sitedir}/cffi-%{version}-py*.egg-info
173 %defattr(644,root,root,755)
174 %doc doc/build/html/{_static,*.html,*.js}