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