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