]> TLD Linux GIT Repositories - packages/python-PIL.git/commitdiff
- from PLD
authorMarcin Krol <hawk@tld-linux.org>
Wed, 22 Jul 2015 17:38:47 +0000 (17:38 +0000)
committerMarcin Krol <hawk@tld-linux.org>
Wed, 22 Jul 2015 17:38:47 +0000 (17:38 +0000)
python-PIL-lib64.patch [new file with mode: 0644]
python-PIL-viewer.patch [new file with mode: 0644]
python-PIL.spec [new file with mode: 0644]
python-imaging-1.1.6-sane-types.patch [new file with mode: 0644]
python-imaging-giftrans.patch [new file with mode: 0644]

diff --git a/python-PIL-lib64.patch b/python-PIL-lib64.patch
new file mode 100644 (file)
index 0000000..10f773c
--- /dev/null
@@ -0,0 +1,11 @@
+--- Imaging-1.1.5/setup.py~    2005-03-23 19:16:40.000000000 +0100
++++ Imaging-1.1.5/setup.py     2006-04-09 20:57:44.175730750 +0200
+@@ -180,7 +180,7 @@
+         add_directory(library_dirs, "/usr/local/lib")
+         add_directory(include_dirs, "/usr/local/include")
+-        add_directory(library_dirs, "/usr/lib")
++        add_directory(library_dirs, "/usr/lib64")
+         add_directory(include_dirs, "/usr/include")
+         #
diff --git a/python-PIL-viewer.patch b/python-PIL-viewer.patch
new file mode 100644 (file)
index 0000000..6d432c5
--- /dev/null
@@ -0,0 +1,29 @@
+--- Imaging-1.1.7/PIL/ImageShow.py~    2009-11-01 01:44:12.000000000 +0100
++++ Imaging-1.1.7/PIL/ImageShow.py     2010-02-16 00:00:20.623473929 +0100
+@@ -145,6 +145,15 @@
+     if which("display"):
+         register(DisplayViewer)
++    class KFMClientViewer(UnixViewer):
++        def get_command_ex(self, file, **options):
++            executable = "kfmclient"
++            command = executable + " exec"
++            return command, executable
++
++    if which("kfmclient"):
++        register(KFMClientViewer)
++
+     class XVViewer(UnixViewer):
+         def get_command_ex(self, file, title=None, **options):
+             # note: xv is pretty outdated.  most modern systems have
+--- Imaging-1.1.7/PIL/ImageShow.py~    2010-02-16 00:01:02.588251213 +0100
++++ Imaging-1.1.7/PIL/ImageShow.py     2010-02-16 00:09:28.693824791 +0100
+@@ -63,7 +63,7 @@
+         if base != image.mode and image.mode != "1":
+             image = image.convert(base)
+-        self.show_image(image, **options)
++        return self.show_image(image, **options)
+     # hook methods
diff --git a/python-PIL.spec b/python-PIL.spec
new file mode 100644 (file)
index 0000000..eec4813
--- /dev/null
@@ -0,0 +1,180 @@
+#
+# Conditional build:
+%bcond_without tk      # build without tkinter support
+
+%define                module  PIL
+Summary:       Python's own image processing library
+Summary(pl.UTF-8):     Biblioteka do przetwarzania obrazu w Pythonie
+Name:          python-%{module}
+Version:       1.1.7
+Release:       7
+Epoch:         1
+License:       BSD-like
+Group:         Libraries/Python
+Source0:       http://effbot.org/downloads/Imaging-%{version}.tar.gz
+# Source0-md5: fc14a54e1ce02a0225be8854bfba478e
+Patch0:                %{name}-lib64.patch
+Patch1:                %{name}-viewer.patch
+Patch2:                python-imaging-1.1.6-sane-types.patch
+Patch3:                python-imaging-giftrans.patch
+URL:           http://www.pythonware.com/products/pil/
+BuildRequires: freetype-devel >= 1:2.3.9
+BuildRequires: lcms-devel >= 1.1.5
+BuildRequires: libjpeg-devel >= 6a
+BuildRequires: python >= 1:2.5
+BuildRequires: python-devel >= 1:2.5
+%{?with_tk:BuildRequires:      python-tkinter}
+BuildRequires: rpm-pythonprov
+BuildRequires: rpmbuild(macros) >= 1.219
+BuildRequires: sane-backends-devel
+%{?with_tk:BuildRequires:      tk-devel}
+BuildRequires: zlib-devel >= 1.2.3
+%pyrequires_eq python-libs
+Requires:      freetype >= 1:2.3.9
+Requires:      lcms >= 1.1.5
+Requires:      zlib >= 1.2.3
+Obsoletes:     python-Imaging
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+The Python Imaging Library (PIL) adds image processing capabilities to
+your Python interpreter. This library provides extensive file format
+support, an efficient internal representation, and powerful image
+processing capabilities.
+
+%description -l pl.UTF-8
+Python Imaging Library (PIL) dodaje możliwość przetwarzania obrazu do
+interpretera Pythona. Biblioteka ma obsługę wielu formatów plików,
+wydajną reprezentację wewnętrzną i duże możliwości obróbki.
+
+%package sane
+Summary:       Python Module for using scanners
+Summary(pl.UTF-8):     Moduły Pythona do używania skanerów
+Group:         Libraries
+Requires:      %{name} = %{epoch}:%{version}-%{release}
+
+%description sane
+This package contains the sane module for Python which provides access
+to various raster scanning devices such as flatbed scanners and
+digital cameras.
+
+%description sane -l pl.UTF-8
+Ten pakiet zawiera moduł sane dla Pythona, dający dostęp do wielu
+rastrowych urządzeń skanujących, takich jak skanery płaskie i aparaty
+cyfrowe.
+
+%package tk
+Summary:       Tk interface for python-imaging
+Summary(pl.UTF-8):     Interfejs Tk do modułów python-imaging
+Group:         Libraries
+Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires:      python-tkinter
+Conflicts:     %{name} < 1:1.1.6-6
+
+%description tk
+This package contains a Tk interface for python-imaging.
+
+%description tk -l pl.UTF-8
+Ten pakiet zawiera interfejs Tk do modułów python-imaging.
+
+%package devel
+Summary:       Python's own image processing library header files
+Summary(pl.UTF-8):     Pliki nagłówkowe do biblioteki obróbki obrazu w Pythonie
+Group:         Development/Languages/Python
+Requires:      %{name} = %{epoch}:%{version}-%{release}
+Requires:      libjpeg-devel
+Requires:      python-devel
+Requires:      zlib-devel
+Obsoletes:     python-Imaging-devel
+
+%description devel
+Python's own image processing library header files.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe do biblioteki obróbki obrazu w Pythonie.
+
+%prep
+%setup -q -n Imaging-%{version}
+%if %{_lib} == "lib64"
+%patch0 -p1
+%endif
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+
+# fix the interpreter path for Scripts/*.py
+sed -i -e "s|/usr/local/bin/python|%{_bindir}/python|" Scripts/*.py
+
+%build
+export CFLAGS="%{rpmcflags}"
+%{__python} setup.py build_ext -i
+%{__python} selftest.py
+
+cd Sane
+%{__python} setup.py build
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%{__python} setup.py install \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+
+cd Sane
+%{__python} setup.py install \
+       --optimize=2 \
+       --root=$RPM_BUILD_ROOT
+cd ..
+
+install -d $RPM_BUILD_ROOT%{py_incdir}
+cp -a libImaging/Im{Platform,aging}.h $RPM_BUILD_ROOT%{py_incdir}
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+mv $RPM_BUILD_ROOT{%{_bindir}/pil*.py,%{_examplesdir}/%{name}-%{version}}
+
+%py_ocomp $RPM_BUILD_ROOT%{py_sitedir}/%{module}
+
+%py_postclean
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc CHANGES README
+%{py_sitedir}/%{module}.pth
+%dir %{py_sitedir}/%{module}
+%{py_sitedir}/%{module}/*.py[co]
+%attr(755,root,root) %{py_sitedir}/%{module}/_imaging*.so
+%if "%{py_ver}" > "2.4"
+%{py_sitedir}/%{module}/%{module}-*.egg-info
+%endif
+
+%{_examplesdir}/%{name}-%{version}
+
+%if %{with tk}
+%exclude %{py_sitedir}/%{module}/ImageTk.py[co]
+%exclude %{py_sitedir}/%{module}/SpiderImagePlugin.py[co]
+%exclude %{py_sitedir}/%{module}/_imagingtk.so
+%endif
+
+%files sane
+%defattr(644,root,root,755)
+%doc Sane/CHANGES Sane/demo*.py Sane/sanedoc.txt
+%{py_sitedir}/sane.py[co]
+%attr(755,root,root) %{py_sitedir}/_sane.so
+%if "%{py_ver}" > "2.4"
+%{py_sitedir}/pysane-*.egg-info
+%endif
+
+%if %{with tk}
+%files tk
+%defattr(644,root,root,755)
+%{py_sitedir}/%{module}/ImageTk.py[co]
+%{py_sitedir}/%{module}/SpiderImagePlugin.py[co]
+%attr(755,root,root) %{py_sitedir}/%{module}/_imagingtk.so
+%endif
+
+%files devel
+%defattr(644,root,root,755)
+%{py_incdir}/ImPlatform.h
+%{py_incdir}/Imaging.h
diff --git a/python-imaging-1.1.6-sane-types.patch b/python-imaging-1.1.6-sane-types.patch
new file mode 100644 (file)
index 0000000..8263f7c
--- /dev/null
@@ -0,0 +1,13 @@
+--- Imaging-1.1.6/Sane/_sane.c.types   2006-12-03 13:12:22.000000000 +0100
++++ Imaging-1.1.6/Sane/_sane.c 2007-04-28 11:41:19.000000000 +0200
+@@ -1152,8 +1152,8 @@
+ static PyObject *
+ PySane_get_devices(PyObject *self, PyObject *args)
+ {
+-  SANE_Device **devlist;
+-  SANE_Device *dev;
++  const SANE_Device **devlist;
++  const SANE_Device *dev;
+   SANE_Status st;
+   PyObject *list;
+   int local_only, i;
diff --git a/python-imaging-giftrans.patch b/python-imaging-giftrans.patch
new file mode 100644 (file)
index 0000000..1a109d2
--- /dev/null
@@ -0,0 +1,14 @@
+--- Imaging-1.1.6.orig/PIL/GifImagePlugin.py    2006-12-03 11:37:15.000000000 +0000
++++ Imaging-1.1.6/PIL/GifImagePlugin.py 2008-10-02 14:51:43.000000000 +0100
+@@ -352,6 +352,11 @@
+         for i in range(maxcolor):
+             s.append(chr(i) * 3)
++    if im.info.has_key('transparency'):
++        transparentIndex = im.info['transparency']
++        s.append('!' + chr(0xf9) + chr(4) + chr(1) + chr(0) + chr(0) +
++                 chr(transparentIndex) + chr(0))
++
+     return s
+ def getdata(im, offset = (0, 0), **params):