]> git.pld-linux.org Git - packages/python-pyopencl.git/blob - python-pyopencl.spec
fix shebangs in examples; rel 4
[packages/python-pyopencl.git] / python-pyopencl.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 documentation
6 %bcond_with     tests   # py.test calls
7
8 %define         pytools_ver     2018.0.0
9
10 %if %{without python2}
11 %undefine       with_doc
12 %endif
13 %define         pypi_name       pyopencl
14 Summary:        Python 2 wrapper for OpenCL
15 Summary(pl.UTF-8):      Interfejs Pythona 2 do OpenCL
16 Name:           python-pyopencl
17 Version:        2018.1.1
18 Release:        4
19 License:        MIT
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
28 %if %{with python2}
29 BuildRequires:  python-cffi >= 1.1.0
30 BuildRequires:  python-devel >= 1:2.6
31 BuildRequires:  python-numpy-devel
32 BuildRequires:  python-setuptools
33 %if %{with tests}
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
40 %endif
41 %endif
42 %if %{with python3}
43 BuildRequires:  python3-cffi >= 1.1.0
44 BuildRequires:  python3-devel >= 1:3.2
45 BuildRequires:  python3-numpy-devel
46 BuildRequires:  python3-setuptools
47 %if %{with tests}
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
54 %endif
55 %if %{with doc}
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
61 %endif
62 %endif
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)
70
71 %description
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.
75
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
80 PyCUDA.
81
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
92
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.
97
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
102 PyCUDA.
103
104 %package apidocs
105 Summary:        Documentation for PyOpenCL module
106 Summary(pl.UTF-8):      Dokumentacja modułu PyOpenCL
107 Group:          Documentation
108 BuildArch:      noarch
109
110 %description apidocs
111 Documentation for PyOpenCL module.
112
113 %description apidocs -l pl.UTF-8
114 Dokumentacja modułu PyOpenCL.
115
116 %package examples
117 Summary:        Examples for PyOpenCL module
118 Summary(pl.UTF-8):      Przykłady do modułu PyOpenCL
119 Group:          Documentation
120
121 %description examples
122 Examples for PyOpenCL module.
123
124 %description examples -l pl.UTF-8
125 Przykłady do modułu PyOpenCL.
126
127 %prep
128 %setup -q -n pyopencl-%{version}
129
130 %{__sed} -i -e '1s,/usr/bin/env python,%{__python},' examples/*.py
131
132 %build
133 %define configopts \\\
134         CXXFLAGS="%{rpmcxxflags}" \\\
135         LDFLAGS="%{rpmldflags}" \\\
136         --cl-enable-gl \\\
137         %{nil}
138
139 %if %{with python2}
140 install -d build-2
141 ./configure.py \
142         %{configopts} \
143         --python-exe=%{__python}
144
145 %py_build
146
147 %if %{with tests}
148 PYTHONPATH="$(echo build-2/lib.*):." \
149 %{__python} -m pytest test
150 %endif
151
152 %{__mv} siteconf.py siteconf-2.py
153 %endif
154
155 %if %{with python3}
156 install -d build-3
157 ./configure.py \
158         %{configopts} \
159         --python-exe=%{__python3}
160
161 %py3_build
162
163 %if %{with tests}
164 PYTHONPATH="$(echo build-3/lib.*):." \
165 %{__python3} -m pytest test
166 %endif
167
168 %if %{with doc}
169 %{__make} -C doc html \
170         PYTHONPATH="$(echo $(pwd)/build-3/lib.*):$(pwd)" \
171         SPHINXBUILD=sphinx-build-3
172 %endif
173
174 %{__mv} siteconf.py siteconf-3.py
175 %endif
176
177 %install
178 rm -rf $RPM_BUILD_ROOT
179
180 %if %{with python2}
181 cp -af siteconf-2.py siteconf.py
182 %py_install
183
184 %py_postclean
185 %endif
186
187 %if %{with python3}
188 cp -af siteconf-3.py siteconf.py
189 %py3_install
190 %endif
191
192 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
193 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
194
195 %clean
196 rm -rf $RPM_BUILD_ROOT
197
198 %if %{with python2}
199 %files
200 %defattr(644,root,root,755)
201 %doc README.rst
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
209 %endif
210
211 %if %{with python3}
212 %files -n python3-pyopencl
213 %defattr(644,root,root,755)
214 %doc README.rst
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
223 %endif
224
225 %if %{with doc}
226 %files apidocs
227 %defattr(644,root,root,755)
228 %doc doc/_build/html/*
229 %endif
230
231 %files examples
232 %defattr(644,root,root,755)
233 %{_examplesdir}/%{name}-%{version}
This page took 0.105386 seconds and 3 git commands to generate.