]> git.pld-linux.org Git - packages/python3-pillow.git/blob - python3-pillow.spec
- renamed to python3-pillow.spec, updated to 7.0.0 (python 2 and qt4 support dropped)
[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:        7.0.0
15 Release:        1
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:  d099946335c1ba372f5b1fa68ca71645
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
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
43 %if %{with doc}
44 BuildRequires:  python3-sphinx_rtd_theme
45 BuildRequires:  sphinx-pdg-3
46 %endif
47 # For EpsImagePlugin.py
48 Requires:       ghostscript
49 Provides:       python3-PIL = %{version}-%{release}
50 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51
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))')
53
54 %description
55 Python image processing library, fork of the Python Imaging Library
56 (PIL).
57
58 This library provides extensive file format support, an efficient
59 internal representation, and powerful image processing capabilities.
60
61 There are four additional subpackages:
62 - tk (Tk interface),
63 - qt (PIL image wrapper for Qt),
64 - devel (development),
65 - doc (documentation).
66
67 %description -l pl.UTF-8
68 Pythonowa biblioteka do przetwarzania obrazów - odgałęzienie projektu
69 PIL (Python Imaging Library).
70
71 Ta biblioteka zapewnia obsługę wielu formatów plików, wydajną
72 reprezentację wewnętrzną oraz potężne możliwości przetwarzania.
73
74 Są cztery dodatkowe podpakiety:
75 - tk (interfejs Tk),
76 - qt (obudowanie obrazów PIL dla Qt),
77 - devel (do programowania),
78 - doc (dokumentacja).
79
80 %package devel
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
87 Requires:       zlib-devel
88
89 %description devel
90 Development files for Pillow module.
91
92 %description devel -l pl.UTF-8
93 Pliki programistyczne modułu Pillow.
94
95 %package doc
96 Summary:        Documentation for Pillow module
97 Summary(pl.UTF-8):      Dokumentacja do modułu Pillow
98 Group:          Documentation
99 Requires:       %{name} = %{version}-%{release}
100 %if "%{_rpmversion}" >= "4.6"
101 BuildArch:      noarch
102 %endif
103
104 %description doc
105 Documentation for Pillow module.
106
107 %description doc -l pl.UTF-8
108 Dokumentacja do modułu Pillow.
109
110 %package tk
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
116
117 %description tk
118 Tk interface for Pillow module.
119
120 %description tk -l pl.UTF-8
121 Interfejs Tk do modułu Pillow.
122
123 %package qt
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
129
130 %description qt
131 PIL image wrapper for Qt.
132
133 %description qt -l pl.UTF-8
134 Obudowanie obrazów PIL dla Qt.
135
136 %prep
137 %setup -q -n Pillow-%{version}
138 %patch0 -p1
139 %if "%{_lib}" == "libx32"
140 %patch1 -p1
141 %endif
142
143 %build
144 %py3_build
145
146 %if %{with doc}
147 PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
148 %{__make} -C docs html \
149         SPHINXBUILD=sphinx-build-3
150 %endif
151
152 %if %{with tests}
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
158 %endif
159
160 %install
161 rm -rf $RPM_BUILD_ROOT
162
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
166 %py3_install
167
168 # Fix non-standard-executable-perm
169 chmod +x $RPM_BUILD_ROOT%{py3_sitedir}/PIL/*.so
170
171 %{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/{Tests,selftest.py,__pycache__/selftest.*}
172
173 %clean
174 rm -rf $RPM_BUILD_ROOT
175
176 %files
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]
199
200 %files devel
201 %defattr(644,root,root,755)
202 %{py3_incdir}/Imaging
203
204 %if %{with doc}
205 %files doc
206 %defattr(644,root,root,755)
207 %doc docs/_build/html
208 %endif
209
210 %files tk
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]
219
220 %files qt
221 %defattr(644,root,root,755)
222 %{py3_sitedir}/PIL/ImageQt.py
223 %{py3_sitedir}/PIL/__pycache__/ImageQt.cpython-*.py[co]
This page took 0.08665 seconds and 3 git commands to generate.