Sophie

Sophie

distrib > Mageia > 7 > x86_64 > by-pkgid > e495bfb0c3db167421e07edd8769eed1 > files > 26

python-pillow-5.4.1-1.3.mga7.src.rpm

%define py2_incdir %(python2 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')
%define py3_incdir %(python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')
%define py2_libbuilddir %(python2 -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
%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))')

%global srcname pillow

%global __provides_exclude_from %{python_sitearch}/.*\\.so\\|%{python3_sitearch}/.*\\.so

%define name3 python3-pillow
%define name2 python2-pillow

Name:           python-%{srcname}
Version:        5.4.1
%define subrel  3
Release:        %mkrel 1
Summary:        Python image processing library

Group:          Development/Python
License:        MIT
URL:            http://python-pillow.github.io/
Source0:        https://pypi.io/packages/source/P/Pillow/Pillow-%version.tar.gz
# Testdata for Patch4
Source1:        https://github.com/python-pillow/Pillow/raw/a09acd0decd8a87ccce939d5ff65dab59e7d365b/Tests/images/fli_overrun2.bin
# Testdata for Patch5
Source2:        https://github.com/python-pillow/Pillow/raw/93b22b846e0269ee9594ff71a72bec02d2bea8fd/Tests/images/pcx_overrun2.bin
# Testdata for Patch6
Source3:        https://github.com/python-pillow/Pillow/raw/a79b65c47c7dc6fe623aadf09aa6192fc54548f3/Tests/images/sgi_overrun_expandrow.bin
Source4:        https://github.com/python-pillow/Pillow/raw/a79b65c47c7dc6fe623aadf09aa6192fc54548f3/Tests/images/sgi_overrun_expandrow2.bin
# Testdata for Patch7
Source5:        https://github.com/python-pillow/Pillow/raw/4e2def2539ec13e53a82e06c4b3daf00454100c4/Tests/images/tiff_overflow_rows_per_strip.tif
# Testdata for Patch8
Source6:        https://github.com/python-pillow/Pillow/raw/774e53bb132461d8d5ebefec1162e29ec0ebc63d/Tests/images/input_bw_five_bands.fpx
# Backported patches for CVE-2019-16865
# See https://github.com/python-pillow/Pillow/issues/4123
Patch0:         87c43b66a5ffe0d21e04dce631a5fd4004e6021b.patch
Patch1:         9a977b975cd871ef9a9128b72414c0de3a292591.patch
Patch2:         ab52630d0644e42a75eb88b78b9a9d7438a6fbeb.patch
Patch3:         eed2bfc5b49782f33c5c73080b1d15abcc1e0c38.patch
# Backport patch for CVE-2020-5313
# https://github.com/python-pillow/Pillow/commit/a09acd0decd8a87ccce939d5ff65dab59e7d365b
Patch4:         a09acd0decd8a87ccce939d5ff65dab59e7d365b.patch
# Backport patch for CVE-2020-5312
# https://github.com/python-pillow/Pillow/commit/93b22b846e0269ee9594ff71a72bec02d2bea8fd
Patch5:         93b22b846e0269ee9594ff71a72bec02d2bea8fd.patch
# Backport patch for CVE-2020-5311
# https://github.com/python-pillow/Pillow/commit/a79b65c47c7dc6fe623aadf09aa6192fc54548f3
Patch6:         a79b65c47c7dc6fe623aadf09aa6192fc54548f3.patch
# Backport patch for CVE-2020-5310
# https://github.com/python-pillow/Pillow/commit/4e2def2539ec13e53a82e06c4b3daf00454100c4
Patch7:         4e2def2539ec13e53a82e06c4b3daf00454100c4.patch
# Backport patch for CVE-2019-19911
# https://github.com/python-pillow/Pillow/commit/774e53bb132461d8d5ebefec1162e29ec0ebc63d
Patch8:         774e53bb132461d8d5ebefec1162e29ec0ebc63d.patch
Patch9:         CVE-2020-10177-1.patch
Patch10:        CVE-2020-10177-2.patch
Patch11:        CVE-2020-10177-3.patch
Patch12:        CVE-2020-10177-4.patch
Patch13:        CVE-2020-10177-5.patch
Patch14:        CVE-2020-10177-6.patch
Patch15:        CVE-2020-10177-7.patch
Patch16:        CVE-2020-10177-8.patch
Patch17:        CVE-2020-10378.patch
Patch18:        CVE-2020-10994-1.patch
Patch19:        CVE-2020-10994-2.patch
Patch20:        CVE-2020-11538.patch

BuildRequires:  pkgconfig(tk)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libopenjp2)
BuildRequires:  pkgconfig(imagequant)
BuildRequires:  pkgconfig(zlib)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(lcms2)
BuildRequires:  ghostscript
BuildRequires:  pkgconfig(libwebp)
BuildRequires:  pkgconfig(python)
BuildRequires:  python-setuptools
BuildRequires:  tkinter
BuildRequires:  PyQt4
BuildRequires:  python-numpy
BuildRequires:  python-sphinx
BuildRequires:  pythonegg(2)(sphinx-rtd-theme)
BuildRequires:  pkgconfig(libtiff-4)
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  tkinter3
BuildRequires:  python3-qt5
BuildRequires:  python3-numpy
BuildRequires:  python3-sphinx
BuildRequires:  python3-sphinx_rtd_theme

