]> git.pld-linux.org Git - packages/python3-pillow.git/blame - python3-pillow.spec
rebuild with python 3.10
[packages/python3-pillow.git] / python3-pillow.spec
CommitLineData
764150ae
JB
1# NOTE: -qt supports PyQt5 > PySide2 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
10%define module pillow
11Summary: Python 3 image processing library
12Summary(pl.UTF-8): Biblioteka do przetwarzania obrazów dla Pythona 3
13Name: python3-%{module}
c15ca139 14Version: 8.4.0
b239ba53 15Release: 2
764150ae
JB
16# License: see http://www.pythonware.com/products/pil/license.htm
17License: MIT
18Group: Libraries/Python
19#Source0Download: https://pypi.org/simple/pillow/
20Source0: https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version}.tar.gz
c15ca139 21# Source0-md5: 7a1eb5a250c7ccbd549a89e16404f09f
764150ae
JB
22Patch0: %{name}-subpackage.patch
23Patch1: x32.patch
24URL: https://python-pillow.org/
25BuildRequires: freetype-devel >= 2
26BuildRequires: ghostscript
27BuildRequires: lcms2-devel >= 2
28BuildRequires: libimagequant-devel
29BuildRequires: libjpeg-devel
30BuildRequires: libraqm-devel
fad6cf98 31BuildRequires: libtiff-devel >= 4
764150ae 32BuildRequires: libwebp-devel
fad6cf98 33BuildRequires: libxcb-devel
764150ae
JB
34BuildRequires: openjpeg2-devel >= 2
35BuildRequires: pkgconfig
36BuildRequires: python3-cffi
fad6cf98 37BuildRequires: python3-devel >= 1:3.6
764150ae
JB
38BuildRequires: python3-numpy
39BuildRequires: python3-setuptools
40BuildRequires: python3-tkinter
fad6cf98 41BuildRequires: rpmbuild(macros) >= 1.752
764150ae
JB
42BuildRequires: tk-devel
43BuildRequires: zlib-devel
fad6cf98
JB
44%if %{with tests}
45BuildRequires: python3-olefile
46%endif
764150ae 47%if %{with doc}
fad6cf98
JB
48BuildRequires: python3-sphinx_issues
49BuildRequires: python3-sphinx_removed_in
764150ae 50BuildRequires: python3-sphinx_rtd_theme
fad6cf98 51BuildRequires: sphinx-pdg-3 >= 2.4
764150ae
JB
52%endif
53# For EpsImagePlugin.py
54Requires: ghostscript
55Provides: python3-PIL = %{version}-%{release}
56BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
57
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))')
59
60%description
61Python image processing library, fork of the Python Imaging Library
62(PIL).
63
64This library provides extensive file format support, an efficient
65internal representation, and powerful image processing capabilities.
66
67There are four additional subpackages:
68- tk (Tk interface),
69- qt (PIL image wrapper for Qt),
70- devel (development),
71- doc (documentation).
72
73%description -l pl.UTF-8
74Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
75PIL (Python Imaging Library).
76
77Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
78reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
79
80Są cztery dodatkowe podpakiety:
81- tk (interfejs Tk),
82- qt (obudowanie obrazów PIL dla Qt),
83- devel (do programowania),
84- doc (dokumentacja).
85
86%package devel
87Summary: Development files for Pillow module
88Summary(pl.UTF-8): Pliki programistyczne modułu Pillow
89Group: Development/Libraries
90Requires: %{name} = %{version}-%{release}
91Requires: libjpeg-devel
92Requires: python3-devel >= 1:3.5
93Requires: zlib-devel
94
95%description devel
96Development files for Pillow module.
97
98%description devel -l pl.UTF-8
99Pliki programistyczne modułu Pillow.
100
101%package doc
102Summary: Documentation for Pillow module
103Summary(pl.UTF-8): Dokumentacja do modułu Pillow
104Group: Documentation
105Requires: %{name} = %{version}-%{release}
9c4e31b2 106BuildArch: noarch
764150ae
JB
107
108%description doc
109Documentation for Pillow module.
110
111%description doc -l pl.UTF-8
112Dokumentacja do modułu Pillow.
113
114%package tk
115Summary: Tk interface for Pillow module
116Summary(pl.UTF-8): Interfejs Tk do modułu Pillow
117Group: Libraries/Python
118Requires: %{name} = %{version}-%{release}
119Requires: python3-tkinter >= 1:3.5
120
121%description tk
122Tk interface for Pillow module.
123
124%description tk -l pl.UTF-8
125Interfejs Tk do modułu Pillow.
126
127%package qt
128Summary: PIL image wrapper for Qt
129Summary(pl.UTF-8): Obudowanie obrazów PIL dla Qt
130Group: Libraries/Python
131Requires: %{name} = %{version}-%{release}
132Requires: python3-PyQt5 >= 5
133
134%description qt
135PIL image wrapper for Qt.
136
137%description qt -l pl.UTF-8
138Obudowanie obrazów PIL dla Qt.
139
140%prep
141%setup -q -n Pillow-%{version}
142%patch0 -p1
143%if "%{_lib}" == "libx32"
144%patch1 -p1
145%endif
146
147%build
148%py3_build
149
150%if %{with doc}
151PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
152%{__make} -C docs html \
153 SPHINXBUILD=sphinx-build-3
154%endif
155
156%if %{with tests}
157# Check Python 3 modules
158cp -R $PWD/Tests $PWD/build-3/%py3_libbuilddir/Tests
159cp -R $PWD/selftest.py $PWD/build-3/%py3_libbuilddir/selftest.py
160cd build-3/%py3_libbuilddir
fad6cf98
JB
161PYTHONPATH=$PWD \
162%{__python3} selftest.py
163cd ../..
164# qt test crashes without DISPLAY
165PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
166PYTHONPATH=$PWD/build-3/%py3_libbuilddir \
167%{__python3} -m pytest Tests -k 'not test_qt_image_qapplication'
c15ca139
JB
168%{__rm} -r build-3/%py3_libbuilddir/Tests
169%{__rm} build-3/%py3_libbuilddir/selftest.py
764150ae
JB
170%endif
171
172%install
173rm -rf $RPM_BUILD_ROOT
174
175# Install Python 3 modules
176install -d $RPM_BUILD_ROOT%{py3_incdir}/Imaging
177cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
178%py3_install
179
764150ae
JB
180%clean
181rm -rf $RPM_BUILD_ROOT
182
183%files
184%defattr(644,root,root,755)
fad6cf98 185%doc CHANGES.rst LICENSE README.md
764150ae
JB
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]
206
207%files devel
208%defattr(644,root,root,755)
209%{py3_incdir}/Imaging
210
211%if %{with doc}
212%files doc
213%defattr(644,root,root,755)
214%doc docs/_build/html
215%endif
216
217%files tk
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]
226
227%files qt
228%defattr(644,root,root,755)
229%{py3_sitedir}/PIL/ImageQt.py
230%{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
This page took 0.116791 seconds and 4 git commands to generate.