Update to 3.3.0

This commit is contained in:
Sandro Mani 2016-07-02 13:20:05 +02:00
parent afd5c9c5b4
commit 3c2415a22c
3 changed files with 164 additions and 165 deletions

1
.gitignore vendored
View File

@ -24,3 +24,4 @@
/python-pillow-Pillow-3.1.0-0-gfff5536.tar.gz /python-pillow-Pillow-3.1.0-0-gfff5536.tar.gz
/python-pillow-Pillow-3.1.1-0-geb72bf8.tar.gz /python-pillow-Pillow-3.1.1-0-geb72bf8.tar.gz
/python-pillow-Pillow-3.2.0-0-g344cb70.tar.gz /python-pillow-Pillow-3.2.0-0-g344cb70.tar.gz
/Pillow-3.3.0.tar.gz

View File

@ -3,7 +3,7 @@
%global py2_libbuilddir %(python -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))') %global py2_libbuilddir %(python -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
%global py3_libbuilddir %(python3 -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))') %global py3_libbuilddir %(python3 -c 'import sys; import sysconfig; print("lib.{p}-{v[0]}.{v[1]}".format(p=sysconfig.get_platform(), v=sys.version_info))')
%global name3 python3-pillow %global srcname pillow
# bootstrap building docs (pillow is required by docutils, docutils are # bootstrap building docs (pillow is required by docutils, docutils are
# required by sphinx; pillow build-requires sphinx) # required by sphinx; pillow build-requires sphinx)
%global with_docs 1 %global with_docs 1
@ -12,29 +12,15 @@
%global with_python3 1 %global with_python3 1
%endif %endif
# Refer to the comment for Source0 below on how to obtain the source tarball Name: python-%{srcname}
# The saved file has format python-pillow-Pillow-$version-$ahead-g$shortcommit.tar.gz Version: 3.3.0
%global commit 344cb709ed0111adcc6ad47cc007507c3f5efeb3 Release: 1%{?dist}
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global ahead 0
# If ahead is 0, the tarball corresponds to a release version, otherwise to a git snapshot
%if %{ahead} > 0
%global snap .git%{shortcommit}
%endif
Name: python-pillow
Version: 3.2.0
Release: 1%{?snap}%{?dist}
Summary: Python image processing library Summary: Python image processing library
# License: see http://www.pythonware.com/products/pil/license.htm # License: see http://www.pythonware.com/products/pil/license.htm
License: MIT License: MIT
URL: http://python-pillow.github.io/ URL: http://python-pillow.github.io/
Source0: https://github.com/python-pillow/Pillow/archive/%{version}/Pillow-%{version}.tar.gz
# Obtain the tarball for a certain commit via:
# wget --content-disposition https://github.com/python-pillow/Pillow/tarball/$commit
Source0: https://github.com/python-pillow/Pillow/tarball/%{commit}/python-pillow-Pillow-%{version}-%{ahead}-g%{shortcommit}.tar.gz
BuildRequires: tk-devel BuildRequires: tk-devel
BuildRequires: libjpeg-devel BuildRequires: libjpeg-devel
@ -47,21 +33,21 @@ BuildRequires: libwebp-devel
BuildRequires: libtiff-devel BuildRequires: libtiff-devel
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python2-setuptools
BuildRequires: tkinter BuildRequires: tkinter
BuildRequires: PyQt4 BuildRequires: python2-PyQt4
BuildRequires: numpy BuildRequires: python2-numpy
%if 0%{?with_docs} %if 0%{?with_docs}
BuildRequires: python-sphinx BuildRequires: python2-sphinx
BuildRequires: python-sphinx_rtd_theme BuildRequires: python2-sphinx_rtd_theme
%endif # with_docs %endif # with_docs
BuildRequires: python-cffi BuildRequires: python2-cffi
%if %{with_python3} %if %{with_python3}
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-tkinter BuildRequires: python3-tkinter
BuildRequires: python3-PyQt4 BuildRequires: python3-qt5
BuildRequires: python3-numpy BuildRequires: python3-numpy
%if 0%{?with_docs} %if 0%{?with_docs}
BuildRequires: python3-sphinx BuildRequires: python3-sphinx
@ -73,12 +59,7 @@ BuildRequires: python3-cffi
# For EpsImagePlugin.py # For EpsImagePlugin.py
Requires: ghostscript Requires: ghostscript
Provides: python-imaging = %{version}-%{release} %filter_provides_in %{python2_sitearch}
Obsoletes: python-imaging <= 1.1.7-12
Provides: python2-pillow
%filter_provides_in %{python_sitearch}
%filter_provides_in %{python3_sitearch} %filter_provides_in %{python3_sitearch}
%filter_setup %filter_setup
@ -92,56 +73,14 @@ There are four subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
devel (development) and doc (documentation). devel (development) and doc (documentation).
%package devel %package -n python2-%{srcname}
Summary: Development files for %{name} Summary: Python 2 image processing library
Group: Development/Libraries %{?python_provide:%python_provide python2-%{srcname}}
Requires: %{name}%{?_isa} = %{version}-%{release} Provides: python-imaging = %{version}-%{release}
Requires: python-devel, libjpeg-devel, zlib-devel Provides: python2-imaging = %{version}-%{release}
Provides: python-imaging-devel = %{version}-%{release}
Obsoletes: python-imaging-devel <= 1.1.7-12
%description devel
Development files for %{name}.
%package doc %description -n python2-%{srcname}
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}.
%package tk
Summary: Tk interface for %{name}
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: tkinter
Provides: python-imaging-tk = %{version}-%{release}
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
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}
Summary: Python 3 image processing library
Provides: python3-imaging = %{version}-%{release}
%description -n %{name3}
Python image processing library, fork of the Python Imaging Library (PIL) Python image processing library, fork of the Python Imaging Library (PIL)
This library provides extensive file format support, an efficient This library provides extensive file format support, an efficient
@ -151,85 +90,140 @@ There are four subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
devel (development) and doc (documentation). devel (development) and doc (documentation).
%package -n %{name3}-devel %package -n python2-%{srcname}-devel
Summary: Development files for %{name3} Summary: Development files for %{srcname}
Group: Development/Libraries Requires: python2-devel, libjpeg-devel, zlib-devel
Requires: %{name3}%{?_isa} = %{version}-%{release} Requires: python2-%{srcname}%{?_isa} = %{version}-%{release}
Requires: python3-devel, libjpeg-devel, zlib-devel %{?python_provide:%python_provide python2-%{srcname}-devel}
Provides: python-imaging-devel = %{version}-%{release}
Provides: python2-imaging-devel = %{version}-%{release}
%description -n %{name3}-devel %description -n python2-%{srcname}-devel
Development files for %{name3}. Development files for %{srcname}.
%package -n %{name3}-doc %package -n python2-%{srcname}-doc
Summary: Documentation for %{name3} Summary: Documentation for %{srcname}
Group: Documentation
Requires: %{name3} = %{version}-%{release}
BuildArch: noarch BuildArch: noarch
Requires: python2-%{srcname} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{srcname}-doc}
Provides: python-imaging-doc = %{version}-%{release}
Provides: python2-imaging-doc = %{version}-%{release}
%description -n %{name3}-doc %description -n python2-%{srcname}-doc
Documentation for %{name3}. Documentation for %{srcname}.
%package -n %{name3}-tk %package -n python2-%{srcname}-tk
Summary: Tk interface for %{name3} Summary: Tk interface for %{srcname}
Group: System Environment/Libraries Requires: tkinter
Requires: %{name3}%{?_isa} = %{version}-%{release} Requires: python2-%{srcname}%{?_isa} = %{version}-%{release}
Requires: python3-tkinter %{?python_provide:%python_provide python2-%{srcname}-tk}
Provides: python-imaging-tk = %{version}-%{release}
Provides: python2-imaging-tk = %{version}-%{release}
%description -n %{name3}-tk %description -n python2-%{srcname}-tk
Tk interface for %{name3}. Tk interface for %{name}.
%package -n %{name3}-qt
Summary: PIL image wrapper for Qt %package -n python2-%{srcname}-qt
Group: System Environment/Libraries Summary: Qt %{srcname} image wrapper
Requires: %{name3}%{?_isa} = %{version}-%{release} Requires: python2-PyQt4
Requires: python2-%{srcname}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python2-%{srcname}-qt}
Provides: python-imaging-qt = %{version}-%{release}
Provides: python2-imaging-qt = %{version}-%{release}
%description -n python2-%{srcname}-qt
Qt %{srcname} image wrapper.
%if %{with_python3}
%package -n python3-%{srcname}
Summary: Python 3 image processing library
%{?python_provide:%python_provide python3-%{srcname}}
Provides: python3-imaging = %{version}-%{release}
%description -n python3-%{srcname}
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.
There are four subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
devel (development) and doc (documentation).
%package -n python3-%{srcname}-devel
Summary: Development files for %{srcname}
Requires: python3-devel, libjpeg-devel, zlib-devel
Requires: python3-%{srcname}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}-devel}
Provides: python3-imaging-devel = %{version}-%{release}
%description -n python3-%{srcname}-devel
Development files for %{srcname}.
%package -n python3-%{srcname}-doc
Summary: Documentation for %{srcname}
BuildArch: noarch
Requires: python3-%{srcname} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}-doc}
Provides: python3-imaging-doc = %{version}-%{release}
%description -n python3-%{srcname}-doc
Documentation for %{srcname}.
%package -n python3-%{srcname}-tk
Summary: Tk interface for %{srcname}
Requires: tkinter
Requires: python3-%{srcname}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}-tk}
Provides: python3-imaging-tk = %{version}-%{release}
%description -n python3-%{srcname}-tk
Tk interface for %{name}.
%package -n python3-%{srcname}-qt
Summary: Qt %{srcname} image wrapper
Requires: python3-PyQt4 Requires: python3-PyQt4
Requires: python3-%{srcname}%{?_isa} = %{version}-%{release}
%{?python_provide:%python_provide python3-%{srcname}-qt}
Provides: python3-imaging-qt = %{version}-%{release}
%description -n %{name3}-qt %description -n python3-%{srcname}-qt
PIL image wrapper for Qt. Qt %{srcname} image wrapper.
%endif %endif
%prep %prep
%setup -q -n python-pillow-Pillow-%{shortcommit} %setup -q -n Pillow-%{version}
# Strip shebang on non-executable file # Strip shebang on non-executable file
sed -i 1d PIL/OleFileIO.py sed -i 1d PIL/OleFileIO.py
%if %{with_python3}
# Create Python 3 source tree
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build %build
# Build Python 2 modules # Build Python 2 modules
find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python}|' %py2_build
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
%if 0%{?with_docs} %if 0%{?with_docs}
pushd docs PYTHONPATH=$PWD/build/%py2_libbuilddir make -C docs html BUILDDIR=_build_py2 SPHINXBUILD=sphinx-build-%python2_version
PYTHONPATH=$PWD/../build/%py2_libbuilddir make html rm -f docs/_build_py2/html/.buildinfo
rm -f _build/html/.buildinfo
popd
%endif # with_docs %endif # with_docs
%if %{with_python3} %if %{with_python3}
# Build Python 3 modules # Build Python 3 modules
pushd %{py3dir} %py3_build
find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python3}|'
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%if 0%{?with_docs} %if 0%{?with_docs}
pushd docs PYTHONPATH=$PWD/build/%py3_libbuilddir make -C docs html BUILDDIR=_build_py3 SPHINXBUILD=sphinx-build-%python3_version
PYTHONPATH=$PWD/../build/%py3_libbuilddir make html SPHINXBUILD=sphinx-build-%python3_version rm -f docs/_build_py3/html/.buildinfo
rm -f _build/html/.buildinfo
popd
%endif # with_docs %endif # with_docs
popd
%endif %endif
@ -237,27 +231,29 @@ popd
# Install Python 2 modules # Install Python 2 modules
install -d %{buildroot}/%{py2_incdir}/Imaging install -d %{buildroot}/%{py2_incdir}/Imaging
install -m 644 libImaging/*.h %{buildroot}/%{py2_incdir}/Imaging install -m 644 libImaging/*.h %{buildroot}/%{py2_incdir}/Imaging
%{__python} setup.py install --skip-build --root %{buildroot} install -d %{buildroot}%{_defaultdocdir}/python2-%{srcname}-doc/Scripts
install -m 644 Scripts/* %{buildroot}%{_defaultdocdir}/python2-%{srcname}-doc/Scripts
%py2_install
# Fix non-standard-executable-perm # Fix non-standard-executable-perm
chmod 0755 %{buildroot}%{python_sitearch}/PIL/*.so chmod 0755 %{buildroot}%{python2_sitearch}/PIL/*.so
# Fix executable docs # Hardcode interpreter for example scripts
find Scripts -type f -exec chmod a-x \{\} \; find %{buildroot}%{_defaultdocdir}/python2-%{srcname}-doc/Scripts -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python2}|'
%if %{with_python3} %if %{with_python3}
# Install Python 3 modules # Install Python 3 modules
pushd %{py3dir}
install -d %{buildroot}/%{py3_incdir}/Imaging install -d %{buildroot}/%{py3_incdir}/Imaging
install -m 644 libImaging/*.h %{buildroot}/%{py3_incdir}/Imaging install -m 644 libImaging/*.h %{buildroot}/%{py3_incdir}/Imaging
%{__python3} setup.py install --skip-build --root %{buildroot} install -d %{buildroot}%{_defaultdocdir}/python3-%{srcname}-doc/Scripts
popd install -m 644 Scripts/* %{buildroot}%{_defaultdocdir}/python3-%{srcname}-doc/Scripts
%py3_install
# Fix non-standard-executable-perm # Fix non-standard-executable-perm
chmod 0755 %{buildroot}%{python3_sitearch}/PIL/*.so chmod 0755 %{buildroot}%{python3_sitearch}/PIL/*.so
# Fix executable docs # Hardcode interpreter for example scripts
find Scripts -type f -exec chmod a-x \{\} \; find %{buildroot}%{_defaultdocdir}/python3-%{srcname}-doc/Scripts -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python3}|'
%endif %endif
# The scripts are packaged in %%doc # The scripts are packaged in %%doc
@ -270,51 +266,49 @@ ln -s $PWD/Images $PWD/build/%py2_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py2_libbuilddir/Tests cp -R $PWD/Tests $PWD/build/%py2_libbuilddir/Tests
cp -R $PWD/selftest.py $PWD/build/%py2_libbuilddir/selftest.py cp -R $PWD/selftest.py $PWD/build/%py2_libbuilddir/selftest.py
pushd build/%py2_libbuilddir pushd build/%py2_libbuilddir
PYTHONPATH=$PWD %{__python} selftest.py PYTHONPATH=$PWD %{__python2} selftest.py
popd popd
%if %{with_python3} %if %{with_python3}
# Check Python 3 modules # Check Python 3 modules
pushd %{py3dir}
ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images ln -s $PWD/Images $PWD/build/%py3_libbuilddir/Images
cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests cp -R $PWD/Tests $PWD/build/%py3_libbuilddir/Tests
cp -R $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py cp -R $PWD/selftest.py $PWD/build/%py3_libbuilddir/selftest.py
pushd build/%py3_libbuilddir pushd build/%py3_libbuilddir
PYTHONPATH=$PWD %{__python3} selftest.py PYTHONPATH=$PWD %{__python3} selftest.py
popd popd
popd
%endif %endif
%files %files -n python2-%{srcname}
%doc README.rst CHANGES.rst %doc README.rst CHANGES.rst
%license docs/COPYING %license docs/COPYING
%{python_sitearch}/* %{python2_sitearch}/*
# These are in subpackages # These are in subpackages
%exclude %{python_sitearch}/PIL/_imagingtk* %exclude %{python2_sitearch}/PIL/_imagingtk*
%exclude %{python_sitearch}/PIL/ImageTk* %exclude %{python2_sitearch}/PIL/ImageTk*
%exclude %{python_sitearch}/PIL/SpiderImagePlugin* %exclude %{python2_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python_sitearch}/PIL/ImageQt* %exclude %{python2_sitearch}/PIL/ImageQt*
%files devel %files -n python2-%{srcname}-devel
%{py2_incdir}/Imaging/ %{py2_incdir}/Imaging/
%files doc %files -n python2-%{srcname}-doc
%doc Scripts %doc %{_defaultdocdir}/python2-%{srcname}-doc/Scripts
%if 0%{?with_docs} %if 0%{?with_docs}
%doc docs/_build/html %doc docs/_build_py2/html
%endif # with_docs %endif # with_docs
%files tk %files -n python2-%{srcname}-tk
%{python_sitearch}/PIL/_imagingtk* %{python2_sitearch}/PIL/_imagingtk*
%{python_sitearch}/PIL/ImageTk* %{python2_sitearch}/PIL/ImageTk*
%{python_sitearch}/PIL/SpiderImagePlugin* %{python2_sitearch}/PIL/SpiderImagePlugin*
%files qt %files -n python2-%{srcname}-qt
%{python_sitearch}/PIL/ImageQt* %{python2_sitearch}/PIL/ImageQt*
%if %{with_python3} %if %{with_python3}
%files -n %{name3} %files -n python3-%{srcname}
%doc README.rst CHANGES.rst %doc README.rst CHANGES.rst
%license docs/COPYING %license docs/COPYING
%{python3_sitearch}/* %{python3_sitearch}/*
@ -324,26 +318,30 @@ popd
%exclude %{python3_sitearch}/PIL/SpiderImagePlugin* %exclude %{python3_sitearch}/PIL/SpiderImagePlugin*
%exclude %{python3_sitearch}/PIL/ImageQt* %exclude %{python3_sitearch}/PIL/ImageQt*
%files -n %{name3}-devel %files -n python3-%{srcname}-devel
%{py3_incdir}/Imaging/ %{py3_incdir}/Imaging/
%files -n %{name3}-doc %files -n python3-%{srcname}-doc
%doc Scripts %doc %{_defaultdocdir}/python3-%{srcname}-doc/Scripts
%if 0%{?with_docs} %if 0%{?with_docs}
%doc docs/_build/html %doc docs/_build_py3/html
%endif # with_docs %endif # with_docs
%files -n %{name3}-tk %files -n python3-%{srcname}-tk
%{python3_sitearch}/PIL/_imagingtk* %{python3_sitearch}/PIL/_imagingtk*
%{python3_sitearch}/PIL/ImageTk* %{python3_sitearch}/PIL/ImageTk*
%{python3_sitearch}/PIL/SpiderImagePlugin* %{python3_sitearch}/PIL/SpiderImagePlugin*
%files -n %{name3}-qt %files -n python3-%{srcname}-qt
%{python3_sitearch}/PIL/ImageQt* %{python3_sitearch}/PIL/ImageQt*
%endif %endif
%changelog %changelog
* Sat Jul 02 2016 Sandro Mani <manisandro@gmail.com> - 3.3.0-1
- Update to 3.3.0
- Modernize spec
* Fri Apr 01 2016 Sandro Mani <manisandro@gmail.com> - 3.2.0-1 * Fri Apr 01 2016 Sandro Mani <manisandro@gmail.com> - 3.2.0-1
- Update to 3.2.0 - Update to 3.2.0

View File

@ -1 +1 @@
6c3a56023079f4227509050b482c4fff python-pillow-Pillow-3.2.0-0-g344cb70.tar.gz 56c2f864d9a64cb5491410024d755229 Pillow-3.3.0.tar.gz