3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # sphinx based documentation
7 Summary: Foreign Function Interface for Python 2 calling C code
8 Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 2 wywołującego kod w C
13 Group: Libraries/Python
14 Source0: https://pypi.python.org/packages/source/c/cffi/cffi-%{version}.tar.gz
15 # Source0-md5: 474b5a68299a6f05009171de1dc91be6
16 URL: http://cffi.readthedocs.org/
17 BuildRequires: libffi-devel >= 3
18 BuildRequires: pkgconfig
20 BuildRequires: python >= 1:2.6
21 BuildRequires: python-devel >= 1:2.6
24 BuildRequires: python3 >= 1:3.2
25 BuildRequires: python3-devel >= 1:3.2
27 BuildRequires: rpm-pythonprov
28 BuildRequires: rpmbuild(macros) >= 1.612
29 %{?with_doc:BuildRequires: sphinx-pdg}
30 Requires: python-modules
31 Requires: python-pycparser
32 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
35 Foreign Function Interface for Python calling C code. The aim of this
36 project is to provide a convenient and reliable way of calling C code
37 from Python without learning additional language or API.
39 This package contains Python 2 module.
41 %description -l pl.UTF-8
42 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
43 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
44 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
45 potrzeby nauki dodatkowego języka lub API.
47 Ten pakiet zawiera moduł Pythona 2.
49 %package -n python3-cffi
50 Summary: Foreign Function Interface for Python 3 calling C code
51 Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
52 Group: Libraries/Python
53 Requires: python3-modules
54 Requires: python3-pycparser
56 %description -n python3-cffi
57 Foreign Function Interface for Python calling C code. The aim of this
58 project is to provide a convenient and reliable way of calling C code
59 from Python without learning additional language or API.
61 This package contains Python 3 module.
63 %description -n python3-cffi -l pl.UTF-8
64 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
65 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
66 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
67 potrzeby nauki dodatkowego języka lub API.
69 Ten pakiet zawiera moduł Pythona 3.
72 %setup -q -n cffi-%{version}
76 %{__python} setup.py build \
80 %{__python3} setup.py build \
89 rm -rf $RPM_BUILD_ROOT
92 %{__python} setup.py \
94 --build-base build-2 \
96 --root=$RPM_BUILD_ROOT \
103 %{__python3} setup.py \
105 --build-base build-3 \
107 --root=$RPM_BUILD_ROOT \
112 rm -rf $RPM_BUILD_ROOT
116 %defattr(644,root,root,755)
117 %doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}}
118 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
119 %dir %{py_sitedir}/cffi
120 %{py_sitedir}/cffi/*.py[co]
121 %{py_sitedir}/cffi-%{version}-py*.egg-info
125 %files -n python3-cffi
126 %defattr(644,root,root,755)
127 %doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}}
128 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
129 %dir %{py3_sitedir}/cffi
130 %{py3_sitedir}/cffi/*.py
131 %{py3_sitedir}/cffi/__pycache__
132 %{py3_sitedir}/cffi-%{version}-py*.egg-info