3 %bcond_without python2 # CPython 2.x module
4 %bcond_without python3 # CPython 3.x module
5 %bcond_without doc # Sphinx documentation
6 %bcond_with tests # py.test calls
8 %define pytools_ver 2018.0.0
10 %if %{without python2}
13 %define pypi_name pyopencl
14 Summary: Python 2 wrapper for OpenCL
15 Summary(pl.UTF-8): Interfejs Pythona 2 do OpenCL
20 Group: Libraries/Python
21 #Source0Download: https://pypi.python.org/simple/pyopencl/
22 Source0: https://files.pythonhosted.org/packages/source/p/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
23 # Source0-md5: 4a834f4e0e60016c216b3d039a2952ee
24 URL: http://mathema.tician.de/software/pyopencl
25 BuildRequires: OpenCL-devel >= 1.2
26 BuildRequires: libstdc++-devel >= 6:4.3
27 BuildRequires: rpmbuild(macros) >= 1.710
29 BuildRequires: python-cffi >= 1.1.0
30 BuildRequires: python-devel >= 1:2.6
31 BuildRequires: python-numpy-devel
32 BuildRequires: python-setuptools
34 BuildRequires: python-Mako >= 0.3.6
35 BuildRequires: python-appdirs >= 1.4.0
36 BuildRequires: python-decorator >= 3.2.0
37 BuildRequires: python-pytest >= 2
38 BuildRequires: python-pytools >= %{pytools_ver}
39 BuildRequires: python-six >= 1.9.0
43 BuildRequires: python3-cffi >= 1.1.0
44 BuildRequires: python3-devel >= 1:3.2
45 BuildRequires: python3-numpy-devel
46 BuildRequires: python3-setuptools
48 BuildRequires: python3-Mako >= 0.3.6
49 BuildRequires: python3-appdirs >= 1.4.0
50 BuildRequires: python3-decorator >= 3.2.0
51 BuildRequires: python3-pytest >= 2
52 BuildRequires: python3-pytools >= %{pytools_ver}
53 BuildRequires: python3-six >= 1.9.0
56 BuildRequires: python3-numpy
57 BuildRequires: python3-pytools >= %{pytools_ver}
58 BuildRequires: python3-six >= 1.9.0
59 BuildRequires: python3-sphinx_bootstrap_theme
60 BuildRequires: sphinx-pdg-3
63 Requires: OpenCL >= 1.1
64 Requires: python-appdirs >= 1.4.0
65 Requires: python-decorator >= 3.2.0
66 Requires: python-numpy
67 Requires: python-pytools >= %{pytools_ver}
68 Suggests: python-Mako >= 0.3.6
69 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
72 PyOpenCL lets you access GPUs and other massively parallel compute
73 devices from Python. It tries to offer computing goodness in the
74 spirit of its sister project PyCUDA.
76 %description -l pl.UTF-8
77 PyOpenCL pozwala na dostęp z poziomu Pythona do GPU i innych znacznie
78 zrównoleglonych jednostek obliczeniowych. Próbuje zaoferować
79 możliwości obliczeniowe w tym samym stylu, co siostrzany projekt
82 %package -n python3-pyopencl
83 Summary: Python 3 wrapper for OpenCL
84 Summary(pl.UTF-8): Interfejs Pythona 3 do OpenCL
85 Group: Libraries/Python
86 Requires: OpenCL >= 1.1
87 Requires: python3-appdirs >= 1.4.0
88 Requires: python3-decorator >= 3.2.0
89 Requires: python3-numpy
90 Requires: python3-pytools >= %{pytools_ver}
91 Suggests: python3-Mako >= 0.3.6
93 %description -n python3-pyopencl
94 PyOpenCL lets you access GPUs and other massively parallel compute
95 devices from Python. It tries to offer computing goodness in the
96 spirit of its sister project PyCUDA.
98 %description -n python3-pyopencl -l pl.UTF-8
99 PyOpenCL pozwala na dostęp z poziomu Pythona do GPU i innych znacznie
100 zrównoleglonych jednostek obliczeniowych. Próbuje zaoferować
101 możliwości obliczeniowe w tym samym stylu, co siostrzany projekt
105 Summary: Documentation for PyOpenCL module
106 Summary(pl.UTF-8): Dokumentacja modułu PyOpenCL
111 Documentation for PyOpenCL module.
113 %description apidocs -l pl.UTF-8
114 Dokumentacja modułu PyOpenCL.
117 Summary: Examples for PyOpenCL module
118 Summary(pl.UTF-8): Przykłady do modułu PyOpenCL
121 %description examples
122 Examples for PyOpenCL module.
124 %description examples -l pl.UTF-8
125 Przykłady do modułu PyOpenCL.
128 %setup -q -n pyopencl-%{version}
130 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' examples/*.py
133 %define configopts \\\
134 CXXFLAGS="%{rpmcxxflags}" \\\
135 LDFLAGS="%{rpmldflags}" \\\
143 --python-exe=%{__python}
148 PYTHONPATH="$(echo build-2/lib.*):." \
149 %{__python} -m pytest test
152 %{__mv} siteconf.py siteconf-2.py
159 --python-exe=%{__python3}
164 PYTHONPATH="$(echo build-3/lib.*):." \
165 %{__python3} -m pytest test
169 %{__make} -C doc html \
170 PYTHONPATH="$(echo $(pwd)/build-3/lib.*):$(pwd)" \
171 SPHINXBUILD=sphinx-build-3
174 %{__mv} siteconf.py siteconf-3.py
178 rm -rf $RPM_BUILD_ROOT
181 cp -af siteconf-2.py siteconf.py
188 cp -af siteconf-3.py siteconf.py
192 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
193 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
196 rm -rf $RPM_BUILD_ROOT
200 %defattr(644,root,root,755)
202 %dir %{py_sitedir}/pyopencl
203 %attr(755,root,root) %{py_sitedir}/pyopencl/_cffi.so
204 %{py_sitedir}/pyopencl/*.py[co]
205 %{py_sitedir}/pyopencl/characterize
206 %{py_sitedir}/pyopencl/cl
207 %{py_sitedir}/pyopencl/compyte
208 %{py_sitedir}/pyopencl-%{version}-py*.egg-info
212 %files -n python3-pyopencl
213 %defattr(644,root,root,755)
215 %dir %{py3_sitedir}/pyopencl
216 %attr(755,root,root) %{py3_sitedir}/pyopencl/_cffi.*.so
217 %{py3_sitedir}/pyopencl/*.py
218 %{py3_sitedir}/pyopencl/__pycache__
219 %{py3_sitedir}/pyopencl/characterize
220 %{py3_sitedir}/pyopencl/cl
221 %{py3_sitedir}/pyopencl/compyte
222 %{py3_sitedir}/pyopencl-%{version}-py*.egg-info
227 %defattr(644,root,root,755)
228 %doc doc/_build/html/*
232 %defattr(644,root,root,755)
233 %{_examplesdir}/%{name}-%{version}