]> git.pld-linux.org Git - packages/python3-pillow.git/blob - python3-pillow.spec
rebuild with python 3.10
[packages/python3-pillow.git] / python3-pillow.spec
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
11 Summary:        Python 3 image processing library
12 Summary(pl.UTF-8):      Biblioteka do przetwarzania obrazów dla Pythona 3
13 Name:           python3-%{module}
14 Version:        8.4.0
15 Release:        2
16 # License: see http://www.pythonware.com/products/pil/license.htm
17 License:        MIT
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
23 Patch1:         x32.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
44 %if %{with tests}
45 BuildRequires:  python3-olefile
46 %endif
47 %if %{with doc}
48 BuildRequires:  python3-sphinx_issues
49 BuildRequires:  python3-sphinx_removed_in
50 BuildRequires:  python3-sphinx_rtd_theme
51 BuildRequires:  sphinx-pdg-3 >= 2.4
52 %endif
53 # For EpsImagePlugin.py
54 Requires:       ghostscript
55 Provides:       python3-PIL = %{version}-%{release}
56 BuildRoot:      %{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
61 Python image processing library, fork of the Python Imaging Library
62 (PIL).
63
64 This library provides extensive file format support, an efficient
65 internal representation, and powerful image processing capabilities.
66
67 There 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
74 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
75 PIL (Python Imaging Library).
76
77 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
78 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
79
80 Są 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
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
93 Requires:       zlib-devel
94
95 %description devel
96 Development files for Pillow module.
97
98 %description devel -l pl.UTF-8
99 Pliki programistyczne modułu Pillow.
100
101 %package doc
102 Summary:        Documentation for Pillow module
103 Summary(pl.UTF-8):      Dokumentacja do modułu Pillow
104 Group:          Documentation
105 Requires:       %{name} = %{version}-%{release}
106 BuildArch:      noarch
107
108 %description doc
109 Documentation for Pillow module.
110
111 %description doc -l pl.UTF-8
112 Dokumentacja do modułu Pillow.
113
114 %package tk
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
120
121 %description tk
122 Tk interface for Pillow module.
123
124 %description tk -l pl.UTF-8
125 Interfejs Tk do modułu Pillow.
126
127 %package qt
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
133
134 %description qt
135 PIL image wrapper for Qt.
136
137 %description qt -l pl.UTF-8
138 Obudowanie 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}
151 PYTHONPATH=$(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
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
161 PYTHONPATH=$PWD \
162 %{__python3} selftest.py
163 cd ../..
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
170 %endif
171
172 %install
173 rm -rf $RPM_BUILD_ROOT
174
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
178 %py3_install
179
180 %clean
181 rm -rf $RPM_BUILD_ROOT
182
183 %files
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]
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.043908 seconds and 3 git commands to generate.