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