python-pillow/python-pillow.spec
2021-03-04 16:03:33 +08:00

120 lines
4.5 KiB
RPMSpec

%global py3_incdir %(python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')
%global py3_libbuilddir %(python3 -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
Name: python-pillow
Version: 7.2.0
Release: 4
Summary: Python image processing library
License: MIT
URL: http://python-pillow.github.io/
Source0: https://github.com/python-pillow/Pillow/archive/%{version}/Pillow-%{version}.tar.gz
Patch6000: backport-CVE-2020-35653.patch
Patch6001: backport-CVE-2020-35654.patch
Patch6002: backport-CVE-2020-35655.patch
BuildRequires: freetype-devel ghostscript lcms2-devel libimagequant-devel libjpeg-devel
BuildRequires: libtiff-devel libwebp-devel openjpeg2-devel tk-devel zlib-devel
BuildRequires: python3-cffi python3-devel python3-numpy python3-olefile
BuildRequires: python3-setuptools python3-sphinx python3-sphinx_rtd_theme python3-tkinter
Requires: ghostscript
%global __provides_exclude_from ^%{python3_sitearch}/PIL/.*\\.so$
%description
Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging \
Library by Fredrik Lundh and Contributors. As of 2019, Pillow development is supported by Tidelift.
%package -n python3-pillow
Summary: Python 3 image processing library
%{?python_provide:%python_provide python3-pillow}
Provides: python3-imaging = %{version}-%{release}
Provides: python3-pillow-tk = %{version}-%{release} python3-imaging-tk = %{version}-%{release}
Provides: python3-pillow-qt = %{version}-%{release} python3-imaging-qt = %{version}-%{release}
Requires: python3-olefile python3-tkinter python3-PyQt4
Obsoletes: python3-pillow-tk < %{version}-%{release} python3-pillow-qt < %{version}-%{release}
%{?python_provide:%python_provide python3-pillow-tk}
%{?python_provide:%python_provide python3-pillow-qt}
%description -n python3-pillow
Pillow is the friendly PIL fork by Alex Clark and Contributors. PIL is the Python Imaging \
Library by Fredrik Lundh and Contributors. As of 2019, Pillow development is supported by Tidelift.
%package -n python3-pillow-devel
Summary: Development files for pillow
Requires: python3-devel libjpeg-devel zlib-devel python3-pillow = %{version}-%{release}
%{?python_provide:%python_provide python3-pillow-devel}
Provides: python3-imaging-devel = %{version}-%{release}
%description -n python3-pillow-devel
Development files for pillow.
%package -n python3-pillow-help
Summary: Documentation for pillow
BuildArch: noarch
Requires: python3-pillow = %{version}-%{release}
%{?python_provide:%python_provide python3-pillow-doc}
Provides: python3-imaging-doc = %{version}-%{release} python3-pillow-doc = %{version}-%{release}
Obsoletes: python3-pillow-doc < %{version}-%{release}
%description -n python3-pillow-help
Documentation for pillow.
%prep
%autosetup -p1 -n Pillow-%{version}
%build
%py3_build
PYTHONPATH=$PWD/build/%py3_libbuilddir make -C docs html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
find . -name "docs/_build_py3/html/.buildinfo" -exec rm {} \;
%install
mkdir -p %{buildroot}/%{py3_incdir}/Imaging
install -m 644 src/libImaging/*.h %{buildroot}/%{py3_incdir}/Imaging
%py3_install
%check
ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests
install $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py
pushd build/%py3_libbuilddir
PYTHONPATH=$PWD %{__python3} selftest.py
popd
%files -n python3-pillow
%doc README.rst CHANGES.rst
%license docs/COPYING
%{python3_sitearch}/*
%files -n python3-pillow-devel
%{py3_incdir}/Imaging/
%files -n python3-pillow-help
%doc docs/_build_py3/html
%changelog
* Thu Mar 4 2021 hanhui <hanhui15@huawei.com> - 7.2.0-4
- fix CVE-2020-35654
* Tue Feb 23 2021 jinzhimin <jinzhimin2@huawei.com> - 7.2.0-3
- fix CVE-2020-35655
* Thu Jan 28 2021 renmingshuai <renmingshuai@huawei.com> - 7.2.0-2
- fix CVE-2020-35653
* Mon Aug 10 2020 yanglongkang <yanglongkang@huawei.com> - 7.2.0-1
- update to 7.2.0
* Sat Aug 8 2020 shixuantong <shixuantong@huawei.com> - 5.3.0-5
- remove python2 support
* Wed Mar 11 2020 hy <hu.huyan@huawei.com> - 5.3.0-4
- fix CVE-2019-16865
* Thu Dec 12 2019 Senlin Xia <xiasenlin1@huawei.com> - 5.3.0-3
- Package init