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