[packages/python-pillow] - fixed build, release 5

qboosh qboosh at pld-linux.org
Mon Oct 6 06:18:45 CEST 2025


commit a380e5420b46a718b52b59b43d8f70d9ec0cd264
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Mon Oct 6 06:21:55 2025 +0200

    - fixed build, release 5

 python-pillow.spec | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/python-pillow.spec b/python-pillow.spec
index 24c216b..a979bce 100644
--- a/python-pillow.spec
+++ b/python-pillow.spec
@@ -10,6 +10,7 @@
 %bcond_without	tests	# unit tests
 %bcond_without	python2 # CPython 2.x module
 %bcond_with	python3 # CPython 3.x module
+%bcond_with	py2_qt	# CPython 2.x Qt package
 
 %define		module	pillow
 Summary:	Python 2 image processing library
@@ -17,7 +18,7 @@ Summary(pl.UTF-8):	Biblioteka do przetwarzania obrazów dla Pythona 2
 Name:		python-%{module}
 # NOTE: keep 6.x in this spec for python 2.x support (see note above)
 Version:	6.2.2
-Release:	4
+Release:	5
 # License: see http://www.pythonware.com/products/pil/license.htm
 License:	MIT
 Group:		Libraries/Python
@@ -69,8 +70,8 @@ Provides:	pythonegg(pil) = %{version}
 Obsoletes:	python-PIL < 1:1.1.8
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		py2_libbuilddir %(python -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))')
+%define		py2_libbuilddir %(%{__python} -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))')
 
 %description
 Python image processing library, fork of the Python Imaging Library
@@ -252,6 +253,7 @@ Obudowanie obrazów PIL dla Qt.
 %endif
 
 %build
+%if %{with python2}
 %py_build
 
 %if %{with doc}
@@ -259,6 +261,7 @@ PYTHONPATH=$(pwd)/build-2/%{py2_libbuilddir} \
 %{__make} -C docs html \
 	SPHINXBUILD=sphinx-build-2
 %endif
+%endif
 
 %if %{with python3}
 %py3_build
@@ -271,6 +274,7 @@ PYTHONPATH=$(pwd)/build-3/%{py3_libbuilddir} \
 %endif
 
 %if %{with tests}
+%if %{with python2}
 # Check Python 2 modules
 cp -R $PWD/Tests $PWD/build-2/%py2_libbuilddir/Tests
 cp -R $PWD/selftest.py $PWD/build-2/%py2_libbuilddir/selftest.py
@@ -280,6 +284,7 @@ PYTHONPATH=$PWD \
 cd ../..
 %{__rm} -r build-2/%py2_libbuilddir/Tests
 %{__rm} build-2/%py2_libbuilddir/selftest.py*
+%endif
 
 %if %{with python3}
 # Check Python 3 modules
@@ -316,6 +321,7 @@ cp -p src/libImaging/*.h $RPM_BUILD_ROOT%{py3_incdir}/Imaging
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+%if %{with python2}
 %files
 %defattr(644,root,root,755)
 %doc CHANGES.rst README.rst docs/COPYING
@@ -351,11 +357,12 @@ rm -rf $RPM_BUILD_ROOT
 %{py_sitedir}/PIL/SpiderImagePlugin.py[co]
 %{py_sitedir}/PIL/_tkinter_finder.py[co]
 
-%if 0
+%if %{with qt}
 %files qt
 %defattr(644,root,root,755)
 %{py_sitedir}/PIL/ImageQt.py[co]
 %endif
+%endif
 
 %if %{with python3}
 %files -n python3-%{module}
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-pillow.git/commitdiff/a380e5420b46a718b52b59b43d8f70d9ec0cd264



More information about the pld-cvs-commit mailing list