python-pillow/python-pillow.spec

220 lines
7.3 KiB
RPMSpec
Raw Normal View History

2019-12-13 05:18:31 -05:00
%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))')
2021-03-08 16:00:52 +08:00
%global with_docs 0
Name: python-pillow
Version: 9.0.1
2024-04-03 05:59:51 +08:00
Release: 7
2021-03-08 16:00:52 +08:00
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
Source1: oom-225817ca0f8c663be7ab4b9e717b02c661e66834.tif
2023-12-07 16:59:24 +08:00
# https://github.com/python-pillow/Pillow/blob/c9f1b35/Tests/images/decompression_bomb_extents.gif
Source2: decompression_bomb_extents.gif
2024-04-03 05:59:51 +08:00
# https://github.com/python-pillow/Pillow/blob/2a93aba/Tests/icc/sGrey-v2-nano.icc
Source3: sGrey-v2-nano.icc
2021-03-08 16:00:52 +08:00
Patch0000: python-pillow_spinxwarn.patch
Patch0001: python-pillow_sphinx-issues.patch
2023-12-08 15:23:18 +08:00
Patch0002: backport-Corrected-memory-allocation.patch
Patch0003: CVE-2022-45199.patch
Patch0004: CVE-2023-44271.patch
Patch0005: CVE-2022-45198.patch
2024-01-24 09:47:22 +08:00
Patch0006: CVE-2023-50447.patch
2024-04-03 05:59:51 +08:00
Patch0007: CVE-2024-28219.patch
2021-03-08 16:00:52 +08:00
BuildRequires: freetype-devel ghostscript lcms2-devel libimagequant-devel libjpeg-devel libraqm-devel libtiff-devel
BuildRequires: libwebp-devel openjpeg2-devel tk-devel zlib-devel python3-cffi python3-devel python3-numpy python3-olefile
BuildRequires: python3-qt5 python3-setuptools python3-tkinter
%if 0%{?with_docs}
BuildRequires: make
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx_rtd_theme
BuildRequires: python3-sphinx-removed-in
%endif
Requires: ghostscript
2019-12-13 05:18:31 -05:00
%global __provides_exclude_from ^%{python3_sitearch}/PIL/.*\\.so$
2021-03-08 16:00:52 +08:00
2019-12-13 05:18:31 -05:00
%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.
2021-03-08 16:00:52 +08:00
%package -n python3-pillow
Summary: Python 3 image processing library
2019-12-13 05:18:31 -05:00
%{?python_provide:%python_provide python3-pillow}
2021-03-08 16:00:52 +08:00
Provides: python3-imaging = %{version}-%{release}
2019-12-13 05:18:31 -05:00
2021-03-08 16:00:52 +08:00
Requires: python3-olefile
%description -n python3-pillow
2019-12-13 05:18:31 -05:00
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.
2021-03-08 16:00:52 +08:00
%package -n python3-pillow-devel
Summary: Development files for pillow
Requires: python3-devel libjpeg-devel zlib-devel python3-pillow = %{version}-%{release}
2019-12-13 05:18:31 -05:00
%{?python_provide:%python_provide python3-pillow-devel}
2021-03-08 16:00:52 +08:00
Provides: python3-imaging-devel = %{version}-%{release}
%description -n python3-pillow-devel
2019-12-13 05:18:31 -05:00
Development files for pillow.
2021-03-08 16:00:52 +08:00
%package -n python3-pillow-help
Summary: Documentation for pillow
BuildArch: noarch
Requires: python3-pillow = %{version}-%{release}
2019-12-13 05:18:31 -05:00
%{?python_provide:%python_provide python3-pillow-doc}
2021-03-08 16:00:52 +08:00
Provides: python3-imaging-doc = %{version}-%{release} python3-pillow-doc = %{version}-%{release}
2019-12-13 23:23:27 -05:00
Obsoletes: python3-pillow-doc < %{version}-%{release}
2019-12-13 05:18:31 -05:00
%description -n python3-pillow-help
Documentation for pillow.
2021-03-08 16:00:52 +08:00
%package -n python3-pillow-tk
Summary: Tk interface for pillow
Requires: python3-tkinter
Requires: python3-pillow = %{version}-%{release}
%{?python_provide:%python_provide python3-pillow-tk}
Provides: python3-imaging-tk = %{version}-%{release}
%description -n python3-pillow-tk
Tk interface for %{name}.
%package -n python3-pillow-qt
Summary: Qt pillow image wrapper
Requires: python3-qt5
Requires: python3-pillow = %{version}-%{release}
%{?python_provide:%python_provide python3-pillow-qt}
Provides: python3-imaging-qt = %{version}-%{release}
%description -n python3-pillow-qt
Qt pillow image wrapper.
2019-12-13 05:18:31 -05:00
%prep
2021-03-08 16:00:52 +08:00
%autosetup -p1 -n Pillow-%{version}
2019-12-13 05:18:31 -05:00
%build
cp %{SOURCE1} Tests/images/
2023-12-07 16:59:24 +08:00
cp %{SOURCE2} Tests/images/
2024-04-03 05:59:51 +08:00
cp %{SOURCE3} Tests/icc/
2021-03-08 16:00:52 +08:00
2019-12-13 05:18:31 -05:00
%py3_build
2021-03-08 16:00:52 +08:00
%if 0%{?with_docs}
2019-12-13 05:18:31 -05:00
PYTHONPATH=$PWD/build/%py3_libbuilddir make -C docs html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
2021-03-08 16:00:52 +08:00
rm -f docs/_build_py3/html/.buildinfo
%endif
2019-12-13 05:18:31 -05:00
%install
2019-12-13 23:23:27 -05:00
mkdir -p %{buildroot}/%{py3_incdir}/Imaging
2019-12-13 05:18:31 -05:00
install -m 644 src/libImaging/*.h %{buildroot}/%{py3_incdir}/Imaging
%py3_install
2021-03-08 16:00:52 +08:00
2019-12-13 05:18:31 -05:00
%check
ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests
cp -a $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py
2019-12-13 05:18:31 -05:00
pushd build/%py3_libbuilddir
PYTHONPATH=$PWD %{__python3} selftest.py
popd
2021-03-08 16:00:52 +08:00
2019-12-13 05:18:31 -05:00
%files -n python3-pillow
2021-03-08 16:00:52 +08:00
%doc README.md CHANGES.rst
2019-12-13 05:18:31 -05:00
%license docs/COPYING
2021-03-08 16:00:52 +08:00
%{python3_sitearch}/PIL/
%{python3_sitearch}/Pillow-%{version}-py%{python3_version}.egg-info
%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*
2019-12-13 05:18:31 -05:00
%files -n python3-pillow-devel
%{py3_incdir}/Imaging/
2021-03-08 16:00:52 +08:00
2019-12-13 05:18:31 -05:00
%files -n python3-pillow-help
2021-03-08 16:00:52 +08:00
%if 0%{?with_docs}
2019-12-13 05:18:31 -05:00
%doc docs/_build_py3/html
2021-03-08 16:00:52 +08:00
%endif
%files -n python3-pillow-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 python3-pillow-qt
%{python3_sitearch}/PIL/ImageQt*
%{python3_sitearch}/PIL/__pycache__/ImageQt*
2019-12-13 05:18:31 -05:00
%changelog
2024-04-03 05:59:51 +08:00
* Sun Apr 07 2024 wangkai <13474090681@163.com> - 9.0.1-7
- Fix CVE-2024-28219
2024-01-24 09:47:22 +08:00
* Wed Jan 24 2024 wangkai <13474090681@163.com> - 9.0.1-6
- Fix CVE-2023-50447
2023-12-08 15:23:18 +08:00
* Fri Dec 08 2023 wangkai <13474090681@163.com> - 9.0.1-5
- correct memory allocation in alloc_array (this is the rear patch of CVE-2022-22815,CVE-2022-22816)
2023-12-07 16:59:24 +08:00
* Thu Dec 07 2023 wangkai <13474090681@163.com> - 9.0.1-4
- Fix CVE-2022-45198
* Tue Nov 14 2023 hanhuihui <hanhuihui5@huawei.com> - 9.0.1-3
- Type:CVE
- ID:NA
- SUG:NA
- DESC: fix CVE-2023-44271
* Wed Nov 23 2022 jiangpeng <jiangpeng01@ncti-gba.cn> - 9.0.1-2
- Fix CVE-2022-45199
* Mon Aug 29 2022 yaoxin <yaoxin30@h-partners.com> - 9.0.1-1
- Upgrade to 9.0.1
2022-02-17 17:15:02 +08:00
* Thu Feb 17 2022 dongyuzhen <dongyuzhen@h-partners.com> - 8.1.1-9
- fix CVE-2022-24303
* Fri Feb 11 2022 dongyuzhen <dongyuzhen@h-partners.com> - 8.1.1-8
- fix CVE-2022-22815,CVE-2022-22816,CVE-2022-22817
* Fri Jan 28 2022 herengui <herengui@uniontech.com> - 8.1.1-7
- fix CVE-2021-23437
* Tue Aug 10 2021 hanhui <hanhui15@huawei.com> - 8.1.1-6
- Type:modify CVE-2021-27921CVE-2021-27922CVE-2021-27923
2021-07-15 16:18:24 +08:00
* Thu Jul 15 2021 liuyumeng <liuyumeng5@huawei.com> -8.1.1-5
- Type:bugfix
- CVE:CVE-2021-34552
- SUG:NA
- DESC:incorporate community patch
* Mon Jun 21 2021 hanhui <hanhui15@huawei.com> - 8.1.1-4
- DESC: in the check section,using the cp -a instead of install
2021-07-15 16:18:24 +08:00
* Tue Jun 15 2021 hanhui <hanhui15@huawei.com> - 8.1.1-3
2021-06-15 11:17:17 +08:00
- Type:bugfix
2021-07-15 16:18:24 +08:00
- CVE:CVE-2021-28675 CVE-2021-28676 CVE-2021-28677 CVE-2021-28678 CVE-2021-25287 CVE-2021-25288
2021-06-15 11:17:17 +08:00
- SUG:NA
- DESC: incorporate community patch
* Mon Mar 15 2021 wangye <wangye70@huawei.com> - 8.1.1-2
- Type:CVE
- CVE:CVE-2021-27921 CVE-2021-27922 CVE-2021-27923
- SUG:NA
- DESC: fix CVE-2021-27921CVE-2021-27922CVE-2021-27923
2021-03-08 16:00:52 +08:00
* Mon Mar 08 2021 wangye <wangye70@huawei.com> - 8.1.1-1
- Update to 8.1.1