Repository navigation
Expand file tree
/
Copy pathpython3-cffi.spec
More file actions
107 lines (90 loc) · 2.97 KB
/
Copy pathpython3-cffi.spec
File metadata and controls
107 lines (90 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#
# Conditional build:
%bcond_without doc # Sphinx based documentation
%bcond_without tests # unit tests
#
Summary: Foreign Function Interface for Python 3 calling C code
Summary(pl.UTF-8): Interfejs funkcji obcych (FFI) dla Pythona 3 wywołującego kod w C
Name: python3-cffi
Version: 2.1.1
Release: 1
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/cffi/
Source0: https://files.pythonhosted.org/packages/source/c/cffi/cffi-%{version}.tar.gz
# Source0-md5: 32f0067c08d797dd28cef1544105caa3
URL: http://cffi.readthedocs.org/
BuildRequires: libffi-devel >= 3
BuildRequires: pkgconfig
BuildRequires: python3 >= 1:3.10
BuildRequires: python3-devel >= 1:3.10
BuildRequires: python3-setuptools >= 1:77.0.3
%if %{with tests}
BuildRequires: python3-pycparser
BuildRequires: python3-pytest
BuildRequires: virtualenv
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
%{?with_doc:BuildRequires: sphinx-pdg}
Requires: python3-modules >= 1:3.10
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Foreign Function Interface for Python calling C code. The aim of this
project is to provide a convenient and reliable way of calling C code
from Python without learning additional language or API.
This package contains Python 3 module.
%description -l pl.UTF-8
CFFI to interfejs funkcji obcych (FFI - foreign Function Interface) do
wywoływania kodu w C z Pythona. Celem projektu jest dostarczenie
wygodnego i wiarygodnego sposobu wywoływania kodu w C z Pythona bez
potrzeby nauki dodatkowego języka lub API.
Ten pakiet zawiera moduł Pythona 3.
%package apidocs
Summary: API documentation for Python CFFI module
Summary(pl.UTF-8): Dokumentacja API modułu Pythona CFFI
Group: Documentation
BuildArch: noarch
%description apidocs
API documentation for Python CFFI module.
%description apidocs -l pl.UTF-8
Dokumentacja API modułu Pythona CFFI.
%prep
%setup -q -n cffi-%{version}
# This is trying to download setuptools on python 3.13 and venv
%{__mv} testing/cffi0/{,NOT-}test_zintegration.py
# pip-installs meson-python from PyPI into a venv
%{__mv} testing/cffi1/{,NOT-}test_cffi_gen_src_meson.py
%build
%py3_build
%if %{with tests}
PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
PYTHONPATH=$(pwd):$(echo $(pwd)/build-3/lib.linux-*) \
%{__python3} -m pytest src/c testing
%endif
%if %{with doc}
%{__make} -C doc html
%endif
%install
rm -rf $RPM_BUILD_ROOT
%py3_install
%clean
rm -rf $RPM_BUILD_ROOT
%files -n python3-cffi
%defattr(644,root,root,755)
%doc AUTHORS LICENSE README.md
%attr(755,root,root) %{_bindir}/cffi-gen-src
%attr(755,root,root) %{py3_sitedir}/_cffi_backend.cpython-*.so
%dir %{py3_sitedir}/cffi
%{py3_sitedir}/cffi/_cffi_errors.h
%{py3_sitedir}/cffi/_cffi_include.h
%{py3_sitedir}/cffi/_embedding.h
%{py3_sitedir}/cffi/parse_c_type.h
%{py3_sitedir}/cffi/*.py
%{py3_sitedir}/cffi/__pycache__
%{py3_sitedir}/cffi-%{version}-py*.egg-info
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
%doc doc/build/html/{_static,*.html,*.js}
%endif