]> git.pld-linux.org Git - packages/python-cffi.git/blob - python-cffi.spec
BR: python-setuptools
[packages/python-cffi.git] / python-cffi.spec
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 %bcond_without  tests   # unit tests
7 #
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
10 Name:           python-cffi
11 Version:        1.15.0
12 Release:        4
13 License:        MIT
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:  f3a3f26cd3335fc597479c9475da0a0b
18 URL:            http://cffi.readthedocs.org/
19 BuildRequires:  libffi-devel >= 3
20 BuildRequires:  pkgconfig
21 %if %{with python2}
22 BuildRequires:  python >= 1:2.6
23 BuildRequires:  python-devel >= 1:2.6
24 BuildRequires:  python-setuptools
25 %if %{with tests}
26 BuildRequires:  python-pycparser
27 BuildRequires:  python-pytest
28 BuildRequires:  virtualenv
29 %endif
30 %endif
31 %if %{with python3}
32 BuildRequires:  python3 >= 1:3.2
33 BuildRequires:  python3-devel >= 1:3.2
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-pycparser
37 BuildRequires:  python3-pytest
38 BuildRequires:  virtualenv
39 %endif
40 %endif
41 BuildRequires:  rpm-pythonprov
42 BuildRequires:  rpmbuild(macros) >= 1.714
43 %{?with_doc:BuildRequires:      sphinx-pdg}
44 Requires:       python-modules >= 1:2.6
45 Requires:       python-pycparser
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 Foreign Function Interface for Python calling C code. The aim of this
50 project is to provide a convenient and reliable way of calling C code
51 from Python without learning additional language or API.
52
53 This package contains Python 2 module.
54
55 %description -l pl.UTF-8
56 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
57 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
58 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
59 potrzeby nauki dodatkowego języka lub API.
60
61 Ten pakiet zawiera moduł Pythona 2.
62
63 %package -n python3-cffi
64 Summary:        Foreign Function Interface for Python 3 calling C code
65 Summary(pl.UTF-8):      Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
66 Group:          Libraries/Python
67 Requires:       python3-modules >= 1:3.2
68 Requires:       python3-pycparser
69
70 %description -n python3-cffi
71 Foreign Function Interface for Python calling C code. The aim of this
72 project is to provide a convenient and reliable way of calling C code
73 from Python without learning additional language or API.
74
75 This package contains Python 3 module.
76
77 %description -n python3-cffi -l pl.UTF-8
78 CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
79 wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
80 wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
81 potrzeby nauki dodatkowego języka lub API.
82
83 Ten pakiet zawiera moduł Pythona 3.
84
85 %package apidocs
86 Summary:        API documentation for Python CFFI module
87 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona CFFI
88 Group:          Documentation
89 BuildArch:      noarch
90
91 %description apidocs
92 API documentation for Python CFFI module.
93
94 %description apidocs -l pl.UTF-8
95 Dokumentacja API modułu Pythona CFFI.
96
97 %prep
98 %setup -q -n cffi-%{version}
99
100 %build
101 %if %{with python2}
102 %py_build
103
104 %if %{with tests}
105 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
106 PYTHONPATH=$(pwd):$(echo $(pwd)/build-2/lib.linux-*) \
107 %{__python} -m pytest c testing
108 %endif
109 %endif
110
111 %if %{with python3}
112 %py3_build
113
114 %if %{with tests}
115 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
116 PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
117 %{__python3} -m pytest c testing
118 %endif
119 %endif
120
121 %if %{with doc}
122 %{__make} -C doc html
123 %endif
124
125 %install
126 rm -rf $RPM_BUILD_ROOT
127
128 %if %{with python2}
129 %py_install
130
131 %py_postclean
132 %endif
133
134 %if %{with python3}
135 %py3_install
136 %endif
137
138 %clean
139 rm -rf $RPM_BUILD_ROOT
140
141 %if %{with python2}
142 %files
143 %defattr(644,root,root,755)
144 %doc AUTHORS LICENSE README.md
145 %attr(755,root,root) %{py_sitedir}/_cffi_backend.so
146 %dir %{py_sitedir}/cffi
147 %{py_sitedir}/cffi/_cffi_errors.h
148 %{py_sitedir}/cffi/_cffi_include.h
149 %{py_sitedir}/cffi/_embedding.h
150 %{py_sitedir}/cffi/parse_c_type.h
151 %{py_sitedir}/cffi/*.py[co]
152 %{py_sitedir}/cffi-%{version}-py*.egg-info
153 %endif
154
155 %if %{with python3}
156 %files -n python3-cffi
157 %defattr(644,root,root,755)
158 %doc AUTHORS LICENSE README.md
159 %attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
160 %dir %{py3_sitedir}/cffi
161 %{py3_sitedir}/cffi/_cffi_errors.h
162 %{py3_sitedir}/cffi/_cffi_include.h
163 %{py3_sitedir}/cffi/_embedding.h
164 %{py3_sitedir}/cffi/parse_c_type.h
165 %{py3_sitedir}/cffi/*.py
166 %{py3_sitedir}/cffi/__pycache__
167 %{py3_sitedir}/cffi-%{version}-py*.egg-info
168 %endif
169
170 %if %{with doc}
171 %files apidocs
172 %defattr(644,root,root,755)
173 %doc doc/build/html/{_static,*.html,*.js}
174 %endif
This page took 0.166295 seconds and 3 git commands to generate.