1 # TODO: examine test_thread.py failures and remove --ignore from py.test invocations
4 %bcond_without python2 # CPython 2.x module
5 %bcond_without python3 # CPython 3.x module
6 %bcond_without doc # Sphinx based documentation
7 %bcond_without tests # unit tests
9 Summary: Foreign Function Interface for Python 2 calling C code
10 Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 2 wywołującego kod w C
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: ac8492f4ad952360737413e82d661908
19 Patch0: %{name}-tests.patch
20 URL: http://cffi.readthedocs.org/
21 BuildRequires: libffi-devel >= 3
22 BuildRequires: pkgconfig
24 BuildRequires: python >= 1:2.6
25 BuildRequires: python-devel >= 1:2.6
27 BuildRequires: python-pycparser
28 BuildRequires: python-pytest
32 BuildRequires: python3 >= 1:3.2
33 BuildRequires: python3-devel >= 1:3.2
35 BuildRequires: python3-pycparser
36 BuildRequires: python3-pytest
39 BuildRequires: rpm-pythonprov
40 BuildRequires: rpmbuild(macros) >= 1.714
41 %{?with_doc:BuildRequires: sphinx-pdg}
42 Requires: python-modules >= 1:2.6
43 Requires: python-pycparser
44 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47 Foreign Function Interface for Python calling C code. The aim of this
48 project is to provide a convenient and reliable way of calling C code
49 from Python without learning additional language or API.
51 This package contains Python 2 module.
53 %description -l pl.UTF-8
54 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
55 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
56 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
57 potrzeby nauki dodatkowego języka lub API.
59 Ten pakiet zawiera moduł Pythona 2.
61 %package -n python3-cffi
62 Summary: Foreign Function Interface for Python 3 calling C code
63 Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
64 Group: Libraries/Python
65 Requires: python3-modules >= 1:3.2
66 Requires: python3-pycparser
68 %description -n python3-cffi
69 Foreign Function Interface for Python calling C code. The aim of this
70 project is to provide a convenient and reliable way of calling C code
71 from Python without learning additional language or API.
73 This package contains Python 3 module.
75 %description -n python3-cffi -l pl.UTF-8
76 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
77 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
78 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
79 potrzeby nauki dodatkowego języka lub API.
81 Ten pakiet zawiera moduł Pythona 3.
84 Summary: API documentation for Python CFFI module
85 Summary(pl.UTF-8): Dokumentacja API modułu Pythona CFFI
87 %if "%{_rpmversion}" >= "5"
92 API documentation for Python CFFI module.
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API modułu Pythona CFFI.
98 %setup -q -n cffi-%{version}
106 PYTHONPATH=$(echo build-2/lib.linux-*) \
107 py.test-2 --ignore=testing/embedding/test_thread.py c testing
115 PYTHONPATH=$(echo build-3/lib.linux-*) \
116 py.test-3 --ignore=testing/embedding/test_thread.py c testing
121 %{__make} -C doc html
125 rm -rf $RPM_BUILD_ROOT
138 rm -rf $RPM_BUILD_ROOT
142 %defattr(644,root,root,755)
143 %doc AUTHORS LICENSE README.md
144 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
145 %dir %{py_sitedir}/cffi
146 %{py_sitedir}/cffi/_cffi_errors.h
147 %{py_sitedir}/cffi/_cffi_include.h
148 %{py_sitedir}/cffi/_embedding.h
149 %{py_sitedir}/cffi/parse_c_type.h
150 %{py_sitedir}/cffi/*.py[co]
151 %{py_sitedir}/cffi-%{version}-py*.egg-info
155 %files -n python3-cffi
156 %defattr(644,root,root,755)
157 %doc AUTHORS LICENSE README.md
158 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
159 %dir %{py3_sitedir}/cffi
160 %{py3_sitedir}/cffi/_cffi_errors.h
161 %{py3_sitedir}/cffi/_cffi_include.h
162 %{py3_sitedir}/cffi/_embedding.h
163 %{py3_sitedir}/cffi/parse_c_type.h
164 %{py3_sitedir}/cffi/*.py
165 %{py3_sitedir}/cffi/__pycache__
166 %{py3_sitedir}/cffi-%{version}-py*.egg-info
171 %defattr(644,root,root,755)
172 %doc doc/build/html/{_static,*.html,*.js}