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