From df49b59170f645723966ae9a57993b1a28620aa2 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 30 Jul 2023 10:51:26 +0200 Subject: [PATCH] #3945 we always need pillow --- packaging/rpm/distros/almalinux.list | 1 + packaging/rpm/distros/centos.list | 1 + packaging/rpm/distros/fedora.list | 2 + packaging/rpm/distros/oraclelinux.list | 1 + packaging/rpm/distros/rockylinux.list | 1 + packaging/rpm/python3-pillow.spec | 95 ++++++++++++++++++++++++++ 6 files changed, 101 insertions(+) create mode 100644 packaging/rpm/python3-pillow.spec diff --git a/packaging/rpm/distros/almalinux.list b/packaging/rpm/distros/almalinux.list index 941f81ba37..62edba1d44 100644 --- a/packaging/rpm/distros/almalinux.list +++ b/packaging/rpm/distros/almalinux.list @@ -16,6 +16,7 @@ python3-aioquic PYTHON3=python3.11 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput diff --git a/packaging/rpm/distros/centos.list b/packaging/rpm/distros/centos.list index 2b565ebfb1..f69440eb9c 100644 --- a/packaging/rpm/distros/centos.list +++ b/packaging/rpm/distros/centos.list @@ -17,6 +17,7 @@ python3-aioquic PYTHON3=python3.11 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput diff --git a/packaging/rpm/distros/fedora.list b/packaging/rpm/distros/fedora.list index 566afdf630..121dadb34d 100644 --- a/packaging/rpm/distros/fedora.list +++ b/packaging/rpm/distros/fedora.list @@ -15,6 +15,7 @@ xpra PYTHON3=python3.12 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput @@ -27,6 +28,7 @@ xpra PYTHON3=python3.10 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput diff --git a/packaging/rpm/distros/oraclelinux.list b/packaging/rpm/distros/oraclelinux.list index cb7945da69..a78ecd79b0 100644 --- a/packaging/rpm/distros/oraclelinux.list +++ b/packaging/rpm/distros/oraclelinux.list @@ -18,6 +18,7 @@ python3-aioquic PYTHON3=python3.11 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput diff --git a/packaging/rpm/distros/rockylinux.list b/packaging/rpm/distros/rockylinux.list index 941f81ba37..62edba1d44 100644 --- a/packaging/rpm/distros/rockylinux.list +++ b/packaging/rpm/distros/rockylinux.list @@ -16,6 +16,7 @@ python3-aioquic PYTHON3=python3.11 python3-setuptools python3-Cython +python3-pillow python3-pynvml python3-pyu2f python3-uinput diff --git a/packaging/rpm/python3-pillow.spec b/packaging/rpm/python3-pillow.spec new file mode 100644 index 0000000000..ed84d79cec --- /dev/null +++ b/packaging/rpm/python3-pillow.spec @@ -0,0 +1,95 @@ +%global debug_package %{nil} +%define _disable_source_fetch 0 +%global srcname pillow + +%if "%{getenv:PYTHON3}" == "" +%global python3 python3 +%define package_prefix python3- +%else +%global python3 %{getenv:PYTHON3} +%define package_prefix %{python3}- +%undefine __pythondist_requires +%undefine __python_requires +%define python3_sitearch %(%{python3} -Ic "from sysconfig import get_path; print(get_path('platlib').replace('/usr/local/', '/usr/'))" 2> /dev/null) +%endif + + +Name: %{package_prefix}%{srcname} +Version: 10.0.0 +Release: 1%{?dist} +Summary: Python image processing library + +# License: see http://www.pythonware.com/products/pil/license.htm +License: MIT +URL: http://python-pillow.github.io/ +Source0: https://github.com/python-pillow/Pillow/archive/%{version}/Pillow-%{version}.tar.gz + +BuildRequires: freetype-devel +BuildRequires: gcc +BuildRequires: lcms2-devel +BuildRequires: libimagequant-devel +BuildRequires: libjpeg-devel +BuildRequires: libwebp-devel +BuildRequires: zlib-devel + +BuildRequires: %{package_prefix}devel +BuildRequires: %{package_prefix}setuptools + + +%global __provides_exclude_from ^%{python3_sitearch}/PIL/.*\\.so$ + +%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. + + +%package -n %{package_prefix}-%{srcname} +Summary: Python 3 image processing library +%{?python_provide:%python_provide %{package_prefix}-%{srcname}} +Provides: %{package_prefix}-imaging = %{version}-%{release} +# For MicImagePlugin.py, FpxImagePlugin.py +Requires: %{package_prefix}-olefile + +%description -n %{package_prefix}-%{srcname} +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). + + +%prep +sha256=`sha256sum %{SOURCE0} | awk '{print $1}'` +if [ "${sha256}" != "535d17e830427bec163027114ded1def9ab0350c99bf1d8cb10535032967f3a5" ]; then + echo "invalid checksum for %{SOURCE0}" + exit 1 +fi +%autosetup -n Pillow-%{version} + +%build +CFLAGS="$RPM_OPT_FLAGS" %{python3} setup.py build + +%install +%{python3} setup.py install -O1 --skip-build --root %{buildroot} + +%files -n %{package_prefix}-%{srcname} +%doc README.md CHANGES.rst +%license docs/COPYING +%{python3_sitearch}/PIL/ +%{python3_sitearch}/Pillow-%{version}-py*.egg-info +# simplified build does not shi these: +%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* + +%changelog +* Sun Jul 30 2023 Antoine Martin - 10.0.0-1 +- initial packaging for python prefixed builds