2013-11-07 17:32:23 +01:00
#
# spec file for package python-Pillow
#
2016-02-01 12:46:53 +01:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
2013-11-07 17:32:23 +01:00
#
# 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
2016-03-01 14:05:57 +01:00
Version : 3.1.1
2013-11-07 17:32:23 +01:00
Release : 0
Summary : Python Imaging Library (Fork)
2013-11-14 14:21:19 +01:00
License : HPND
2013-11-07 17:32:23 +01:00
Group : Development/Languages/Python
Url : http://python-imaging.github.io/
2014-11-18 15:18:33 +01:00
Source : https://pypi.python.org/packages/source/P/Pillow/Pillow-%{version} .tar.gz
2016-10-04 12:59:41 +02:00
# PATCH-FIX-UPSTREAM python-Pillow-tests-update-epsilon-for-freetype27.patch gh#python-pillow/Pillow#2116 badshah400@gmail.com -- Fix buildfailures against freetype 2.7 by increasing the epsilon
Patch0 : python-Pillow-tests-update-epsilon-for-freetype27.patch
2013-11-07 17:32:23 +01:00
BuildRequires : python-devel
BuildRequires : python-setuptools
BuildRequires : python-tk
BuildRequires : tix
BuildRequires : tk-devel
BuildRequires : unzip
%if 0%{?suse_version} > 1210
BuildRequires : libjpeg8-devel
2014-02-14 09:12:00 +01:00
BuildRequires : liblcms2-devel
2013-11-18 10:41:29 +01:00
BuildRequires : libwebp-devel
2014-11-18 15:18:33 +01:00
%else
2015-07-27 16:26:41 +02:00
%if 0%{?rhel} > 6
BuildRequires : lcms2-devel
BuildRequires : libjpeg-turbo-devel
BuildRequires : libwebp-devel
%else
2014-11-18 15:18:33 +01:00
BuildRequires : python-unittest2
2014-05-27 14:54:18 +02:00
%endif
2015-07-27 16:26:41 +02:00
%endif
2014-05-27 14:54:18 +02:00
%if 0%{?suse_version} > 1315
Accepting request 233204 from home:frispete:python
New attempt to submit this, now providing python-imaging
@Sascha: sure, it might been wrong to provide python-imaging in the
first place, but python-Pillow without it doesn't make muchg sense,
or do you really want to adjust all dependant packages? Here, that
where scribus and python-repostlab, which both seem to work fine
with Pillow, apart from the imaging dependency.
BTW: this is the way, Redhat handles this issue, too.
Incorporated the new release, and added openjpeg2 dependency.
- New upstream release 2.4.0. For details see
https://pypi.python.org/pypi/Pillow/2.4.0
- New dependency: openjpeg2 for JPEG 2000 support
- provide python-imaging in order to act as a drop in replacement
for it.
- symlink alternatives files, as requested from Coolo, in order to
get rid of suse version conditional
OBS-URL: https://build.opensuse.org/request/show/233204
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=13
2014-05-19 13:49:09 +02:00
BuildRequires : openjpeg2-devel
2013-11-07 17:32:23 +01:00
%endif
2013-11-18 10:41:29 +01:00
BuildRequires : freetype2-devel
BuildRequires : libtiff-devel
2014-08-12 15:50:47 +02:00
BuildRequires : python-nose
2013-11-18 10:41:29 +01:00
BuildRequires : zlib-devel
Requires(post) : update-alternatives
Requires(postun) : update-alternatives
2013-11-07 17:32:23 +01:00
BuildRoot : %{_tmppath} /%{name} -%{version} -build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c " f r o m d i s t u t i l s . s y s c o n f i g i m p o r t g e t _ p y t h o n _ l i b ; p r i n t g e t _ p y t h o n _ l i b ( 1 ) " )}
%endif
# Pillow is a friendly PIL fork which we package as 'imaging', the latter isn't obsolete though:
2014-08-19 10:12:37 +02:00
Conflicts : python-imaging < %{version}
2013-11-12 11:18:32 +01:00
# 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
Accepting request 233204 from home:frispete:python
New attempt to submit this, now providing python-imaging
@Sascha: sure, it might been wrong to provide python-imaging in the
first place, but python-Pillow without it doesn't make muchg sense,
or do you really want to adjust all dependant packages? Here, that
where scribus and python-repostlab, which both seem to work fine
with Pillow, apart from the imaging dependency.
BTW: this is the way, Redhat handles this issue, too.
Incorporated the new release, and added openjpeg2 dependency.
- New upstream release 2.4.0. For details see
https://pypi.python.org/pypi/Pillow/2.4.0
- New dependency: openjpeg2 for JPEG 2000 support
- provide python-imaging in order to act as a drop in replacement
for it.
- symlink alternatives files, as requested from Coolo, in order to
get rid of suse version conditional
OBS-URL: https://build.opensuse.org/request/show/233204
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=13
2014-05-19 13:49:09 +02:00
# ALSO NOTE (frispete): without providing python-imaging, all packages requiring it will break
2014-08-19 10:12:37 +02:00
Provides : python-imaging = %{version}
Accepting request 233204 from home:frispete:python
New attempt to submit this, now providing python-imaging
@Sascha: sure, it might been wrong to provide python-imaging in the
first place, but python-Pillow without it doesn't make muchg sense,
or do you really want to adjust all dependant packages? Here, that
where scribus and python-repostlab, which both seem to work fine
with Pillow, apart from the imaging dependency.
BTW: this is the way, Redhat handles this issue, too.
Incorporated the new release, and added openjpeg2 dependency.
- New upstream release 2.4.0. For details see
https://pypi.python.org/pypi/Pillow/2.4.0
- New dependency: openjpeg2 for JPEG 2000 support
- provide python-imaging in order to act as a drop in replacement
for it.
- symlink alternatives files, as requested from Coolo, in order to
get rid of suse version conditional
OBS-URL: https://build.opensuse.org/request/show/233204
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=13
2014-05-19 13:49:09 +02:00
2013-11-12 11:18:32 +01:00
Obsoletes : python-imaging-sane
Accepting request 233204 from home:frispete:python
New attempt to submit this, now providing python-imaging
@Sascha: sure, it might been wrong to provide python-imaging in the
first place, but python-Pillow without it doesn't make muchg sense,
or do you really want to adjust all dependant packages? Here, that
where scribus and python-repostlab, which both seem to work fine
with Pillow, apart from the imaging dependency.
BTW: this is the way, Redhat handles this issue, too.
Incorporated the new release, and added openjpeg2 dependency.
- New upstream release 2.4.0. For details see
https://pypi.python.org/pypi/Pillow/2.4.0
- New dependency: openjpeg2 for JPEG 2000 support
- provide python-imaging in order to act as a drop in replacement
for it.
- symlink alternatives files, as requested from Coolo, in order to
get rid of suse version conditional
OBS-URL: https://build.opensuse.org/request/show/233204
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=13
2014-05-19 13:49:09 +02:00
Provides : python-imaging-sane
2013-11-07 17:32:23 +01:00
%description
Pillow is the " f r i e n d l y " 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}
2014-05-28 10:43:10 +02:00
# 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
2013-11-07 17:32:23 +01:00
%description tk
Pillow is the " f r i e n d l y " 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}
2016-10-04 12:59:41 +02:00
%patch0 -p1
2013-11-07 17:32:23 +01:00
%build
2015-10-06 11:20:34 +02:00
# no need to build it here, as setup.py install will build it again, anyway
2013-11-07 17:32:23 +01:00
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
Accepting request 233204 from home:frispete:python
New attempt to submit this, now providing python-imaging
@Sascha: sure, it might been wrong to provide python-imaging in the
first place, but python-Pillow without it doesn't make muchg sense,
or do you really want to adjust all dependant packages? Here, that
where scribus and python-repostlab, which both seem to work fine
with Pillow, apart from the imaging dependency.
BTW: this is the way, Redhat handles this issue, too.
Incorporated the new release, and added openjpeg2 dependency.
- New upstream release 2.4.0. For details see
https://pypi.python.org/pypi/Pillow/2.4.0
- New dependency: openjpeg2 for JPEG 2000 support
- provide python-imaging in order to act as a drop in replacement
for it.
- symlink alternatives files, as requested from Coolo, in order to
get rid of suse version conditional
OBS-URL: https://build.opensuse.org/request/show/233204
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=13
2014-05-19 13:49:09 +02:00
mkdir -p %{buildroot} %{_sysconfdir} /alternatives
2015-10-06 11:20:34 +02:00
for p in pilconvert pildriver pilfile pilfont pilprint createfontdatachunk enhancer explode gifmaker painter player thresholder viewer; do
2013-11-18 10:41:29 +01:00
mv %{buildroot} %{_bindir} /$p.py %{buildroot} %{_bindir} /$p-%{py_ver}
2015-10-06 11:20:34 +02:00
ln -s -f %{_sysconfdir} /alternatives/$p %{buildroot} %{_bindir} /$p
touch %{buildroot} %{_sysconfdir} /alternatives/$p
2013-11-18 10:41:29 +01:00
done
2014-08-02 13:00:59 +02:00
# add missing path
echo " P I L " > %{buildroot} %{python_sitearch} /PIL.pth
2013-11-07 17:32:23 +01:00
%check
2016-05-23 12:02:04 +02:00
%ifarch ppc ppc64 s390 s390x
2016-03-02 21:10:45 +01:00
PYTHONPATH=%{buildroot} /%{python_sitearch} python selftest.py --installed || \
echo " W A R N I N G i g n o r e f a i l u r e h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / i s s u e s / 1 2 0 4 "
PYTHONPATH=%{buildroot} /%{python_sitearch} python test-installed.py || \
echo " W A R N I N G i g n o r e f a i l u r e h t t p s : / / g i t h u b . c o m / p y t h o n - p i l l o w / P i l l o w / i s s u e s / 1 2 0 4 "
%else
2014-08-12 15:50:47 +02:00
PYTHONPATH=%{buildroot} /%{python_sitearch} python selftest.py --installed
PYTHONPATH=%{buildroot} /%{python_sitearch} python test-installed.py
2016-03-02 21:10:45 +01:00
%endif
2013-11-07 17:32:23 +01:00
2013-11-18 10:41:29 +01:00
%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} \
2015-10-06 11:20:34 +02:00
--slave %{_bindir} /pilprint pilprint %{_bindir} /pilprint-%{py_ver} \
2015-11-17 11:22:51 +01:00
--slave %{_bindir} /createfontdatachunk createfontdatachunk %{_bindir} /createfontdatachunk-%{py_ver} \
--slave %{_bindir} /enhancer enhancer %{_bindir} /enhancer-%{py_ver} \
--slave %{_bindir} /explode explode %{_bindir} /explode-%{py_ver} \
--slave %{_bindir} /gifmaker gifmaker %{_bindir} /gifmaker-%{py_ver} \
--slave %{_bindir} /painter painter %{_bindir} /painter-%{py_ver} \
--slave %{_bindir} /player player %{_bindir} /player-%{py_ver} \
--slave %{_bindir} /thresholder thresholder %{_bindir} /thresholder-%{py_ver} \
--slave %{_bindir} /viewer viewer %{_bindir} /viewer-%{py_ver}
2013-11-18 10:41:29 +01:00
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove pilconvert %{_bindir} /pilconvert-%{py_ver}
fi
2013-11-07 17:32:23 +01:00
%files
%defattr (-,root,root,-)
2016-03-13 21:33:01 +01:00
%doc CHANGES.rst README.rst LICENSE
2015-10-06 11:20:34 +02:00
%{_bindir} /pilconvert
%{_bindir} /pildriver
%{_bindir} /pilfile
%{_bindir} /pilfont
%{_bindir} /pilprint
%{_bindir} /createfontdatachunk
%{_bindir} /enhancer
%{_bindir} /explode
%{_bindir} /gifmaker
%{_bindir} /painter
%{_bindir} /player
%{_bindir} /thresholder
%{_bindir} /viewer
2013-11-18 10:41:29 +01:00
%{_bindir} /pilconvert-%{py_ver}
%{_bindir} /pildriver-%{py_ver}
%{_bindir} /pilfile-%{py_ver}
%{_bindir} /pilfont-%{py_ver}
%{_bindir} /pilprint-%{py_ver}
2015-10-06 11:20:34 +02:00
%{_bindir} /createfontdatachunk-%{py_ver}
%{_bindir} /enhancer-%{py_ver}
%{_bindir} /explode-%{py_ver}
%{_bindir} /gifmaker-%{py_ver}
%{_bindir} /painter-%{py_ver}
%{_bindir} /player-%{py_ver}
%{_bindir} /thresholder-%{py_ver}
%{_bindir} /viewer-%{py_ver}
2013-11-07 17:32:23 +01:00
%{python_sitearch} /PIL
2014-08-02 13:00:59 +02:00
%{python_sitearch} /PIL.pth
2013-11-07 17:32:23 +01:00
%{python_sitearch} /Pillow-%{version} -py%{py_ver} .egg-info
%exclude %{python_sitearch} /PIL/ImageTk*
%exclude %{python_sitearch} /PIL/_imagingtk*
2013-11-18 10:41:29 +01:00
%ghost %{_sysconfdir} /alternatives/pilconvert
%ghost %{_sysconfdir} /alternatives/pildriver
%ghost %{_sysconfdir} /alternatives/pilfile
%ghost %{_sysconfdir} /alternatives/pilfont
%ghost %{_sysconfdir} /alternatives/pilprint
2015-10-06 11:20:34 +02:00
%ghost %{_sysconfdir} /alternatives/createfontdatachunk
%ghost %{_sysconfdir} /alternatives/enhancer
%ghost %{_sysconfdir} /alternatives/explode
%ghost %{_sysconfdir} /alternatives/gifmaker
%ghost %{_sysconfdir} /alternatives/painter
%ghost %{_sysconfdir} /alternatives/player
%ghost %{_sysconfdir} /alternatives/thresholder
%ghost %{_sysconfdir} /alternatives/viewer
2013-11-07 17:32:23 +01:00
%files tk
%defattr (-,root,root,-)
%{python_sitearch} /PIL/ImageTk*
%{python_sitearch} /PIL/_imagingtk*
%changelog