# For EpsImagePlugin.py
Requires:	ghostscript

Provides:       python-imaging = %{version}-%{release}
Obsoletes:      python-imaging <= 1.1.7-12

%description
Python image processing library, fork of the Python Imaging Library (PIL)

This library provides extensive file format support, an efficient
internal representation, and powerful image processing capabilities.

There are five subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
sane (scanning devices interface), devel (development) and doc (documentation).

%package -n %{name2}
Summary:        Python 2 image processing library
Provides:       python-imaging = %{version}-%{release}
Provides:       python2-imaging = %{version}-%{release}
# For MicImagePlugin.py, FpxImagePlugin.py
Requires:       python2-olefile
Provides:       python-%{srcname} = %{version}-%{release}
Obsoletes:      python-%{srcname} < %{version}-%{release}
Obsoletes:	python2-pil

%description -n %{name2}
Python image processing library, fork of the Python Imaging Library (PIL)
This library provides extensive file format support, an efficient
internal representation, and powerful image processing capabilities.
There are four subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
devel (development) and doc (documentation).

%package -n %{name2}-devel
Summary:        Development files for %{name}
Group:          Development/C
Requires:       %{name2} = %{version}-%{release}
Requires:       python-devel, libjpeg-devel, zlib-devel
Provides:       python-imaging-devel = %{version}-%{release}
Obsoletes:      python-imaging-devel <= 1.1.7-12
Provides:       python-%{srcname}-devel = %{version}-%{release}
Obsoletes:      python-%{srcname}-devel < %{version}-%{release}

%description -n %{name2}-devel
Development files for %{name}.

%package -n %{name2}-doc
Summary:        Documentation for %{name}
Group:          Documentation
Requires:       %{name} = %{version}-%{release}
BuildArch:      noarch
Provides:       python-%{srcname}-doc = %{version}-%{release}
Obsoletes:      python-%{srcname}-doc < %{version}-%{release}

%description -n %{name2}-doc
Documentation for %{name}.

%package -n %{name2}-tk
Summary:        Tk interface for %{name}
Group:          System/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       tkinter
Provides:       python-imaging-tk = %{version}-%{release}
Obsoletes:      python-imaging-tk <= 1.1.7-12
Provides:       python-%{srcname}-tk = %{version}-%{release}
Obsoletes:      python-%{srcname}-tk < %{version}-%{release}

%description -n %{name2}-tk
Tk interface for %{name}.

%package -n %{name2}-qt
Summary:        PIL image wrapper for Qt
Group:          System/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       PyQt4
Provides:       python-imaging-qt = %{version}-%{release}
Provides:       python-%{srcname}-qt = %{version}-%{release}
Obsoletes:      python-%{srcname}-qt < %{version}-%{release}

%description -n %{name2}-qt
PIL image wrapper for Qt.

%package -n %{name3}
Group:          Development/Python
Summary:        Python 3 image processing library
Provides:       python3-imaging = %{version}-%{release}
Provides:       %{name3} = %{version}-%{release}

%description -n %{name3}
Python image processing library, fork of the Python Imaging Library (PIL)

This library provides extensive file format support, an efficient
internal representation, and powerful image processing capabilities.

There are five subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
sane (scanning devices interface), devel (development) and doc (documentation).

