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