]> git.pld-linux.org Git - packages/python-pillow.git/blob - python-pillow.spec
- updated to 5.1.0
[packages/python-pillow.git] / python-pillow.spec
1 # NOTE: -qt supports PyQt5 > PyQt4 > PySide modules (in order of preference)
2 #
3 # bootstrap building docs (pillow is required by docutils, docutils are
4 #  required by sphinx; pillow build-requires sphinx)
5
6 # Conditional build:
7 %bcond_with     doc     # Sphinx documentation (crashes - without DISPLAY?)
8 %bcond_without  tests   # unit tests
9 %bcond_without  python2 # CPython 2.x module
10 %bcond_without  python3 # CPython 3.x module
11
12 %define         module  pillow
13 Summary:        Python 2 image processing library
14 Summary(pl.UTF-8):      Biblioteka do przetwarzania obrazów dla Pythona 2
15 Name:           python-%{module}
16 Version:        5.1.0
17 Release:        1
18 # License: see http://www.pythonware.com/products/pil/license.htm
19 License:        MIT
20 Group:          Libraries/Python
21 #Source0Download: https://pypi.org/simple/pillow/
22 Source0:        https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz
23 # Source0-md5:  308f9c13b376abce96ab6ebd6c889cc4
24 Patch0:         %{name}-subpackage.patch
25 Patch1:         x32.patch
26 URL:            http://python-pillow.github.io/
27 BuildRequires:  freetype-devel >= 2
28 BuildRequires:  ghostscript
29 BuildRequires:  lcms2-devel >= 2
30 BuildRequires:  libimagequant-devel
31 BuildRequires:  libjpeg-devel
32 BuildRequires:  libraqm-devel
33 BuildRequires:  libtiff-devel
34 BuildRequires:  libwebp-devel
35 BuildRequires:  openjpeg2-devel >= 2
36 BuildRequires:  pkgconfig
37 BuildRequires:  rpmbuild(macros) >= 1.710
38 BuildRequires:  tk-devel
39 BuildRequires:  zlib-devel
40 %if %{with python2}
41 BuildRequires:  python-cffi
42 BuildRequires:  python-devel
43 BuildRequires:  python-numpy
44 BuildRequires:  python-setuptools
45 BuildRequires:  python-tkinter
46 %endif
47 %if %{with doc}
48 BuildRequires:  python-sphinx_rtd_theme
49 BuildRequires:  sphinx-pdg-2
50 %endif
51 %if %{with python3}
52 BuildRequires:  python3-cffi
53 BuildRequires:  python3-devel
54 BuildRequires:  python3-numpy
55 BuildRequires:  python3-setuptools
56 BuildRequires:  python3-tkinter
57 %if %{with doc}
58 BuildRequires:  python3-sphinx_rtd_theme
59 BuildRequires:  sphinx-pdg-3
60 %endif
61 %endif
62 # For EpsImagePlugin.py
63 Requires:       ghostscript
64 Provides:       python-PIL = %{version}-%{release}
65 Provides:       pythonegg(pil) = %{version}
66 Obsoletes:      python-PIL < 1:1.1.8
67 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
68
69 %define         py2_libbuilddir %(python -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
70 %define         py3_libbuilddir %(python3 -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
71
72 %description
73 Python image processing library, fork of the Python Imaging Library
74 (PIL).
75
76 This library provides extensive file format support, an efficient
77 internal representation, and powerful image processing capabilities.
78
79 There are four additional subpackages:
80 - tk (Tk interface),
81 - qt (PIL image wrapper for Qt),
82 - devel (development),
83 - doc (documentation).
84
85 %description -l pl.UTF-8
86 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
87 PIL (Python Imaging Library).
88
89 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
90 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
91
92 Są cztery dodatkowe podpakiety:
93 - tk (interfejs Tk),
94 - qt (obudowanie obrazów PIL dla Qt),
95 - devel (do programowania),
96 - doc (dokumentacja).
97
98 %package devel
99 Summary:        Development files for Pillow module
100 Summary(pl.UTF-8):      Pliki programistyczne modułu Pillow
101 Group:          Development/Libraries
102 Requires:       %{name} = %{version}-%{release}
103 Requires:       libjpeg-devel
104 Requires:       python-devel
105 Requires:       zlib-devel
106 Provides:       python-PIL-devel = %{version}-%{release}
107 Obsoletes:      python-PIL-devel < 1:1.1.8
108
109 %description devel
110 Development files for Pillow module.
111
112 %description devel -l pl.UTF-8
113 Pliki programistyczne modułu Pillow.
114
115 %package doc
116 Summary:        Documentation for Pillow module
117 Summary(pl.UTF-8):      Dokumentacja do modułu Pillow
118 Group:          Documentation
119 Requires:       %{name} = %{version}-%{release}
120 %if "%{_rpmversion}" >= "5"
121 BuildArch:      noarch
122 %endif
123
124 %description doc
125 Documentation for Pillow module.
126
127 %description doc -l pl.UTF-8
128 Dokumentacja do modułu Pillow.
129
130 %package tk
131 Summary:        Tk interface for Pillow module
132 Summary(pl.UTF-8):      Interfejs Tk do modułu Pillow
133 Group:          Libraries/Python
134 Requires:       %{name} = %{version}-%{release}
135 Requires:       python-tkinter
136 Provides:       python-PIL-tk = %{version}-%{release}
137 Obsoletes:      python-PIL-tk < 1:1.1.8
138
139 %description tk
140 Tk interface for Pillow module.
141
142 %description tk -l pl.UTF-8
143 Interfejs Tk do modułu Pillow.
144
145 %package qt
146 Summary:        PIL image wrapper for Qt
147 Summary(pl.UTF-8):      Obudowanie obrazów PIL dla Qt
148 Group:          Libraries/Python
149 Requires:       %{name} = %{version}-%{release}
150 Requires:       python-PyQt4
151 Provides:       python-PIL-qt = %{version}-%{release}
152
153 %description qt
154 PIL image wrapper for Qt.
155
156 %description qt -l pl.UTF-8
157 Obudowanie obrazów PIL dla Qt.
158
159 %package -n python3-%{module}
160 Summary:        Python 3 image processing library
161 Summary(pl.UTF-8):      Biblioteka do przetwarzania obrazów dla Pythona 3
162 Group:          Libraries/Python
163 Provides:       python3-PIL = %{version}-%{release}
164
165 %description -n python3-%{module}
166 Python image processing library, fork of the Python Imaging Library
167 (PIL)
168
169 This library provides extensive file format support, an efficient
170 internal representation, and powerful image processing capabilities.
171
172 There are four additional subpackages:
173 - tk (tk interface),
174 - qt (PIL image wrapper for Qt),
175 - devel (development),
176 - doc (documentation).
177
178 %description -n python3-%{module} -l pl.UTF-8
179 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
180 PIL (Python Imaging Library).
181
182 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
183 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
184
185 Są cztery dodatkowe podpakiety:
186 - tk (interfejs Tk),
187 - qt (obudowanie obrazów PIL dla Qt),
188 - devel (do programowania),
189 - doc (dokumentacja).
190
191 %package -n python3-%{module}-devel
192 Summary:        Development files for Pillow module
193 Summary(pl.UTF-8):      Pliki programistyczne modułu Pillow
194 Group:          Development/Libraries
195 Requires:       libjpeg-devel
196 Requires:       python3-%{module} = %{version}-%{release}
197 Requires:       python3-devel
198 Requires:       zlib-devel
199
200 %description -n python3-%{module}-devel
201 Development files for Pillow module.
202
203 %description -n python3-%{module}-devel -l pl.UTF-8
204 Pliki programistyczne modułu Pillow.
205
206 %package -n python3-%{module}-doc
207 Summary:        Documentation for Pillow module
208 Summary(pl.UTF-8):      Dokumentacja do modułu Pillow
209 Group:          Documentation
210 Requires:       python3-%{module} = %{version}-%{release}
211 %if "%{_rpmversion}" >= "5"
212 BuildArch:      noarch
213 %endif
214
215 %description -n python3-%{module}-doc
216 Documentation for Pillow module.
217
218 %description -n python3-%{module}-doc -l pl.UTF-8
219 Dokumentacja do modułu Pillow.
220
221 %package -n python3-%{module}-tk
222 Summary:        Tk interface for Pillow module
223 Summary(pl.UTF-8):      Interfejs Tk do modułu Pillow
224 Group:          Libraries/Python
225 Requires:       python-tkinter
226 Requires:       python3-%{module} = %{version}-%{release}
227
228 %description -n python3-%{module}-tk
229 Tk interface for Pillow module.
230
231 %description -n python3-%{module}-tk -l pl.UTF-8
232 Interfejs Tk do modułu Pillow.
233
234 %package -n python3-%{module}-qt
235 Summary:        PIL image wrapper for Qt
236 Summary(pl.UTF-8):      Obudowanie obrazów PIL dla Qt
237 Group:          Libraries/Python
238 Requires:       python3-%{module} = %{version}-%{release}
239 Requires:       python3-PyQt4
240 Obsoletes:      python3-%{module} <= 2.0.0-5.git93a488e8
241
242 %description -n python3-%{module}-qt
243 PIL image wrapper for Qt.
244
245 %description -n python3-%{module}-qt -l pl.UTF-8
246 Obudowanie obrazów PIL dla Qt.
247
248 %prep
249 %setup -q -n Pillow-%{version}
250 %patch0 -p1
251 %if "%{_lib}" == "libx32"
252 %patch1 -p1
253 %endif
254
255 # Strip shebang on non-executable file
256 #sed -i 1d PIL/OleFileIO.py
257
258 # Fix file encoding
259 iconv --from=ISO-8859-1 --to=UTF-8 PIL/WalImageFile.py > PIL/WalImageFile.py.new && \
260 touch -r PIL/WalImageFile.py PIL/WalImageFile.py.new && \
261 %{__mv} PIL/WalImageFile.py.new PIL/WalImageFile.py
262
263 %build
264 %py_build
265
266 %if %{with doc}
267 PYTHONPATH=$(pwd)/build-2/%{py2_libbuilddir} \
268 %{__make} -C docs html \
269         SPHINXBUILD=sphinx-build-2
270 %endif
271
272 %if %{with python3}
273 %py3_build
274
275 %if %{with doc}
276 PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
277 %{__make} -C docs html \
278         SPHINXBUILD=sphinx-build-3
279 %endif
280 %endif
281
282 %if %{with tests}
283 # Check Python 2 modules
284 cp -R $PWD/Tests $PWD/build-2/%py2_libbuilddir/Tests
285 cp -R $PWD/selftest.py $PWD/build-2/%py2_libbuilddir/selftest.py
286 cd build-2/%py2_libbuilddir
287 PYTHONPATH=$PWD %{__python} selftest.py
288 cd ../..
289
290 %if %{with python3}
291 # Check Python 3 modules
292 cp -R $PWD/Tests $PWD/build-3/%py3_libbuilddir/Tests
293 cp -R $PWD/selftest.py $PWD/build-3/%py3_libbuilddir/selftest.py
294 cd build-3/%py3_libbuilddir
295 PYTHONPATH=$PWD %{__python3} selftest.py
296 %endif
297 %endif
298
299 %install
300 rm -rf $RPM_BUILD_ROOT
301
302 %if %{with python2}
303 # Install Python 2 modules
304 install -d $RPM_BUILD_ROOT%{py_incdir}/Imaging
305 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py_incdir}/Imaging
306 %py_install
307
308 # Fix non-standard-executable-perm
309 chmod +x $RPM_BUILD_ROOT%{py_sitedir}/PIL/*.so
310
311 %{__rm} -r $RPM_BUILD_ROOT%{py_sitedir}/{Tests,selftest.py*}
312 %py_postclean
313 %endif
314
315 %if %{with python3}
316 # Install Python 3 modules
317 install -d $RPM_BUILD_ROOT%{py3_incdir}/Imaging
318 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
319 %py3_install
320
321 # Fix non-standard-executable-perm
322 chmod +x $RPM_BUILD_ROOT%{py3_sitedir}/PIL/*.so
323
324 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/{Tests,selftest.py,__pycache__/selftest.*}
325 %endif
326
327 %clean
328 rm -rf $RPM_BUILD_ROOT
329
330 %files
331 %defattr(644,root,root,755)
332 %doc CHANGES.rst README.rst docs/COPYING
333 %dir %{py_sitedir}/PIL
334 %{py_sitedir}/PIL/*.py[co]
335 %attr(755,root,root) %{py_sitedir}/PIL/_imaging.so
336 %attr(755,root,root) %{py_sitedir}/PIL/_imagingcms.so
337 %attr(755,root,root) %{py_sitedir}/PIL/_imagingft.so
338 %attr(755,root,root) %{py_sitedir}/PIL/_imagingmath.so
339 %attr(755,root,root) %{py_sitedir}/PIL/_imagingmorph.so
340 %attr(755,root,root) %{py_sitedir}/PIL/_webp.so
341 %{py_sitedir}/Pillow-%{version}-py*.egg-info
342 # These are in subpackages
343 %exclude %{py_sitedir}/PIL/ImageQt.py*
344 %exclude %{py_sitedir}/PIL/ImageTk.py*
345 %exclude %{py_sitedir}/PIL/SpiderImagePlugin.py*
346 %exclude %{py_sitedir}/PIL/_tkinter_finder.py*
347
348 %files devel
349 %defattr(644,root,root,755)
350 %{py_incdir}/Imaging
351
352 %if %{with doc}
353 %files doc
354 %defattr(644,root,root,755)
355 %doc docs/_build/html/*
356 %endif
357
358 %files tk
359 %defattr(644,root,root,755)
360 %attr(755,root,root) %{py_sitedir}/PIL/_imagingtk.so
361 %{py_sitedir}/PIL/ImageTk.py[co]
362 %{py_sitedir}/PIL/SpiderImagePlugin.py[co]
363 %{py_sitedir}/PIL/_tkinter_finder.py[co]
364
365 %files qt
366 %defattr(644,root,root,755)
367 %{py_sitedir}/PIL/ImageQt.py[co]
368
369 %if %{with python3}
370 %files -n python3-%{module}
371 %defattr(644,root,root,755)
372 %doc CHANGES.rst README.rst docs/COPYING
373 %dir %{py3_sitedir}/PIL
374 %{py3_sitedir}/PIL/*.py
375 %attr(755,root,root) %{py3_sitedir}/PIL/_imaging.cpython-*.so
376 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingcms.cpython-*.so
377 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingft.cpython-*.so
378 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmath.cpython-*.so
379 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmorph.cpython-*.so
380 %attr(755,root,root) %{py3_sitedir}/PIL/_webp.cpython-*.so
381 %dir %{py3_sitedir}/PIL/__pycache__
382 %{py3_sitedir}/PIL/__pycache__/*.py[co]
383 %{py3_sitedir}/Pillow-%{version}-py*.egg-info
384 # These are in subpackages
385 %exclude %{py3_sitedir}/PIL/ImageQt.py
386 %exclude %{py3_sitedir}/PIL/ImageTk.py
387 %exclude %{py3_sitedir}/PIL/SpiderImagePlugin.py
388 %exclude %{py3_sitedir}/PIL/_tkinter_finder.py
389 %exclude %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
390 %exclude %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
391 %exclude %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
392 %exclude %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
393
394 %files -n python3-%{module}-devel
395 %defattr(644,root,root,755)
396 %{py3_incdir}/Imaging
397
398 %if %{with doc}
399 %files -n python3-%{module}-doc
400 %defattr(644,root,root,755)
401 %doc docs/_build/html
402 %endif
403
404 %files -n python3-%{module}-tk
405 %defattr(644,root,root,755)
406 %{py3_sitedir}/PIL/_imagingtk.cpython-*.so
407 %{py3_sitedir}/PIL/ImageTk.py
408 %{py3_sitedir}/PIL/SpiderImagePlugin.py
409 %{py3_sitedir}/PIL/_tkinter_finder.py
410 %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
411 %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
412 %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
413
414 %files -n python3-%{module}-qt
415 %defattr(644,root,root,755)
416 %{py3_sitedir}/PIL/ImageQt.py
417 %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
418 %endif
This page took 0.074856 seconds and 3 git commands to generate.