%package -n %{name3}-devel
Summary:        Development files for %{name3}
Group:          Development/C
Requires:       %{name3} = %{version}-%{release}
Requires:       python3-devel, libjpeg-devel, zlib-devel

%description -n %{name3}-devel
Development files for %{name3}.

%package -n %{name3}-doc
Summary:        Documentation for %{name3}
Group:          Documentation
Requires:       %{name3} = %{version}-%{release}
BuildArch:      noarch

%description -n %{name3}-doc
Documentation for %{name3}.

%package -n %{name3}-tk
Summary:        Tk interface for %{name3}
Group:          System/Libraries
Requires:       %{name3} = %{version}-%{release}
Requires:       python3-tkinter
Conflicts:	%{name3} < 3.0.0-2

%description -n %{name3}-tk
Tk interface for %{name3}.

%package -n %{name3}-qt
Summary:        PIL image wrapper for Qt
Group:          System/Libraries
Requires:       %{name3} = %{version}-%{release}
Requires:       python3-qt5
Conflicts:	%{name3} < 3.0.0-2

%description -n %{name3}-qt
PIL image wrapper for Qt.

%prep
%autosetup -p1 -n Pillow-%{version}

cp -a %{SOURCE1} Tests/images/fli_overrun2.bin
cp -a %{SOURCE2} Tests/images/pcx_overrun2.bin
cp -a %{SOURCE3} Tests/images/sgi_overrun_expandrow.bin
cp -a %{SOURCE4} Tests/images/sgi_overrun_expandrow2.bin
cp -a %{SOURCE5} Tests/images/tiff_overflow_rows_per_strip.tif
cp -a %{SOURCE6} Tests/images/input_bw_five_bands.fpx

%build
%py2_build

PYTHONPATH=$PWD/build/%py2_libbuilddir make -C docs html BUILDDIR=_build_py2 SPHINXBUILD=sphinx-build-%python2_version
rm -f docs/_build_py2/html/.buildinfo

%py3_build

PYTHONPATH=$PWD/build/%py3_libbuilddir make -C docs html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
rm -f docs/_build_py3/html/.buildinfo



