Update to new git snapshow, add qt subpackage

This commit is contained in:
Sandro Mani 2013-04-19 18:54:39 +02:00
parent da3613d089
commit 88232278e4
5 changed files with 54 additions and 1865 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
/python-imaging-Pillow-2.0.0-26-g2e88848.tar.gz
/python-imaging-Pillow-2.0.0-28-gde210a2.tar.gz
/python-imaging-Pillow-2.0.0-58-g93a488e.tar.gz
/python-imaging-Pillow-2.0.0-105-gd1c6db8.tar.gz

View File

@ -6,9 +6,9 @@
# Refer to the comment for Source0 below on how to obtain the source tarball
# The saved file has format python-imaging-Pillow-$version-$ahead-g$shortcommit.tar.gz
%global commit 93a488ef761d2325bc38a827893d2d8035f95afc
%global commit d1c6db88d4dee462c6bbf4e22555e3ddd410d06a
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global ahead 58
%global ahead 105
# If ahead is 0, the tarball corresponds to a release version, otherwise to a git snapshot
%if %{ahead} > 0
@ -17,8 +17,8 @@
Name: python-pillow
Version: 2.0.0
Release: 5%{?snap}%{?dist}
Summary: Python 2 image processing library
Release: 6%{?snap}%{?dist}
Summary: Python image processing library
# License: see http://www.pythonware.com/products/pil/license.htm
License: MIT
@ -30,10 +30,6 @@ Source0: https://github.com/python-imaging/Pillow/tarball/%{commit}/pytho
# Add s390* and ppc* archs
Patch0: python-pillow-archs.patch
# Fix quantization code
Patch1: python-pillow_quantization.patch
# Fix tests which are hardcoded for little-endian CPUs
Patch2: python-pillow_endianness.patch
BuildRequires: python2-devel
BuildRequires: python-setuptools
@ -46,11 +42,15 @@ BuildRequires: freetype-devel
BuildRequires: lcms-devel
BuildRequires: sane-backends-devel
BuildRequires: libwebp-devel
BuildRequires: PyQt4
BuildRequires: numpy
%if %{with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-tkinter
BuildRequires: python3-PyQt4
BuildRequires: python3-numpy
%endif
Provides: python-imaging = %{version}-%{release}
@ -70,9 +70,8 @@ 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.
Notice that in order to reduce the package dependencies there are
three subpackages: devel (for development); tk (to interact with the
tk interface) and sane (scanning devices interface).
There are five subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
sane (scanning devices interface), devel (development) and doc (documentation).
%package devel
@ -120,6 +119,17 @@ Obsoletes: python-imaging-tk <= 1.1.7-12
%description tk
Tk interface for %{name}.
%package qt
Summary: PIL image wrapper for Qt
Group: System Environment/Libraries
Obsoletes: %{name} <= 2.0.0-5.git93a488e
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: PyQt4
Provides: python-imaging-qt = %{version}-%{release}
%description qt
PIL image wrapper for Qt.
%if %{with_python3}
%package -n %{name3}
@ -167,14 +177,23 @@ Requires: tkinter
%description -n %{name3}-tk
Tk interface for %{name3}.
%package -n %{name3}-qt
Summary: PIL image wrapper for Qt
Group: System Environment/Libraries
Obsoletes: %{name3} <= 2.0.0-5.git93a488e8
Requires: %{name3}%{?_isa} = %{version}-%{release}
Requires: python3-PyQt4
%description -n %{name3}-qt
PIL image wrapper for Qt.
%endif
%prep
%setup -q -n python-imaging-Pillow-%{shortcommit}
%patch0 -p1 -b .archs
%patch1 -p1 -b .quant
%patch2 -p1 -b .endian
%if %{with_python3}
# Create Python 3 source tree
@ -193,7 +212,7 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
popd
pushd docs
make html
PYTHONPATH=$PWD/.. make html
rm -f _build/html/.buildinfo
popd
@ -208,7 +227,7 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
pushd docs
make html
PYTHONPATH=$PWD/.. make html
rm -f _build/html/.buildinfo
popd
popd
@ -275,10 +294,12 @@ popd
%files
%doc README.rst docs/HISTORY.txt COPYING
%{python_sitearch}/*
# These are in subpackages
%exclude %{python_sitearch}/*sane*
%exclude %{python_sitearch}/_imagingtk*
%exclude %{python_sitearch}/PIL/ImageTk*
%exclude %{python_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python_sitearch}/PIL/ImageQt*
%files devel
%{py2_incdir}/Imaging/
@ -295,14 +316,19 @@ popd
%{python_sitearch}/PIL/ImageTk*
%{python_sitearch}/PIL/SpiderImagePlugin*
%files qt
%{python_sitearch}/PIL/ImageQt*
%if %{with_python3}
%files -n %{name3}
%doc README.rst docs/HISTORY.txt COPYING
%{python3_sitearch}/*
# These are in subpackages
%exclude %{python3_sitearch}/*sane*
%exclude %{python3_sitearch}/_imagingtk*
%exclude %{python3_sitearch}/PIL/ImageTk*
%exclude %{python3_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python3_sitearch}/PIL/ImageQt*
%files -n %{name3}-devel
%{py3_incdir}/Imaging/
@ -318,9 +344,20 @@ popd
%{python3_sitearch}/_imagingtk*
%{python3_sitearch}/PIL/ImageTk*
%{python3_sitearch}/PIL/SpiderImagePlugin*
%files -n %{name3}-qt
%{python3_sitearch}/PIL/ImageQt*
%endif
%changelog
* Fri Apr 19 2013 Sandro Mani <manisandro@gmail.com> - 2.0.0-6.gitd1c6db8
- Update to latest git
- python-pillow_quantization.patch now upstream
- python-pillow_endianness.patch now upstream
- Add subpackage for ImageQt module, with correct dependencies
- Add PyQt4 and numpy BR (for generating docs / running tests)
* Mon Apr 08 2013 Sandro Mani <manisandro@gmail.com> - 2.0.0-5.git93a488e
- Reenable tests on bigendian, add patches for #928927

View File

@ -1,58 +0,0 @@
diff --git a/Tests/test_image_array.py b/Tests/test_image_array.py
index c2e8590..351621d 100644
--- a/Tests/test_image_array.py
+++ b/Tests/test_image_array.py
@@ -10,8 +10,8 @@ def test(mode):
return ai["shape"], ai["typestr"], len(ai["data"])
# assert_equal(test("1"), ((100, 128), '|b1', 1600))
assert_equal(test("L"), ((100, 128), '|u1', 12800))
- assert_equal(test("I"), ((100, 128), '<i4', 51200)) # FIXME: wrong?
- assert_equal(test("F"), ((100, 128), '<f4', 51200)) # FIXME: wrong?
+ assert_equal(test("I"), ((100, 128), Image._ENDIAN + 'i4', 51200)) # FIXME: wrong?
+ assert_equal(test("F"), ((100, 128), Image._ENDIAN + 'f4', 51200)) # FIXME: wrong?
assert_equal(test("RGB"), ((100, 128, 3), '|u1', 38400))
assert_equal(test("RGBA"), ((100, 128, 4), '|u1', 51200))
assert_equal(test("RGBX"), ((100, 128, 4), '|u1', 51200))
diff --git a/Tests/test_lib_pack.py b/Tests/test_lib_pack.py
index 5bf622c..b3355b6 100644
--- a/Tests/test_lib_pack.py
+++ b/Tests/test_lib_pack.py
@@ -18,6 +18,8 @@ def pack(mode, rawmode):
else:
return [ord(c) for c in im.tobytes("raw", rawmode)]
+ order = 1 if Image._ENDIAN == '<' else -1
+
assert_equal(pack("1", "1"), [128])
assert_equal(pack("1", "1;I"), [0])
assert_equal(pack("1", "1;R"), [1])
@@ -25,9 +27,9 @@ def pack(mode, rawmode):
assert_equal(pack("L", "L"), [1])
- assert_equal(pack("I", "I"), [1, 0, 0, 0])
+ assert_equal(pack("I", "I"), [1, 0, 0, 0][::order])
- assert_equal(pack("F", "F"), [0, 0, 128, 63])
+ assert_equal(pack("F", "F"), [0, 0, 128, 63][::order])
assert_equal(pack("LA", "LA"), [1, 2])
diff --git a/Tests/test_mode_i16.py b/Tests/test_mode_i16.py
index 584bdd9..4c17985 100644
--- a/Tests/test_mode_i16.py
+++ b/Tests/test_mode_i16.py
@@ -84,10 +84,12 @@ def test_tobytes():
def tobytes(mode):
return Image.new(mode, (1, 1), 1).tobytes()
+ order = 1 if Image._ENDIAN == '<' else -1
+
assert_equal(tobytes("L"), b"\x01")
assert_equal(tobytes("I;16"), b"\x01\x00")
assert_equal(tobytes("I;16B"), b"\x00\x01")
- assert_equal(tobytes("I"), b"\x01\x00\x00\x00")
+ assert_equal(tobytes("I"), b"\x01\x00\x00\x00"[::order])
def test_convert():

File diff suppressed because it is too large Load Diff

View File

@ -1 +1 @@
6a7489a6346643525d5d9697e14cde15 python-imaging-Pillow-2.0.0-58-g93a488e.tar.gz
b27869e2e0a446fb283d6203e111ed4e python-imaging-Pillow-2.0.0-105-gd1c6db8.tar.gz