1
0
forked from pool/python-Pillow
python-Pillow/python-Pillow.spec
Michal Čihař b4496d5889 Accepting request 244315 from home:Nijel:branches:devel:languages:python
- enable build time testing, but not for i586 as it's broken there due to some
  rounding error (see https://github.com/python-pillow/Pillow/issues/819)

- Update to 2.5.1:
 * 2.5.1 (2014-07-10)
    Fixed install issue if Multiprocessing.Pool is not available [wiredfool]
    32bit mult overflow fix #782 [wiredfool]
 * 2.5.0 (2014-07-01)
    Imagedraw rewrite [terseus, wiredfool]
    Add support for multithreaded test execution [wiredfool]
    Prevent shell injection #748 [mbrown1413, wiredfool]
    Support for Resolution in BMP files #734 [gcq]
    Fix error in setup.py for Python 3 [matthew-brett]
    Pyroma fix and add Python 3.4 to setup metadata #742 [wirefool]
    Top level flake8 fixes #741 [aclark]
    Remove obsolete Animated Raster Graphics (ARG) support [hugovk]
    Fix test_imagedraw failures #727 [cgohlke]
    Fix AttributeError: class Image has no attribute 'DEBUG' #726 [cgohlke]
    Fix msvc warning: 'inline' : macro redefinition #725 [cgohlke]
    Cleanup #654 [dvska, hugovk, wiredfool]
    16-bit monochrome support for JPEG2000 [videan42]
    Fixed ImagePalette.save [brightpisces]
    Support JPEG qtables [csinchok]
    Add binary morphology addon [dov, wiredfool]
    Decompression bomb protection [hugovk]
    Put images in a single directory [hugovk]
    Support OpenJpeg 2.1 [al45tair]
    Remove unistd.h #include for all platforms [wiredfool]
    Use unittest for tests [hugovk]
    ImageCms fixes [hugovk]

OBS-URL: https://build.opensuse.org/request/show/244315
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=19
2014-08-12 13:50:47 +00:00

154 lines
5.5 KiB
RPMSpec

#
# spec file for package python-Pillow
#
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-Pillow
Version: 2.5.1
Release: 0
Summary: Python Imaging Library (Fork)
License: HPND
Group: Development/Languages/Python
Url: http://python-imaging.github.io/
Source: https://pypi.python.org/packages/source/P/Pillow/Pillow-%{version}.zip
BuildRequires: python-devel
BuildRequires: python-setuptools
BuildRequires: python-tk
BuildRequires: tix
BuildRequires: tk-devel
BuildRequires: unzip
%if 0%{?suse_version} > 1210
BuildRequires: libjpeg8-devel
BuildRequires: liblcms2-devel
BuildRequires: libwebp-devel
%endif
%if 0%{?suse_version} > 1315
BuildRequires: openjpeg2-devel
%endif
BuildRequires: freetype2-devel
BuildRequires: libtiff-devel
BuildRequires: python-nose
BuildRequires: zlib-devel
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%endif
# Pillow is a friendly PIL fork which we package as 'imaging', the latter isn't obsolete though:
Conflicts: python-imaging
# NOTE(saschpe): python-imaging should have never provided this and I'm a bit relucatant do it either.
# http://en.opensuse.org/openSUSE:Upgrade_dependencies_explanation#Replace_a_package_by_another_with_the_same_functionality
# ALSO NOTE (frispete): without providing python-imaging, all packages requiring it will break
Provides: python-imaging
Obsoletes: python-imaging-sane
Provides: python-imaging-sane
%description
Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the
Python Imaging Library by Fredrik Lundh and Contributors.
%package tk
Summary: Python Imaging Library (Fork) - Tcl/Tk Module
Group: Development/Languages/Python
Requires: %{name} = %{version}
# NOTE: We don't need to conflict with python-imaging here,
# because this package depends on python-Pillow, which already conflicts with python-imaging,
# so this cannot be installed alongside python-imaging
# And we cannot conflict with python-imaging directly, since python-Pillow provides python-imaging
# Just in case, conflict with python-imaging-tk in case it is ever implemented.
Obsoletes: python-imaging-tk
Provides: python-imaging-tk
%description tk
Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is the
Python Imaging Library by Fredrik Lundh and Contributors.
#NOTE(saschpe): No 'sane' subpackage like "python-imaging", that stuff
# would belong into python-pysane, if anybody would care :-)
%prep
%setup -q -n Pillow-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for p in pilconvert pildriver pilfile pilfont pilprint ; do
mv %{buildroot}%{_bindir}/$p.py %{buildroot}%{_bindir}/$p-%{py_ver}
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_bindir}/$p
ln -s %{_bindir}/$p-%{py_ver} %{buildroot}%{_sysconfdir}/alternatives/$p
done
# add missing path
echo "PIL" > %{buildroot}%{python_sitearch}/PIL.pth
%check
PYTHONPATH=%{buildroot}/%{python_sitearch} python selftest.py --installed
%ifnarch i586
# Disabled as it fails on i586:
# https://github.com/python-pillow/Pillow/issues/819
%if 0%{?suse_version} > 1230
PYTHONPATH=%{buildroot}/%{python_sitearch} python test-installed.py
%endif
%endif
%post
update-alternatives \
--install %{_bindir}/pilconvert pilconvert %{_bindir}/pilconvert-%{py_ver} 20 \
--slave %{_bindir}/pildriver pildriver %{_bindir}/pildriver-%{py_ver} \
--slave %{_bindir}/pilfile pilfile %{_bindir}/pilfile-%{py_ver} \
--slave %{_bindir}/pilfont pilfont %{_bindir}/pilfont-%{py_ver} \
--slave %{_bindir}/pilprint pilprint %{_bindir}/pilprint-%{py_ver}
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove pilconvert %{_bindir}/pilconvert-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%doc CHANGES.rst README.rst
%ghost %{_bindir}/pilconvert
%{_bindir}/pilconvert-%{py_ver}
%ghost %{_bindir}/pildriver
%{_bindir}/pildriver-%{py_ver}
%ghost %{_bindir}/pilfile
%{_bindir}/pilfile-%{py_ver}
%ghost %{_bindir}/pilfont
%{_bindir}/pilfont-%{py_ver}
%ghost %{_bindir}/pilprint
%{_bindir}/pilprint-%{py_ver}
%{python_sitearch}/PIL
%{python_sitearch}/PIL.pth
%{python_sitearch}/Pillow-%{version}-py%{py_ver}.egg-info
%exclude %{python_sitearch}/PIL/ImageTk*
%exclude %{python_sitearch}/PIL/_imagingtk*
%ghost %{_sysconfdir}/alternatives/pilconvert
%ghost %{_sysconfdir}/alternatives/pildriver
%ghost %{_sysconfdir}/alternatives/pilfile
%ghost %{_sysconfdir}/alternatives/pilfont
%ghost %{_sysconfdir}/alternatives/pilprint
%files tk
%defattr(-,root,root,-)
%{python_sitearch}/PIL/ImageTk*
%{python_sitearch}/PIL/_imagingtk*
%changelog