]> git.pld-linux.org Git - packages/python-pyopencl.git/blob - python-pyopencl.spec
- python 3.6
[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 %if %{without python2}
9 %undefine       with_doc
10 %endif
11 Summary:        Python 2 wrapper for OpenCL
12 Summary(pl.UTF-8):      Interfejs Pythona 2 do OpenCL
13 Name:           python-pyopencl
14 Version:        2016.1
15 Release:        3
16 License:        MIT
17 Group:          Libraries/Python
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
21 URL:            http://mathema.tician.de/software/pyopencl
22 BuildRequires:  OpenCL-devel >= 1.2
23 BuildRequires:  libstdc++-devel >= 6:4.3
24 BuildRequires:  rpmbuild(macros) >= 1.710
25 %if %{with python2}
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
32 BuildRequires:  python-appdirs >= 1.4.0
33 BuildRequires:  python-decorator >= 3.2.0
34 BuildRequires:  python-pytest >= 2
35 BuildRequires:  python-pytools >= 2015.1.2
36 BuildRequires:  python-six >= 1.9.0
37 %endif
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
45 %endif
46 %if %{with python3}
47 BuildRequires:  python3-cffi >= 1.1.0
48 BuildRequires:  python3-devel >= 1:3.2
49 BuildRequires:  python3-numpy-devel
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
55 BuildRequires:  python3-pytest >= 2
56 BuildRequires:  python3-pytools >= 2015.1.2
57 BuildRequires:  python3-six >= 1.9.0
58 %endif
59 %endif
60 Requires:       OpenCL >= 1.1
61 Requires:       python-appdirs >= 1.4.0
62 Requires:       python-decorator >= 3.2.0
63 Requires:       python-numpy
64 Requires:       python-pytools >= 2014.2
65 Suggests:       python-Mako >= 0.3.6
66 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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
71 spirit of its sister project PyCUDA.
72
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.
78
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
86 Requires:       python3-numpy
87 Requires:       python3-pytools >= 2014.2
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
105 %if "%{_rpmversion}" >= "5"
106 BuildArch:      noarch
107 %endif
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
126 %prep
127 %setup -q -n pyopencl-%{version}
128
129 %build
130 %define configopts \\\
131         CXXFLAGS="%{rpmcxxflags}" \\\
132         LDFLAGS="%{rpmldflags}" \\\
133         --cl-enable-gl \\\
134         %{nil}
135
136 %if %{with python2}
137 install -d build-2
138 ./configure.py \
139         %{configopts} \
140         --python-exe=%{__python}
141
142 %py_build
143
144 %if %{with tests}
145 PYTHONPATH="$(echo build-2/lib.*):." \
146 py.test-%{py_ver} test
147 %endif
148
149 %if %{with doc}
150 %{__make} -C doc html \
151         PYTHONPATH="$(echo $(pwd)/build-2/lib.*):$(pwd)" \
152         SPHINXBUILD=sphinx-build-2
153 %endif
154
155 %{__mv} siteconf.py siteconf-2.py
156 %endif
157
158 %if %{with python3}
159 install -d build-3
160 ./configure.py \
161         %{configopts} \
162         --python-exe=%{__python3}
163
164 %py3_build
165
166 %if %{with tests}
167 PYTHONPATH="$(echo build-3/lib.*):." \
168 py.test-%{py3_ver} test
169 %endif
170
171 %{__mv} siteconf.py siteconf-3.py
172 %endif
173
174 %install
175 rm -rf $RPM_BUILD_ROOT
176
177 %if %{with python2}
178 cp -af siteconf-2.py siteconf.py
179 %py_install
180
181 %py_postclean
182 %endif
183
184 %if %{with python3}
185 cp -af siteconf-3.py siteconf.py
186 %py3_install
187 %endif
188
189 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
190 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
191
192 %clean
193 rm -rf $RPM_BUILD_ROOT
194
195 %if %{with python2}
196 %files
197 %defattr(644,root,root,755)
198 %doc README.rst
199 %dir %{py_sitedir}/pyopencl
200 %attr(755,root,root) %{py_sitedir}/pyopencl/_cffi.so
201 %{py_sitedir}/pyopencl/*.py[co]
202 %{py_sitedir}/pyopencl/characterize
203 %{py_sitedir}/pyopencl/cl
204 %{py_sitedir}/pyopencl/compyte
205 %{py_sitedir}/pyopencl-%{version}-py*.egg-info
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
213 %attr(755,root,root) %{py3_sitedir}/pyopencl/_cffi.cpython-*.so
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}
This page took 0.108417 seconds and 3 git commands to generate.