]>
Commit | Line | Data |
---|---|---|
f5847243 JB |
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 documentation | |
dc8f5b2d | 6 | %bcond_with tests # py.test calls |
c01f1365 | 7 | |
f5847243 | 8 | %if %{without python2} |
dc8f5b2d | 9 | %undefine with_doc |
f5847243 JB |
10 | %endif |
11 | Summary: Python 2 wrapper for OpenCL | |
12 | Summary(pl.UTF-8): Interfejs Pythona 2 do OpenCL | |
441abba3 | 13 | Name: python-pyopencl |
dc8f5b2d | 14 | Version: 2016.1 |
81f192f6 | 15 | Release: 4 |
441abba3 | 16 | License: MIT |
f5847243 | 17 | Group: Libraries/Python |
dc8f5b2d JB |
18 | #Source0Download: https://pypi.python.org/simple/pyopencl/ |
19 | Source0: https://pypi.python.org/packages/cb/4e/fcb45db7d3005f5646f28a3de2a2f8e60a6e4b629f02bbb331320778f3a1/pyopencl-%{version}.tar.gz | |
20 | # Source0-md5: 0c8a33b6a6b427bcd9c5966da461d9c6 | |
441abba3 | 21 | URL: http://mathema.tician.de/software/pyopencl |
dc8f5b2d | 22 | BuildRequires: OpenCL-devel >= 1.2 |
8d6d4e8f | 23 | BuildRequires: libstdc++-devel >= 6:4.3 |
5b449651 | 24 | BuildRequires: rpmbuild(macros) >= 1.710 |
f5847243 | 25 | %if %{with python2} |
dc8f5b2d JB |
26 | BuildRequires: python-cffi >= 1.1.0 |
27 | BuildRequires: python-devel >= 1:2.6 | |
28 | BuildRequires: python-numpy-devel | |
29 | BuildRequires: python-setuptools | |
30 | %if %{with tests} | |
31 | BuildRequires: python-Mako >= 0.3.6 | |
f5847243 | 32 | BuildRequires: python-appdirs >= 1.4.0 |
a24997d7 | 33 | BuildRequires: python-decorator >= 3.2.0 |
f5847243 | 34 | BuildRequires: python-pytest >= 2 |
dc8f5b2d JB |
35 | BuildRequires: python-pytools >= 2015.1.2 |
36 | BuildRequires: python-six >= 1.9.0 | |
37 | %endif | |
8d6d4e8f JB |
38 | %if %{with doc} |
39 | BuildRequires: python-numpy | |
40 | BuildRequires: python-pytools >= 2015.1.2 | |
41 | BuildRequires: python-six >= 1.9.0 | |
42 | BuildRequires: python-sphinx_bootstrap_theme | |
43 | BuildRequires: sphinx-pdg-2 | |
44 | %endif | |
f5847243 JB |
45 | %endif |
46 | %if %{with python3} | |
dc8f5b2d | 47 | BuildRequires: python3-cffi >= 1.1.0 |
c01f1365 | 48 | BuildRequires: python3-devel >= 1:3.2 |
f5847243 | 49 | BuildRequires: python3-numpy-devel |
dc8f5b2d JB |
50 | BuildRequires: python3-setuptools |
51 | %if %{with tests} | |
52 | BuildRequires: python3-Mako >= 0.3.6 | |
53 | BuildRequires: python3-appdirs >= 1.4.0 | |
54 | BuildRequires: python3-decorator >= 3.2.0 | |
f5847243 | 55 | BuildRequires: python3-pytest >= 2 |
dc8f5b2d JB |
56 | BuildRequires: python3-pytools >= 2015.1.2 |
57 | BuildRequires: python3-six >= 1.9.0 | |
f5847243 | 58 | %endif |
dc8f5b2d | 59 | %endif |
a8c1d76c | 60 | Requires: OpenCL >= 1.1 |
f5847243 | 61 | Requires: python-appdirs >= 1.4.0 |
a24997d7 | 62 | Requires: python-decorator >= 3.2.0 |
a24997d7 | 63 | Requires: python-numpy |
c01f1365 | 64 | Requires: python-pytools >= 2014.2 |
a24997d7 JB |
65 | Suggests: python-Mako >= 0.3.6 |
66 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
441abba3 AM |
67 | |
68 | %description | |
69 | PyOpenCL lets you access GPUs and other massively parallel compute | |
70 | devices from Python. It tries to offer computing goodness in the | |
a24997d7 | 71 | spirit of its sister project PyCUDA. |
441abba3 | 72 | |
a24997d7 JB |
73 | %description -l pl.UTF-8 |
74 | PyOpenCL pozwala na dostęp z poziomu Pythona do GPU i innych znacznie | |
75 | zrównoleglonych jednostek obliczeniowych. Próbuje zaoferować | |
76 | możliwości obliczeniowe w tym samym stylu, co siostrzany projekt | |
77 | PyCUDA. | |
441abba3 | 78 | |
f5847243 JB |
79 | %package -n python3-pyopencl |
80 | Summary: Python 3 wrapper for OpenCL | |
81 | Summary(pl.UTF-8): Interfejs Pythona 3 do OpenCL | |
82 | Group: Libraries/Python | |
83 | Requires: OpenCL >= 1.1 | |
84 | Requires: python3-appdirs >= 1.4.0 | |
85 | Requires: python3-decorator >= 3.2.0 | |
f5847243 | 86 | Requires: python3-numpy |
c01f1365 | 87 | Requires: python3-pytools >= 2014.2 |
f5847243 JB |
88 | Suggests: python3-Mako >= 0.3.6 |
89 | ||
90 | %description -n python3-pyopencl | |
91 | PyOpenCL lets you access GPUs and other massively parallel compute | |
92 | devices from Python. It tries to offer computing goodness in the | |
93 | spirit of its sister project PyCUDA. | |
94 | ||
95 | %description -n python3-pyopencl -l pl.UTF-8 | |
96 | PyOpenCL pozwala na dostęp z poziomu Pythona do GPU i innych znacznie | |
97 | zrównoleglonych jednostek obliczeniowych. Próbuje zaoferować | |
98 | możliwości obliczeniowe w tym samym stylu, co siostrzany projekt | |
99 | PyCUDA. | |
100 | ||
101 | %package apidocs | |
102 | Summary: Documentation for PyOpenCL module | |
103 | Summary(pl.UTF-8): Dokumentacja modułu PyOpenCL | |
104 | Group: Documentation | |
c01f1365 ER |
105 | %if "%{_rpmversion}" >= "5" |
106 | BuildArch: noarch | |
107 | %endif | |
f5847243 JB |
108 | |
109 | %description apidocs | |
110 | Documentation for PyOpenCL module. | |
111 | ||
112 | %description apidocs -l pl.UTF-8 | |
113 | Dokumentacja modułu PyOpenCL. | |
114 | ||
115 | %package examples | |
116 | Summary: Examples for PyOpenCL module | |
117 | Summary(pl.UTF-8): Przykłady do modułu PyOpenCL | |
118 | Group: Documentation | |
119 | ||
120 | %description examples | |
121 | Examples for PyOpenCL module. | |
122 | ||
123 | %description examples -l pl.UTF-8 | |
124 | Przykłady do modułu PyOpenCL. | |
125 | ||
441abba3 AM |
126 | %prep |
127 | %setup -q -n pyopencl-%{version} | |
128 | ||
129 | %build | |
f5847243 JB |
130 | %define configopts \\\ |
131 | CXXFLAGS="%{rpmcxxflags}" \\\ | |
132 | LDFLAGS="%{rpmldflags}" \\\ | |
dc8f5b2d | 133 | --cl-enable-gl \\\ |
f5847243 | 134 | %{nil} |
a24997d7 | 135 | |
f5847243 JB |
136 | %if %{with python2} |
137 | install -d build-2 | |
138 | ./configure.py \ | |
139 | %{configopts} \ | |
dc8f5b2d | 140 | --python-exe=%{__python} |
f5847243 | 141 | |
106e7e90 | 142 | %py_build |
441abba3 | 143 | |
dc8f5b2d JB |
144 | %if %{with tests} |
145 | PYTHONPATH="$(echo build-2/lib.*):." \ | |
604671b3 | 146 | %{__python} -m pytest test |
dc8f5b2d JB |
147 | %endif |
148 | ||
f5847243 | 149 | %if %{with doc} |
a24997d7 | 150 | %{__make} -C doc html \ |
8d6d4e8f JB |
151 | PYTHONPATH="$(echo $(pwd)/build-2/lib.*):$(pwd)" \ |
152 | SPHINXBUILD=sphinx-build-2 | |
f5847243 | 153 | %endif |
f5847243 | 154 | |
dc8f5b2d | 155 | %{__mv} siteconf.py siteconf-2.py |
f5847243 JB |
156 | %endif |
157 | ||
158 | %if %{with python3} | |
159 | install -d build-3 | |
160 | ./configure.py \ | |
161 | %{configopts} \ | |
dc8f5b2d | 162 | --python-exe=%{__python3} |
f5847243 | 163 | |
106e7e90 | 164 | %py3_build |
f5847243 | 165 | |
dc8f5b2d JB |
166 | %if %{with tests} |
167 | PYTHONPATH="$(echo build-3/lib.*):." \ | |
604671b3 | 168 | %{__python3} -m pytest test |
dc8f5b2d JB |
169 | %endif |
170 | ||
f5847243 JB |
171 | %{__mv} siteconf.py siteconf-3.py |
172 | %endif | |
441abba3 AM |
173 | |
174 | %install | |
175 | rm -rf $RPM_BUILD_ROOT | |
441abba3 | 176 | |
f5847243 JB |
177 | %if %{with python2} |
178 | cp -af siteconf-2.py siteconf.py | |
106e7e90 | 179 | %py_install |
a24997d7 JB |
180 | |
181 | %py_postclean | |
f5847243 JB |
182 | %endif |
183 | ||
184 | %if %{with python3} | |
185 | cp -af siteconf-3.py siteconf.py | |
106e7e90 | 186 | %py3_install |
f5847243 JB |
187 | %endif |
188 | ||
189 | install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
190 | cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version} | |
441abba3 AM |
191 | |
192 | %clean | |
193 | rm -rf $RPM_BUILD_ROOT | |
194 | ||
f5847243 | 195 | %if %{with python2} |
a24997d7 | 196 | %files |
441abba3 | 197 | %defattr(644,root,root,755) |
f5847243 | 198 | %doc README.rst |
441abba3 | 199 | %dir %{py_sitedir}/pyopencl |
dc8f5b2d | 200 | %attr(755,root,root) %{py_sitedir}/pyopencl/_cffi.so |
a24997d7 JB |
201 | %{py_sitedir}/pyopencl/*.py[co] |
202 | %{py_sitedir}/pyopencl/characterize | |
f5847243 | 203 | %{py_sitedir}/pyopencl/cl |
a24997d7 JB |
204 | %{py_sitedir}/pyopencl/compyte |
205 | %{py_sitedir}/pyopencl-%{version}-py*.egg-info | |
f5847243 JB |
206 | %endif |
207 | ||
208 | %if %{with python3} | |
209 | %files -n python3-pyopencl | |
210 | %defattr(644,root,root,755) | |
211 | %doc README.rst | |
212 | %dir %{py3_sitedir}/pyopencl | |
dc8f5b2d | 213 | %attr(755,root,root) %{py3_sitedir}/pyopencl/_cffi.cpython-*.so |
f5847243 JB |
214 | %{py3_sitedir}/pyopencl/*.py |
215 | %{py3_sitedir}/pyopencl/__pycache__ | |
216 | %{py3_sitedir}/pyopencl/characterize | |
217 | %{py3_sitedir}/pyopencl/cl | |
218 | %{py3_sitedir}/pyopencl/compyte | |
219 | %{py3_sitedir}/pyopencl-%{version}-py*.egg-info | |
220 | %endif | |
221 | ||
222 | %if %{with doc} | |
223 | %files apidocs | |
224 | %defattr(644,root,root,755) | |
225 | %doc doc/_build/html/* | |
226 | %endif | |
227 | ||
228 | %files examples | |
229 | %defattr(644,root,root,755) | |
230 | %{_examplesdir}/%{name}-%{version} |