2013-11-07 17:32:23 +01:00
#
# spec file for package python-Pillow
#
2022-01-04 21:24:58 +01:00
# Copyright (c) 2022 SUSE LLC
2013-11-07 17:32:23 +01:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
2018-10-08 17:26:35 +02:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2013-11-07 17:32:23 +01:00
#
2022-01-04 22:24:59 +01:00
%{?!python_module:%define python_module() python3-%{**}}
2020-01-05 19:31:32 +01:00
%define skip_python2 1
2022-01-04 21:24:58 +01:00
%define skip_python36 1
2013-11-07 17:32:23 +01:00
Name : python-Pillow
2022-05-29 20:43:20 +02:00
Version : 9.1.1
2013-11-07 17:32:23 +01:00
Release : 0
Summary : Python Imaging Library (Fork)
2013-11-14 14:21:19 +01:00
License : HPND
2019-04-05 12:55:10 +02:00
URL : https://python-pillow.org/
2017-04-12 21:02:14 +02:00
Source : https://files.pythonhosted.org/packages/source/P/Pillow/Pillow-%{version} .tar.gz
2022-06-01 17:44:59 +02:00
# PATCH-FIX-UPSTREAM https://github.com/python-pillow/Pillow/commit/40a918d274182b7d7c063d7797fb77d967982c4a Set readcount to TIFF_VARIABLE for a variable number of values
Patch0 : tiff-readcount.patch
2022-01-04 22:24:59 +01:00
BuildRequires : %{python_module devel >= 3.7}
2017-04-12 20:20:07 +02:00
BuildRequires : %{python_module olefile}
2020-08-19 11:35:06 +02:00
BuildRequires : %{python_module pytest >= 4.0}
2017-04-12 20:20:07 +02:00
BuildRequires : %{python_module setuptools}
2020-07-12 08:35:51 +02:00
BuildRequires : %{python_module tk}
2017-04-12 20:20:07 +02:00
BuildRequires : fdupes
2019-04-05 12:55:10 +02:00
BuildRequires : libimagequant-devel
2019-04-05 13:00:31 +02:00
BuildRequires : pkgconfig
2017-04-12 20:20:07 +02:00
BuildRequires : python-rpm-macros
2013-11-07 17:32:23 +01:00
BuildRequires : tix
BuildRequires : unzip
2019-04-05 13:00:31 +02:00
BuildRequires : pkgconfig(freetype2)
BuildRequires : pkgconfig(lcms2)
BuildRequires : pkgconfig(libjpeg)
BuildRequires : pkgconfig(libtiff-4)
BuildRequires : pkgconfig(libturbojpeg)
BuildRequires : pkgconfig(libwebp)
BuildRequires : pkgconfig(tk)
BuildRequires : pkgconfig(zlib)
2017-04-12 20:20:07 +02:00
Requires : python-olefile
2021-04-05 13:29:59 +02:00
Obsoletes : python-imaging < %{version}
Provides : python-imaging = %{version}
2018-12-06 13:18:31 +01:00
%if 0%{?suse_version} >= 1500
2019-04-05 13:00:31 +02:00
BuildRequires : pkgconfig(libopenjp2)
2013-11-07 17:32:23 +01:00
%endif
2017-04-12 20:20:07 +02:00
%python_subpackages
2013-11-07 17:32:23 +01:00
%description
Pillow is the " f r i e n d l y " PIL fork by Alex Clark and Contributors. PIL is the
Python Imaging Library by Fredrik Lundh and Contributors.
%package tk
Summary : Python Imaging Library (Fork) - Tcl/Tk Module
Requires : %{name} = %{version}
2017-08-09 20:33:34 +02:00
Requires : python-tk
2013-11-07 17:32:23 +01:00
%description tk
Pillow is the " f r i e n d l y " PIL fork by Alex Clark and Contributors. PIL is the
Python Imaging Library by Fredrik Lundh and Contributors.
%prep
%setup -q -n Pillow-%{version}
%build
2017-04-12 20:20:07 +02:00
%python_build
2013-11-07 17:32:23 +01:00
%install
2017-04-12 20:20:07 +02:00
%python_install
2014-08-02 13:00:59 +02:00
# add missing path
2017-04-12 20:20:07 +02:00
%{python_expand echo " P I L " > %{buildroot} %{$python_sitearch}/PIL.pth}
2021-03-08 10:00:43 +01:00
%python_expand %fdupes %{buildroot} %{$python_sitearch}
2013-11-07 17:32:23 +01:00
%check
2020-08-05 20:37:55 +02:00
%{python_expand export PYTHONPATH=%{buildroot} %{$python_sitearch} PYTHONDONTWRITEBYTECODE=1
2020-11-08 00:40:43 +01:00
%if "%{_arch}" == "s390" || "%{_arch}" == "s390x"
2019-07-03 12:17:36 +02:00
echo " W A R N I N G i g n o r i n g t e s t s c o m p l e t e l y d u e t o h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / i s s u e s / 1 2 0 4 a n d s e g f a u l t "
%else
2020-11-08 00:40:43 +01:00
%if "%{_arch}" == "ppc" || "%{_arch}" == "ppc64"
2017-04-12 20:20:07 +02:00
$python selftest.py --installed || \
2016-03-02 21:10:45 +01:00
echo " W A R N I N G i g n o r e f a i l u r e h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / i s s u e s / 1 2 0 4 "
2020-08-05 20:37:55 +02:00
pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v || \
2016-03-02 21:10:45 +01:00
echo " W A R N I N G i g n o r e f a i l u r e h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / i s s u e s / 1 2 0 4 "
%else
2017-04-12 20:20:07 +02:00
$python selftest.py --installed
2020-08-05 20:37:55 +02:00
pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v -k 'not (test_stroke or test_stroke_multiline)'
2016-03-02 21:10:45 +01:00
%endif
2019-07-03 12:17:36 +02:00
%endif
2017-04-12 20:20:07 +02:00
}
2013-11-07 17:32:23 +01:00
2017-04-12 20:20:07 +02:00
%files %{python_files}
2018-04-08 08:43:57 +02:00
%license LICENSE
2020-11-16 22:01:05 +01:00
%doc CHANGES.rst README.md
2013-11-07 17:32:23 +01:00
%{python_sitearch} /PIL
2014-08-02 13:00:59 +02:00
%{python_sitearch} /PIL.pth
2017-04-12 20:20:07 +02:00
%{python_sitearch} /Pillow-%{version} -py%{python_version} .egg-info
2013-11-07 17:32:23 +01:00
%exclude %{python_sitearch} /PIL/ImageTk*
%exclude %{python_sitearch} /PIL/_imagingtk*
2017-04-12 20:20:07 +02:00
%pycache_only %exclude %{python_sitearch} /PIL/__pycache__/ImageTk.*
2017-08-09 20:33:34 +02:00
2017-04-12 20:20:07 +02:00
%files %{python_files tk}
2013-11-07 17:32:23 +01:00
%{python_sitearch} /PIL/ImageTk*
%{python_sitearch} /PIL/_imagingtk*
2017-04-12 20:20:07 +02:00
%pycache_only %{python_sitearch} /PIL/__pycache__/ImageTk.*
2013-11-07 17:32:23 +01:00
%changelog