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: d099946335c1ba372f5b1fa68ca71645
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
32 BuildRequires: libwebp-devel
33 BuildRequires: openjpeg2-devel >= 2
34 BuildRequires: pkgconfig
35 BuildRequires: python3-cffi
36 BuildRequires: python3-devel >= 1:3.5
37 BuildRequires: python3-numpy
38 BuildRequires: python3-setuptools
39 BuildRequires: python3-tkinter
40 BuildRequires: rpmbuild(macros) >= 1.714
41 BuildRequires: tk-devel
42 BuildRequires: zlib-devel
44 BuildRequires: python3-sphinx_rtd_theme
45 BuildRequires: sphinx-pdg-3
47 # For EpsImagePlugin.py
49 Provides: python3-PIL = %{version}-%{release}
50 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
52 %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))')
55 Python image processing library, fork of the Python Imaging Library
58 This library provides extensive file format support, an efficient
59 internal representation, and powerful image processing capabilities.
61 There are four additional subpackages:
63 - qt (PIL image wrapper for Qt),
64 - devel (development),
65 - doc (documentation).
67 %description -l pl.UTF-8
68 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
69 PIL (Python Imaging Library).
71 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
72 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
74 Są cztery dodatkowe podpakiety:
76 - qt (obudowanie obrazów PIL dla Qt),
77 - devel (do programowania),
81 Summary: Development files for Pillow module
82 Summary(pl.UTF-8): Pliki programistyczne modułu Pillow
83 Group: Development/Libraries
84 Requires: %{name} = %{version}-%{release}
85 Requires: libjpeg-devel
86 Requires: python3-devel >= 1:3.5
90 Development files for Pillow module.
92 %description devel -l pl.UTF-8
93 Pliki programistyczne modułu Pillow.
96 Summary: Documentation for Pillow module
97 Summary(pl.UTF-8): Dokumentacja do modułu Pillow
99 Requires: %{name} = %{version}-%{release}
100 %if "%{_rpmversion}" >= "4.6"
105 Documentation for Pillow module.
107 %description doc -l pl.UTF-8
108 Dokumentacja do modułu Pillow.
111 Summary: Tk interface for Pillow module
112 Summary(pl.UTF-8): Interfejs Tk do modułu Pillow
113 Group: Libraries/Python
114 Requires: %{name} = %{version}-%{release}
115 Requires: python3-tkinter >= 1:3.5
118 Tk interface for Pillow module.
120 %description tk -l pl.UTF-8
121 Interfejs Tk do modułu Pillow.
124 Summary: PIL image wrapper for Qt
125 Summary(pl.UTF-8): Obudowanie obrazów PIL dla Qt
126 Group: Libraries/Python
127 Requires: %{name} = %{version}-%{release}
128 Requires: python3-PyQt5 >= 5
131 PIL image wrapper for Qt.
133 %description qt -l pl.UTF-8
134 Obudowanie obrazów PIL dla Qt.
137 %setup -q -n Pillow-%{version}
139 %if "%{_lib}" == "libx32"
147 PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
148 %{__make} -C docs html \
149 SPHINXBUILD=sphinx-build-3
153 # Check Python 3 modules
154 cp -R $PWD/Tests $PWD/build-3/%py3_libbuilddir/Tests
155 cp -R $PWD/selftest.py $PWD/build-3/%py3_libbuilddir/selftest.py
156 cd build-3/%py3_libbuilddir
157 PYTHONPATH=$PWD %{__python3} selftest.py
161 rm -rf $RPM_BUILD_ROOT
163 # Install Python 3 modules
164 install -d $RPM_BUILD_ROOT%{py3_incdir}/Imaging
165 cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
168 # Fix non-standard-executable-perm
169 chmod +x $RPM_BUILD_ROOT%{py3_sitedir}/PIL/*.so
171 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/{Tests,selftest.py,__pycache__/selftest.*}
174 rm -rf $RPM_BUILD_ROOT
177 %defattr(644,root,root,755)
178 %doc CHANGES.rst README.rst docs/COPYING
179 %dir %{py3_sitedir}/PIL
180 %{py3_sitedir}/PIL/*.py
181 %attr(755,root,root) %{py3_sitedir}/PIL/_imaging.cpython-*.so
182 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingcms.cpython-*.so
183 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingft.cpython-*.so
184 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmath.cpython-*.so
185 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingmorph.cpython-*.so
186 %attr(755,root,root) %{py3_sitedir}/PIL/_webp.cpython-*.so
187 %dir %{py3_sitedir}/PIL/__pycache__
188 %{py3_sitedir}/PIL/__pycache__/*.py[co]
189 %{py3_sitedir}/Pillow-%{version}-py*.egg-info
190 # These are in subpackages
191 %exclude %{py3_sitedir}/PIL/ImageQt.py
192 %exclude %{py3_sitedir}/PIL/ImageTk.py
193 %exclude %{py3_sitedir}/PIL/SpiderImagePlugin.py
194 %exclude %{py3_sitedir}/PIL/_tkinter_finder.py
195 %exclude %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
196 %exclude %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
197 %exclude %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
198 %exclude %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
201 %defattr(644,root,root,755)
202 %{py3_incdir}/Imaging
206 %defattr(644,root,root,755)
207 %doc docs/_build/html
211 %defattr(644,root,root,755)
212 %attr(755,root,root) %{py3_sitedir}/PIL/_imagingtk.cpython-*.so
213 %{py3_sitedir}/PIL/ImageTk.py
214 %{py3_sitedir}/PIL/SpiderImagePlugin.py
215 %{py3_sitedir}/PIL/_tkinter_finder.py
216 %{py3_sitedir}/PIL/__pycache__/ImageTk.cpython-*.py[co]
217 %{py3_sitedir}/PIL/__pycache__/SpiderImagePlugin.cpython-*.py[co]
218 %{py3_sitedir}/PIL/__pycache__/_tkinter_finder.cpython-*.py[co]
221 %defattr(644,root,root,755)
222 %{py3_sitedir}/PIL/ImageQt.py
223 %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]