]>
Commit | Line | Data |
---|---|---|
a3ed0930 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without python2 # CPython 2.x module | |
4 | %bcond_without python3 # CPython 3.x module | |
5 | %bcond_without doc # sphinx based documentation | |
6 | # | |
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 | |
9 | Name: python-cffi | |
f4001aff | 10 | Version: 1.2.1 |
8084c254 | 11 | Release: 4 |
a3ed0930 JB |
12 | License: MIT |
13 | Group: Libraries/Python | |
2c51b538 | 14 | #Source0Download: https://pypi.python.org/pypi/cffi |
a3ed0930 | 15 | Source0: https://pypi.python.org/packages/source/c/cffi/cffi-%{version}.tar.gz |
f4001aff | 16 | # Source0-md5: faca1e420e80433db409bb1bdd0a3f45 |
a3ed0930 | 17 | URL: http://cffi.readthedocs.org/ |
2617e1cf JB |
18 | BuildRequires: libffi-devel >= 3 |
19 | BuildRequires: pkgconfig | |
a3ed0930 JB |
20 | %if %{with python2} |
21 | BuildRequires: python >= 1:2.6 | |
22 | BuildRequires: python-devel >= 1:2.6 | |
a3ed0930 JB |
23 | %endif |
24 | %if %{with python3} | |
2617e1cf JB |
25 | BuildRequires: python3 >= 1:3.2 |
26 | BuildRequires: python3-devel >= 1:3.2 | |
a3ed0930 | 27 | %endif |
a3ed0930 | 28 | BuildRequires: rpm-pythonprov |
7fa0d53f | 29 | BuildRequires: rpmbuild(macros) >= 1.710 |
2617e1cf | 30 | %{?with_doc:BuildRequires: sphinx-pdg} |
a3ed0930 | 31 | Requires: python-modules |
494e0686 | 32 | Requires: python-pycparser |
a3ed0930 JB |
33 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
34 | ||
35 | %description | |
36 | Foreign Function Interface for Python calling C code. The aim of this | |
37 | project is to provide a convenient and reliable way of calling C code | |
38 | from Python without learning additional language or API. | |
39 | ||
40 | This package contains Python 2 module. | |
41 | ||
42 | %description -l pl.UTF-8 | |
43 | CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do | |
44 | wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie | |
45 | wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez | |
46 | potrzeby nauki dodatkowego języka lub API. | |
47 | ||
48 | Ten pakiet zawiera moduł Pythona 2. | |
49 | ||
50 | %package -n python3-cffi | |
51 | Summary: Foreign Function Interface for Python 3 calling C code | |
52 | Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C | |
53 | Group: Libraries/Python | |
54 | Requires: python3-modules | |
494e0686 | 55 | Requires: python3-pycparser |
a3ed0930 JB |
56 | |
57 | %description -n python3-cffi | |
58 | Foreign Function Interface for Python calling C code. The aim of this | |
59 | project is to provide a convenient and reliable way of calling C code | |
60 | from Python without learning additional language or API. | |
61 | ||
62 | This package contains Python 3 module. | |
63 | ||
64 | %description -n python3-cffi -l pl.UTF-8 | |
65 | CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do | |
66 | wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie | |
67 | wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez | |
68 | potrzeby nauki dodatkowego języka lub API. | |
69 | ||
70 | Ten pakiet zawiera moduł Pythona 3. | |
71 | ||
72 | %prep | |
73 | %setup -q -n cffi-%{version} | |
74 | ||
75 | %build | |
76 | %if %{with python2} | |
8084c254 | 77 | %py_build |
a3ed0930 JB |
78 | %endif |
79 | %if %{with python3} | |
8084c254 | 80 | %py3_build |
a3ed0930 JB |
81 | %endif |
82 | ||
83 | %if %{with doc} | |
84 | %{__make} -C doc html | |
85 | %endif | |
86 | ||
87 | %install | |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
90 | %if %{with python2} | |
8084c254 | 91 | %py_install |
a3ed0930 JB |
92 | |
93 | %py_postclean | |
94 | %endif | |
95 | ||
96 | %if %{with python3} | |
8084c254 | 97 | %py3_install |
a3ed0930 JB |
98 | %endif |
99 | ||
100 | %clean | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | ||
103 | %if %{with python2} | |
104 | %files | |
105 | %defattr(644,root,root,755) | |
2617e1cf | 106 | %doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}} |
a3ed0930 JB |
107 | %attr(755,root,root) %{py_sitedir}/_cffi_backend.so |
108 | %dir %{py_sitedir}/cffi | |
f4001aff JB |
109 | %{py_sitedir}/cffi/_cffi_include.h |
110 | %{py_sitedir}/cffi/parse_c_type.h | |
a3ed0930 JB |
111 | %{py_sitedir}/cffi/*.py[co] |
112 | %{py_sitedir}/cffi-%{version}-py*.egg-info | |
113 | %endif | |
114 | ||
115 | %if %{with python3} | |
116 | %files -n python3-cffi | |
117 | %defattr(644,root,root,755) | |
2617e1cf | 118 | %doc LICENSE %{?with_doc:doc/build/html/{*.html,*.js,_static}} |
a3ed0930 | 119 | %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so |
494e0686 | 120 | %dir %{py3_sitedir}/cffi |
f4001aff JB |
121 | %{py3_sitedir}/cffi/_cffi_include.h |
122 | %{py3_sitedir}/cffi/parse_c_type.h | |
a3ed0930 JB |
123 | %{py3_sitedir}/cffi/*.py |
124 | %{py3_sitedir}/cffi/__pycache__ | |
125 | %{py3_sitedir}/cffi-%{version}-py*.egg-info | |
126 | %endif |