]> git.pld-linux.org Git - packages/python-pillow.git/blob - python-pillow.spec
07a72a8551a03a166b4e6526bf9f2c4424ffbc6b
[packages/python-pillow.git] / python-pillow.spec
1 # NOTE: for version >= 7.0.0 without python 2 support see python3-pillow.spec
2 #
3 # NOTE: -qt supports PyQt5 > PySide2 > PyQt4 > PySide modules (in order of preference; PyQt4 and PySide are deprecated)
4 #
5 # bootstrap building docs (pillow is required by docutils, docutils are
6 #  required by sphinx; pillow build-requires sphinx)
7
8 # Conditional build:
9 %bcond_with     doc     # Sphinx documentation (crashes - without DISPLAY?)
10 %bcond_without  tests   # unit tests
11 %bcond_without  python2 # CPython 2.x module
12 %bcond_with     python3 # CPython 3.x module
13
14 %define         module  pillow
15 Summary:        Python 2 image processing library
16 Summary(pl.UTF-8):      Biblioteka do przetwarzania obrazów dla Pythona 2
17 Name:           python-%{module}
18 # NOTE: keep 6.x in this spec for python 2.x support (see note above)
19 Version:        6.2.2
20 Release:        3
21 # License: see http://www.pythonware.com/products/pil/license.htm
22 License:        MIT
23 Group:          Libraries/Python
24 #Source0Download: https://pypi.org/simple/pillow/
25 Source0:        https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz
26 # Source0-md5:  46cad14f0044a5ac4b2d801271528893
27 Patch0:         %{name}-subpackage.patch
28 Patch1:         x32.patch
29 URL:            https://python-pillow.org/
30 BuildRequires:  freetype-devel >= 2
31 BuildRequires:  ghostscript
32 BuildRequires:  lcms2-devel >= 2
33 BuildRequires:  libimagequant-devel
34 BuildRequires:  libjpeg-devel
35 BuildRequires:  libraqm-devel
36 BuildRequires:  libtiff-devel >= 4
37 BuildRequires:  libwebp-devel
38 BuildRequires:  openjpeg2-devel >= 2
39 BuildRequires:  pkgconfig
40 BuildRequires:  rpmbuild(macros) >= 1.714
41 BuildRequires:  tk-devel
42 BuildRequires:  zlib-devel
43 %if %{with python2}
44 BuildRequires:  python-cffi
45 BuildRequires:  python-devel >= 1:2.7
46 BuildRequires:  python-numpy
47 BuildRequires:  python-setuptools
48 BuildRequires:  python-tkinter
49 %endif
50 %if %{with doc}
51 BuildRequires:  python-sphinx_rtd_theme
52 BuildRequires:  sphinx-pdg-2
53 %endif
54 %if %{with python3}
55 BuildRequires:  python3-cffi
56 BuildRequires:  python3-devel >= 1:3.5
57 BuildRequires:  python3-numpy
58 BuildRequires:  python3-setuptools
59 BuildRequires:  python3-tkinter
60 %if %{with doc}
61 BuildRequires:  python3-sphinx_rtd_theme
62 BuildRequires:  sphinx-pdg-3
63 %endif
64 %endif
65 # For EpsImagePlugin.py
66 Requires:       ghostscript
67 Provides:       python-PIL = %{version}-%{release}
68 Provides:       pythonegg(pil) = %{version}
69 Obsoletes:      python-PIL < 1:1.1.8
70 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
71
72 %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))')
73 %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))')
74
75 %description
76 Python image processing library, fork of the Python Imaging Library
77 (PIL).
78
79 This library provides extensive file format support, an efficient
80 internal representation, and powerful image processing capabilities.
81
82 There are four additional subpackages:
83 - tk (Tk interface),
84 - qt (PIL image wrapper for Qt),
85 - devel (development),
86 - doc (documentation).
87
88 %description -l pl.UTF-8
89 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
90 PIL (Python Imaging Library).
91
92 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
93 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
94
95 Są cztery dodatkowe podpakiety:
96 - tk (interfejs Tk),
97 - qt (obudowanie obrazów PIL dla Qt),
98 - devel (do programowania),
99 - doc (dokumentacja).
100
101 %package devel
102 Summary:        Development files for Pillow module
103 Summary(pl.UTF-8):      Pliki programistyczne modułu Pillow
104 Group:          Development/Libraries
105 Requires:       %{name} = %{version}-%{release}
106 Requires:       libjpeg-devel
107 Requires:       python-devel >= 1:2.7
108 Requires:       zlib-devel
109 Provides:       python-PIL-devel = %{version}-%{release}
110 Obsoletes:      python-PIL-devel < 1:1.1.8
111
112 %description devel
113 Development files for Pillow module.
114
115 %description devel -l pl.UTF-8
116 Pliki programistyczne modułu Pillow.
117
118 %package doc
119 Summary:        Documentation for Pillow module
120 Summary(pl.UTF-8):      Dokumentacja do modułu Pillow
121 Group:          Documentation
122 Requires:       %{name} = %{version}-%{release}
123 BuildArch:      noarch
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-PyQt5
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.5
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 BuildArch:      noarch
213
214 %description -n python3-%{module}-doc
215 Documentation for Pillow module.
216
217 %description -n python3-%{module}-doc -l pl.UTF-8
218 Dokumentacja do modułu Pillow.
219
220 %package -n python3-%{module}-tk
221 Summary:        Tk interface for Pillow module
222 Summary(pl.UTF-8):      Interfejs Tk do modułu Pillow
223 Group:          Libraries/Python
224 Requires:       python3-tkinter >= 1:3.5
225 Requires:       python3-%{module} = %{version}-%{release}
226
227 %description -n python3-%{module}-tk
228 Tk interface for Pillow module.
229
230 %description -n python3-%{module}-tk -l pl.UTF-8
231 Interfejs Tk do modułu Pillow.
232
233 %package -n python3-%{module}-qt
234 Summary:        PIL image wrapper for Qt
235 Summary(pl.UTF-8):      Obudowanie obrazów PIL dla Qt
236 Group:          Libraries/Python
237 Requires:       python3-%{module} = %{version}-%{release}
238 Requires:       python3-PyQt5
239 Obsoletes:      python3-%{module} <= 2.0.0-5.git93a488e8
240
241 %description -n python3-%{module}-qt
242 PIL image wrapper for Qt.
243
244 %description -n python3-%{module}-qt -l pl.UTF-8
245 Obudowanie obrazów PIL dla Qt.
246
247 %prep
248 %setup -q -n Pillow-%{version}
249 %patch0 -p1
250 %if "%{_lib}" == "libx32"
251 %patch1 -p1
252 %endif
253
254 %build
255 %py_build
256
257 %if %{with doc}
258 PYTHONPATH=$(pwd)/build-2/%{py2_libbuilddir} \
259 %{__make} -C docs html \
260         SPHINXBUILD=sphinx-build-2
261 %endif
262
263 %if %{with python3}
264 %py3_build
265
266 %if %{with doc}
267 PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
268 %{__make} -C docs html \
269         SPHINXBUILD=sphinx-build-3
270 %endif
271 %endif
272
273 %if %{with tests}
274 # Check Python 2 modules
275 cp -R $PWD/Tests $PWD/build-2/%py2_libbuilddir/Tests
276 cp -R $PWD/selftest.py $PWD/build-2/%py2_libbuilddir/selftest.py
277 cd build-2/%py2_libbuilddir
278 PYTHONPATH=$PWD %{__python} selftest.py
279 cd ../..
280
281 %if %{with python3}
282 # Check Python 3 modules
283 cp -R $PWD/Tests $PWD/build-3/%py3_libbuilddir/Tests
284 cp -R $PWD/selftest.py $PWD/build-3/%py3_libbuilddir/selftest.py
285 cd build-3/%py3_libbuilddir
286 PYTHONPATH=$PWD %{__python3} selftest.py
287 %endif
288 %endif
289
290 %install
291 rm -rf $RPM_BUILD_ROOT
292
293 %if %{with python2}
294 # Install Python 2 modules
295 install -d $RPM_BUILD_ROOT%{py_incdir}/Imaging
296 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py_incdir}/Imaging
297 %py_install
298 %py_postclean
299 %endif
300
301 %if %{with python3}
302 # Install Python 3 modules
303 install -d $RPM_BUILD_ROOT%{py3_incdir}/Imaging
304 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
305 %py3_install
306 %endif
307
308 %clean
309 rm -rf $RPM_BUILD_ROOT
310
311 %files
312 %defattr(644,root,root,755)
313 %doc CHANGES.rst README.rst docs/COPYING
314 %dir %{py_sitedir}/PIL
315 %{py_sitedir}/PIL/*.py[co]
316 %attr(755,root,root) %{py_sitedir}/PIL/_imaging.so
317 %attr(755,root,root) %{py_sitedir}/PIL/_imagingcms.so
318 %attr(755,root,root) %{py_sitedir}/PIL/_imagingft.so
319 %attr(755,root,root) %{py_sitedir}/PIL/_imagingmath.so
320 %attr(755,root,root) %{py_sitedir}/PIL/_imagingmorph.so
321 %attr(755,root,root) %{py_sitedir}/PIL/_webp.so
322 %{py_sitedir}/Pillow-%{version}-py*.egg-info
323 # These are in subpackages
324 %exclude %{py_sitedir}/PIL/ImageQt.py*
325 %exclude %{py_sitedir}/PIL/ImageTk.py*
326 %exclude %{py_sitedir}/PIL/SpiderImagePlugin.py*
327 %exclude %{py_sitedir}/PIL/_tkinter_finder.py*
328
329 %files devel
330 %defattr(644,root,root,755)
331 %{py_incdir}/Imaging
332
333 %if %{with doc}
334 %files doc
335 %defattr(644,root,root,755)
336 %doc docs/_build/html/*
337 %endif
338
339 %files tk
340 %defattr(644,root,root,755)
341 %attr(755,root,root) %{py_sitedir}/PIL/_imagingtk.so
342 %{py_sitedir}/PIL/ImageTk.py[co]
343 %{py_sitedir}/PIL/SpiderImagePlugin.py[co]
344 %{py_sitedir}/PIL/_tkinter_finder.py[co]
345
346 %files qt
347 %defattr(644,root,root,755)
348 %{py_sitedir}/PIL/ImageQt.py[co]
349
350 %if %{with python3}
351 %files -n python3-%{module}
352 %defattr(644,root,root,755)
353 %doc CHANGES.rst README.rst docs/COPYING
354 %dir %{py3_sitedir}/PIL
355 %{py3_sitedir}/PIL/*.py
356 %attr(755,root,root) %{py3_sitedir}/PIL/_imaging.cpython-*.so
357 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingcms.cpython-*.so
358 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingft.cpython-*.so
359 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmath.cpython-*.so
360 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmorph.cpython-*.so
361 %attr(755,root,root) %{py3_sitedir}/PIL/_webp.cpython-*.so
362 %dir %{py3_sitedir}/PIL/__pycache__
363 %{py3_sitedir}/PIL/__pycache__/*.py[co]
364 %{py3_sitedir}/Pillow-%{version}-py*.egg-info
365 # These are in subpackages
366 %exclude %{py3_sitedir}/PIL/ImageQt.py
367 %exclude %{py3_sitedir}/PIL/ImageTk.py
368 %exclude %{py3_sitedir}/PIL/SpiderImagePlugin.py
369 %exclude %{py3_sitedir}/PIL/_tkinter_finder.py
370 %exclude %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
371 %exclude %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
372 %exclude %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
373 %exclude %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
374
375 %files -n python3-%{module}-devel
376 %defattr(644,root,root,755)
377 %{py3_incdir}/Imaging
378
379 %if %{with doc}
380 %files -n python3-%{module}-doc
381 %defattr(644,root,root,755)
382 %doc docs/_build/html
383 %endif
384
385 %files -n python3-%{module}-tk
386 %defattr(644,root,root,755)
387 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingtk.cpython-*.so
388 %{py3_sitedir}/PIL/ImageTk.py
389 %{py3_sitedir}/PIL/SpiderImagePlugin.py
390 %{py3_sitedir}/PIL/_tkinter_finder.py
391 %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
392 %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
393 %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
394
395 %files -n python3-%{module}-qt
396 %defattr(644,root,root,755)
397 %{py3_sitedir}/PIL/ImageQt.py
398 %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
399 %endif
This page took 0.089893 seconds and 2 git commands to generate.