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