%define pyver %(python -V 2>&1 | cut -f2 -d" " | cut -f1,2 -d".") %define name python-imaging %define version 1.1.6 %define release %mkrel 4 Summary: Python's own image processing library Name: %{name} Version: %{version} Release: %{release} License: MIT style Group: Development/Python URL: http://www.pythonware.com/products/pil/ Source0: http://www.pythonware.com/downloads/Imaging-%{version}.tar.bz2 Source1: pil-handbook.pdf.bz2 Source2: linux-python-paint-icon.gif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot Requires: python >= 1.5, libjpeg >= 6b, zlib >= 1.1.2, libpng >= 1.0.1, tkinter BuildRequires: python-devel >= 1.5, jpeg-devel >= 6b, png-devel >= 1.0.1 BuildRequires: X11-devel freetype2-devel tkinter tcl tcl-devel tk tk-devel >= 8.5 BuildRequires: libsane-devel %description Python Imaging Library version %{version} 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. %package devel Summary: Header files for python-imaging Group: Development/C Requires: python-imaging = %{version} %description devel Header files for the Python Imaging Library version %{version}. %prep %setup -q -n Imaging-%{version} bzcat %SOURCE1 > pil-handbook.pdf # fix tk version # perl -p -i -e 's/8.3/8.4/g' Setup.in # fix distutils problem # %patch # Make sure to get the right python library # perl -pi -e "s,(\\\$\((exec_prefix|prefix|exec_installdir)\)|/usr/X11R6)/lib\b,\1/%{_lib},g" Makefile.pre.in Setup.in # Nuke references to /usr/local perl -pi -e "s,(-[IL]/usr/local/(include|lib)),,g" setup.py %build python setup.py build_ext -i cd Sane python setup.py build_ext -i %install rm -fr %{buildroot} find . -type f | xargs perl -pi -e 's@/usr/local/bin/python@/usr/bin/python@' python setup.py install --root=%{buildroot} cd libImaging mkdir -p %{buildroot}%{_includedir}/python%{pyver}/ install -m 644 ImPlatform.h Imaging.h %{buildroot}%{_includedir}/python%{pyver}/ cd .. cd Sane python setup.py install --root=%{buildroot} cd .. %clean rm -rf %{buildroot} %files %defattr (-,root,root) %doc pil-handbook.pdf Scripts Images CHANGES* README %{_bindir}/pil*.py %py_platsitedir/PIL.pth %dir %py_platsitedir/PIL %py_platsitedir/PIL/*.egg-info %py_platsitedir/PIL/*.py* %py_platsitedir/PIL/_imaging.so %py_platsitedir/PIL/_imagingft.so %py_platsitedir/PIL/_imagingmath.so %py_platsitedir/PIL/_imagingtk.so %py_platsitedir/_sane.so %py_platsitedir/pysane-2.0-py2.5.egg-info %py_platsitedir/sane.py %py_platsitedir/sane.pyc %files devel %defattr (-,root,root) %{_includedir}/python%{pyver}/Imaging.h %{_includedir}/python%{pyver}/ImPlatform.h %changelog * Wed Jun 18 2008 Thierry Vignaud <tvignaud@mandriva.com> 1.1.6-4mdv2009.0 + Revision: 225132 - rebuild * Mon Jan 28 2008 Marcelo Ricardo Leitner <mrl@mandriva.com> 1.1.6-3mdv2008.1 + Revision: 159347 - Enabled support for Sane. Closes: #10890 + Olivier Blin <oblin@mandriva.com> - restore BuildRoot + Thierry Vignaud <tvignaud@mandriva.com> - kill re-definition of %%buildroot on Pixel's request - buildrequires X11-devel instead of XFree86-devel * Fri Oct 26 2007 Götz Waschk <waschk@mandriva.org> 1.1.6-2mdv2008.1 + Revision: 102332 - fix build of imagingtk extension (bug #34985) * Wed May 02 2007 Adam Williamson <awilliamson@mandriva.com> 1.1.6-1mdv2008.0 + Revision: 20635 - replace Icon: with Source: (thanks andreas) - 1.1.6, drop some workarounds that are no longer needed * Tue Nov 28 2006 Götz Waschk <waschk@mandriva.org> 1.1.4-11mdv2007.0 + Revision: 88169 - Import python-imaging * Tue Nov 28 2006 Götz Waschk <waschk@mandriva.org> 1.1.4-11mdv2007.1 - update file list * Sun Jan 01 2006 Oden Eriksson <oeriksson@mandriva.com> 1.1.4-10mdk - rebuilt against soname aware deps (tcl/tk) - fix deps * Wed Mar 09 2005 Frederic Lepied <flepied@mandrakesoft.com> 1.1.4-9mdk - install include files in a devel sub package * Fri Dec 10 2004 Götz Waschk <waschk@linux-mandrake.com> 1.1.4-8mdk - drop pilray support, this fixes bug 12347 * Sat Dec 04 2004 Michael Scherer <misc@mandrake.org> 1.1.4-7mdk - Rebuild for new python * Sat Sep 18 2004 Frederic Lepied <flepied@mandrakesoft.com> 1.1.4-6mdk - add support for radiance pic format (bug #) * Mon May 24 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.1.4-5mdk - grf, fix buildrequires for real * Sat May 22 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.1.4-4mdk - fix buildrequires * Tue Mar 02 2004 Götz Waschk <waschk@linux-mandrake.com> 1.1.4-3mdk - fix build with new freetype2