1 # NOTE: -qt supports PyQt5 > PySide2 modules (in order of preference)
3 # bootstrap building docs (pillow is required by docutils, docutils are
4 # required by sphinx; pillow build-requires sphinx)
7 %bcond_with doc # Sphinx documentation (crashes - without DISPLAY?)
8 %bcond_without tests # unit tests
11 Summary: Python 3 image processing library
12 Summary(pl.UTF-8): Biblioteka do przetwarzania obrazów dla Pythona 3
13 Name: python3-%{module}
16 # License: see http://www.pythonware.com/products/pil/license.htm
18 Group: Libraries/Python
19 #Source0Download: https://pypi.org/simple/pillow/
20 Source0: https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz
21 # Source0-md5: 7a1eb5a250c7ccbd549a89e16404f09f
22 Patch0: %{name}-subpackage.patch
24 URL: https://python-pillow.org/
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 >= 4
32 BuildRequires: libwebp-devel
33 BuildRequires: libxcb-devel
34 BuildRequires: openjpeg2-devel >= 2
35 BuildRequires: pkgconfig
36 BuildRequires: python3-cffi
37 BuildRequires: python3-devel >= 1:3.6
38 BuildRequires: python3-numpy
39 BuildRequires: python3-setuptools
40 BuildRequires: python3-tkinter
41 BuildRequires: rpmbuild(macros) >= 1.752
42 BuildRequires: tk-devel
43 BuildRequires: zlib-devel
45 BuildRequires: python3-olefile
48 BuildRequires: python3-sphinx_issues
49 BuildRequires: python3-sphinx_removed_in
50 BuildRequires: python3-sphinx_rtd_theme
51 BuildRequires: sphinx-pdg-3 >= 2.4
53 # For EpsImagePlugin.py
55 Provides: python3-PIL = %{version}-%{release}
56 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
58 %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))')
61 Python image processing library, fork of the Python Imaging Library
64 This library provides extensive file format support, an efficient
65 internal representation, and powerful image processing capabilities.
67 There are four additional subpackages:
69 - qt (PIL image wrapper for Qt),
70 - devel (development),
71 - doc (documentation).
73 %description -l pl.UTF-8
74 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
75 PIL (Python Imaging Library).
77 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
78 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
80 Są cztery dodatkowe podpakiety:
82 - qt (obudowanie obrazów PIL dla Qt),
83 - devel (do programowania),
87 Summary: Development files for Pillow module
88 Summary(pl.UTF-8): Pliki programistyczne modułu Pillow
89 Group: Development/Libraries
90 Requires: %{name} = %{version}-%{release}
91 Requires: libjpeg-devel
92 Requires: python3-devel >= 1:3.5
96 Development files for Pillow module.
98 %description devel -l pl.UTF-8
99 Pliki programistyczne modułu Pillow.
102 Summary: Documentation for Pillow module
103 Summary(pl.UTF-8): Dokumentacja do modułu Pillow
105 Requires: %{name} = %{version}-%{release}
109 Documentation for Pillow module.
111 %description doc -l pl.UTF-8
112 Dokumentacja do modułu Pillow.
115 Summary: Tk interface for Pillow module
116 Summary(pl.UTF-8): Interfejs Tk do modułu Pillow
117 Group: Libraries/Python
118 Requires: %{name} = %{version}-%{release}
119 Requires: python3-tkinter >= 1:3.5
122 Tk interface for Pillow module.
124 %description tk -l pl.UTF-8
125 Interfejs Tk do modułu Pillow.
128 Summary: PIL image wrapper for Qt
129 Summary(pl.UTF-8): Obudowanie obrazów PIL dla Qt
130 Group: Libraries/Python
131 Requires: %{name} = %{version}-%{release}
132 Requires: python3-PyQt5 >= 5
135 PIL image wrapper for Qt.
137 %description qt -l pl.UTF-8
138 Obudowanie obrazów PIL dla Qt.
141 %setup -q -n Pillow-%{version}
143 %if "%{_lib}" == "libx32"
151 PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
152 %{__make} -C docs html \
153 SPHINXBUILD=sphinx-build-3
157 # Check Python 3 modules
158 cp -R $PWD/Tests $PWD/build-3/%py3_libbuilddir/Tests
159 cp -R $PWD/selftest.py $PWD/build-3/%py3_libbuilddir/selftest.py
160 cd build-3/%py3_libbuilddir
162 %{__python3} selftest.py
164 # qt test crashes without DISPLAY
165 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
166 PYTHONPATH=$PWD/build-3/%py3_libbuilddir \
167 %{__python3} -m pytest Tests -k 'not test_qt_image_qapplication'
168 %{__rm} -r build-3/%py3_libbuilddir/Tests
169 %{__rm} build-3/%py3_libbuilddir/selftest.py
173 rm -rf $RPM_BUILD_ROOT
175 # Install Python 3 modules
176 install -d $RPM_BUILD_ROOT%{py3_incdir}/Imaging
177 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
181 rm -rf $RPM_BUILD_ROOT
184 %defattr(644,root,root,755)
185 %doc CHANGES.rst LICENSE README.md
186 %dir %{py3_sitedir}/PIL
187 %{py3_sitedir}/PIL/*.py
188 %attr(755,root,root) %{py3_sitedir}/PIL/_imaging.cpython-*.so
189 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingcms.cpython-*.so
190 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingft.cpython-*.so
191 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmath.cpython-*.so
192 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmorph.cpython-*.so
193 %attr(755,root,root) %{py3_sitedir}/PIL/_webp.cpython-*.so
194 %dir %{py3_sitedir}/PIL/__pycache__
195 %{py3_sitedir}/PIL/__pycache__/*.py[co]
196 %{py3_sitedir}/Pillow-%{version}-py*.egg-info
197 # These are in subpackages
198 %exclude %{py3_sitedir}/PIL/ImageQt.py
199 %exclude %{py3_sitedir}/PIL/ImageTk.py
200 %exclude %{py3_sitedir}/PIL/SpiderImagePlugin.py
201 %exclude %{py3_sitedir}/PIL/_tkinter_finder.py
202 %exclude %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
203 %exclude %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
204 %exclude %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
205 %exclude %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
208 %defattr(644,root,root,755)
209 %{py3_incdir}/Imaging
213 %defattr(644,root,root,755)
214 %doc docs/_build/html
218 %defattr(644,root,root,755)
219 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingtk.cpython-*.so
220 %{py3_sitedir}/PIL/ImageTk.py
221 %{py3_sitedir}/PIL/SpiderImagePlugin.py
222 %{py3_sitedir}/PIL/_tkinter_finder.py
223 %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
224 %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
225 %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
228 %defattr(644,root,root,755)
229 %{py3_sitedir}/PIL/ImageQt.py
230 %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]