Skip to content

Commit

Permalink
#3945 we always need pillow
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 30, 2023
1 parent 4f73065 commit df49b59
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 0 deletions.
1 change: 1 addition & 0 deletions packaging/rpm/distros/almalinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ python3-aioquic
PYTHON3=python3.11
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
1 change: 1 addition & 0 deletions packaging/rpm/distros/centos.list
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ python3-aioquic
PYTHON3=python3.11
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
2 changes: 2 additions & 0 deletions packaging/rpm/distros/fedora.list
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ xpra
PYTHON3=python3.12
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand All @@ -27,6 +28,7 @@ xpra
PYTHON3=python3.10
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
1 change: 1 addition & 0 deletions packaging/rpm/distros/oraclelinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ python3-aioquic
PYTHON3=python3.11
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
1 change: 1 addition & 0 deletions packaging/rpm/distros/rockylinux.list
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ python3-aioquic
PYTHON3=python3.11
python3-setuptools
python3-Cython
python3-pillow
python3-pynvml
python3-pyu2f
python3-uinput
Expand Down
95 changes: 95 additions & 0 deletions packaging/rpm/python3-pillow.spec
Original file line number Diff line number Diff line change
@@ -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 <[email protected]> - 10.0.0-1
- initial packaging for python prefixed builds

0 comments on commit df49b59

Please sign in to comment.