%install
# Install Python 2 modules
install -d %{buildroot}/%{py2_incdir}/Imaging
install -m 644 src/libImaging/*.h %{buildroot}/%{py2_incdir}/Imaging
%py2_install

# Install Python 3 modules
install -d %{buildroot}/%{py3_incdir}/Imaging
install -m 644 src/libImaging/*.h %{buildroot}/%{py3_incdir}/Imaging

%py3_install


%check
# Check Python 2 modules
ln -s $PWD/Images $PWD/build/%py2_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py2_libbuilddir/Tests
cp -R $PWD/selftest.py $PWD/build/%py2_libbuilddir/selftest.py
pushd build/%py2_libbuilddir
PYTHONPATH=$PWD %{__python2} selftest.py
popd

# Check Python 3 modules
ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests
cp -R $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py
pushd build/%py3_libbuilddir
PYTHONPATH=$PWD %{__python3} selftest.py
popd

%files -n %{name2}
%doc README.rst CHANGES.rst docs/COPYING
%{python2_sitearch}/*
# These are in subpackages
%exclude %{python2_sitearch}/PIL/_imagingtk*
%exclude %{python2_sitearch}/PIL/ImageTk*
%exclude %{python2_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python2_sitearch}/PIL/ImageQt*

%files -n %{name2}-devel
%{py2_incdir}/Imaging/

%files -n %{name2}-doc
%doc docs/_build_py2/html

%files -n %{name2}-tk
%{python2_sitearch}/PIL/_imagingtk*
%{python2_sitearch}/PIL/ImageTk*
%{python2_sitearch}/PIL/SpiderImagePlugin*

%files -n %{name2}-qt
%{python2_sitearch}/PIL/ImageQt*

%files -n %{name3}
%doc README.rst CHANGES.rst docs/COPYING
%{python3_sitearch}/*
# These are in subpackages
%exclude %{python3_sitearch}/*sane*
%exclude %{python3_sitearch}/PIL/_imagingtk*
%exclude %{python3_sitearch}/PIL/ImageTk*
%exclude %{python3_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python3_sitearch}/PIL/ImageQt*
%exclude %{python3_sitearch}/PIL/__pycache__/ImageTk*
%exclude %{python3_sitearch}/PIL/__pycache__/SpiderImagePlugin*
%exclude %{python3_sitearch}/PIL/__pycache__/ImageQt*

%files -n %{name3}-devel
%{py3_incdir}/Imaging/

%files -n %{name3}-doc
%doc docs/_build_py3/html

%files -n %{name3}-tk
%{python3_sitearch}/PIL/_imagingtk*
%{python3_sitearch}/PIL/ImageTk*
%{python3_sitearch}/PIL/SpiderImagePlugin*
%{python3_sitearch}/PIL/__pycache__/ImageTk*
%{python3_sitearch}/PIL/__pycache__/SpiderImagePlugin*

%files -n %{name3}-qt
%{python3_sitearch}/PIL/ImageQt*
%{python3_sitearch}/PIL/__pycache__/ImageQt*


%changelog
* Sat Nov 21 2020 philippem <philippem> 5.4.1-1.3.mga7
+ Revision: 1648155
- build with libimagequant and openjpeg
- python-pillow new security issues CVE-2020-10378, CVE-2020-10379, CVE-2020-10177, CVE-2020-10994, CVE-2020-11538 mga#26919
+ daviddavid <daviddavid>
- add upstream patches to fix CVE-2019-16865, CVE-2019-19911, CVE-2020-531[0-3] (mga#25968)

* Fri Jan 11 2019 kekepower <kekepower> 5.4.1-1.mga7
+ Revision: 1354964
- Update to version 5.4.1

* Sat Jan 05 2019 wally <wally> 5.3.0-2.mga7
+ Revision: 1349857
- rebuild for python3.7

* Fri Dec 28 2018 luigiwalser <luigiwalser> 5.3.0-1.mga7
+ Revision: 1345815
- 5.3.0

* Sun Sep 23 2018 umeabot <umeabot> 4.3.0-4.mga7
+ Revision: 1300545
- Mageia 7 Mass Rebuild

* Sun Apr 29 2018 joequant <joequant> 4.3.0-3.mga7
+ Revision: 1223473
- regenerate rpms

* Fri Apr 27 2018 luigiwalser <luigiwalser> 4.3.0-2.mga7
+ Revision: 1222745
- obsolete wrongly imported python-pil

* Mon Oct 16 2017 joequant <joequant> 4.3.0-1.mga7
+ Revision: 1172291
- upgrade to 4.3.0

* Thu Aug 03 2017 philippem <philippem> 4.2.1-1.mga7
+ Revision: 1134296
- update to 4.2.1

* Wed Oct 26 2016 luigiwalser <luigiwalser> 3.4.2-1.mga6
+ Revision: 1063598
- 3.4.2

* Wed Oct 12 2016 philippem <philippem> 3.4.1-1.mga6
+ Revision: 1060512
- update to 3.4.1

* Sun Apr 10 2016 philippem <philippem> 3.2.0-1.mga6
+ Revision: 1000067
- update to 3.2.0

* Mon Feb 08 2016 philippem <philippem> 3.1.1-1.mga6
+ Revision: 948936
- update to 3.1.1 (fix CVE-2016-2533, CVE-2016-0775, CVE-2016-0740)

* Thu Feb 04 2016 philippem <philippem> 3.1.0-2.mga6
+ Revision: 936143
- fix buffer overflow mga#17671

* Thu Jan 21 2016 daviddavid <daviddavid> 3.1.0-1.mga6
+ Revision: 926206
- new version: 3.1.0

* Sat Jan 02 2016 luigiwalser <luigiwalser> 3.0.0-4.mga6
+ Revision: 918205
- rebuild for libwebp

* Fri Oct 23 2015 luigiwalser <luigiwalser> 3.0.0-3.mga6
+ Revision: 894647
- add conflicts to fix upgrade for mga#16975

* Mon Oct 19 2015 philippem <philippem> 3.0.0-2.mga6
+ Revision: 892704
- Some Bytecode files were in the wrong rpm

* Sat Oct 10 2015 philippem <philippem> 3.0.0-1.mga6
+ Revision: 889373
- update to 3.0.0

* Thu Oct 08 2015 daviddavid <daviddavid> 2.9.0-2.mga6
+ Revision: 887342
- rebuild for python 3.5
- rebuild for tcl/tk 8.6.4

* Fri Aug 28 2015 philippem <philippem> 2.9.0-1.mga6
+ Revision: 870452
- update to 2.9.0, move python-sane in a new package

* Mon Mar 02 2015 luigiwalser <luigiwalser> 2.6.2-2.mga5
+ Revision: 817289
- bump release tag to fix upgrade from mga4 (mga#15392)

* Sat Jan 24 2015 philippem <philippem> 2.6.2-1.mga5
+ Revision: 812146
- Update to 2.6.2, security fix mga#15115

* Wed Oct 15 2014 umeabot <umeabot> 2.5.3-4.mga5
+ Revision: 750439
- Second Mageia 5 Mass Rebuild

* Sat Sep 27 2014 tv <tv> 2.5.3-3.mga5
+ Revision: 726908
- rebuild for missing pythoneggs deps

* Tue Sep 16 2014 umeabot <umeabot> 2.5.3-2.mga5
+ Revision: 688215
- Mageia 5 Mass Rebuild

* Thu Aug 21 2014 luigiwalser <luigiwalser> 2.5.3-1.mga5
+ Revision: 666105
- Update to 2.5.3 (Fix CVE-2014-3598, a DOS in the Jpeg2KImagePlugin)

* Fri Aug 15 2014 philippem <philippem> 2.5.2-1.mga5
+ Revision: 662700
- Update to 2.5.2 (Fix CVE-2014-3589, a DOS in the IcnsImagePlugin)

* Mon Aug 11 2014 philippem <philippem> 2.5.1-1.mga5
+ Revision: 661679
- update to 2.5.1

* Thu Jul 03 2014 philippem <philippem> 2.5.0-1.mga5
+ Revision: 642788
- update to 2.5.0

* Sun Jun 01 2014 pterjan <pterjan> 2.4.0-0.2.mga5
+ Revision: 630390
- Soften python3 dependency
- Rebuild for new Python
+ daviddavid <daviddavid>
- fix description on main python3-pillow package

* Fri Apr 04 2014 philippem <philippem> 2.4.0-0.1.mga5
+ Revision: 611707
- update to 2.4.0

* Sun Mar 23 2014 luigiwalser <luigiwalser> 2.3.1-0.1.mga5
+ Revision: 606963
- 2.3.1 (fixes CVE-2014-1932 and CVE-2014-1933)

* Sat Feb 15 2014 luigiwalser <luigiwalser> 2.3.0-0.1.mga5
+ Revision: 592373
- update to 2.3.0 (sync with fedora)
- change lcms BR to lcms2
- add patches from fedora (including one to fix a test)
- add missing ghostscript Requires and BuildRequires (from fedora)
- add upstream patch to fix build with freetype 2.5
- rebuild for libwebp

* Tue Oct 22 2013 umeabot <umeabot> 2.2.1-0.3.mga4
+ Revision: 544030
- Mageia 4 Mass Rebuild

* Tue Oct 15 2013 pterjan <pterjan> 2.2.1-0.2.mga4
+ Revision: 499118
- Rebuild to add different pythonegg provides for python 2 and 3

* Fri Oct 04 2013 philippem <philippem> 2.2.1-0.1.mga4
+ Revision: 491495
- Update to 2.2.1

* Sat Sep 07 2013 philippem <philippem> 2.1.0-0.2.mga4
+ Revision: 475735
- Add patch to fix memory corruption caused by invalid palette size, mga#10729

* Mon Jul 08 2013 philippem <philippem> 2.1.0-0.1.mga4
+ Revision: 451502
- Update to 2.1.0
- Update to 2.1.0

* Wed Jul 03 2013 philippem <philippem> 2.0.0-0.gitd1c6db8.4.mga4
+ Revision: 449875
- obsolete old PIL

* Mon Jul 01 2013 philippem <philippem> 2.0.0-0.gitd1c6db8.3.mga4
+ Revision: 448886
+ rebuild (emptylog)

* Sat Jun 29 2013 philippem <philippem> 2.0.0-0.gitd1c6db8.2.mga4
+ Revision: 448390
- add provides

* Sat Jun 29 2013 philippem <philippem> 2.0.0-0.gitd1c6db8.1.mga4
+ Revision: 448268
- fix groups
- add Python3
- add missing BR
- imported package python-pillow