Update to 2.7.0, drop sane subpackage

This commit is contained in:
Sandro Mani 2015-01-12 15:12:16 +01:00
parent 4ff0eacb0e
commit f3240851bb

View File

@ -1,5 +1,5 @@
%global py2_incdir %{_includedir}/python%{python_version} %global py2_incdir %(python -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')
%global py3_incdir %{_includedir}/python%{python3_version} %global py3_incdir %(python3 -c 'import distutils.sysconfig; print(distutils.sysconfig.get_python_inc())')
%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))')
@ -16,7 +16,7 @@
%endif %endif
# Refer to the comment for Source0 below on how to obtain the source tarball # Refer to the comment for Source0 below on how to obtain the source tarball
# The saved file has format python-imaging-Pillow-$version-$ahead-g$shortcommit.tar.gz # The saved file has format python-pillow-Pillow-$version-$ahead-g$shortcommit.tar.gz
%global commit 0f05eb287a223ce106848cd048cfcb45e9faa565 %global commit 0f05eb287a223ce106848cd048cfcb45e9faa565
%global shortcommit %(c=%{commit}; echo ${c:0:7}) %global shortcommit %(c=%{commit}; echo ${c:0:7})
%global ahead 0 %global ahead 0
@ -44,10 +44,10 @@ BuildRequires: libjpeg-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: freetype-devel BuildRequires: freetype-devel
BuildRequires: lcms2-devel BuildRequires: lcms2-devel
BuildRequires: sane-backends-devel
BuildRequires: ghostscript BuildRequires: ghostscript
BuildRequires: openjpeg2-devel BuildRequires: openjpeg2-devel
BuildRequires: libwebp-devel BuildRequires: libwebp-devel
BuildRequires: libtiff-devel
BuildRequires: python2-devel BuildRequires: python2-devel
BuildRequires: python-setuptools BuildRequires: python-setuptools
@ -89,8 +89,8 @@ 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
internal representation, and powerful image processing capabilities. internal representation, and powerful image processing capabilities.
There are five subpackages: tk (tk interface), qt (PIL image wrapper for Qt), There are four subpackages: tk (tk interface), qt (PIL image wrapper for Qt),
sane (scanning devices interface), devel (development) and doc (documentation). devel (development) and doc (documentation).
%package devel %package devel
@ -115,18 +115,6 @@ BuildArch: noarch
Documentation for %{name}. Documentation for %{name}.
%package sane
Summary: Python module for using scanners
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: python-imaging-sane = %{version}-%{release}
Obsoletes: python-imaging-sane <= 1.1.7-12
%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.
%package tk %package tk
Summary: Tk interface for %{name} Summary: Tk interface for %{name}
Group: System Environment/Libraries Group: System Environment/Libraries
@ -178,16 +166,6 @@ BuildArch: noarch
Documentation for %{name3}. Documentation for %{name3}.
%package -n %{name3}-sane
Summary: Python module for using scanners
Group: System Environment/Libraries
Requires: %{name3}%{?_isa} = %{version}-%{release}
%description -n %{name3}-sane
This package contains the sane module for Python which provides access to
various raster scanning devices such as flatbed scanners and digital cameras.
%package -n %{name3}-tk %package -n %{name3}-tk
Summary: Tk interface for %{name3} Summary: Tk interface for %{name3}
Group: System Environment/Libraries Group: System Environment/Libraries
@ -200,7 +178,6 @@ Tk interface for %{name3}.
%package -n %{name3}-qt %package -n %{name3}-qt
Summary: PIL image wrapper for Qt Summary: PIL image wrapper for Qt
Group: System Environment/Libraries Group: System Environment/Libraries
Obsoletes: %{name3} <= 2.0.0-5.git93a488e8
Requires: %{name3}%{?_isa} = %{version}-%{release} Requires: %{name3}%{?_isa} = %{version}-%{release}
Requires: python3-PyQt4 Requires: python3-PyQt4
@ -213,9 +190,6 @@ PIL image wrapper for Qt.
%prep %prep
%setup -q -n python-pillow-Pillow-%{shortcommit} %setup -q -n python-pillow-Pillow-%{shortcommit}
# Fix spurious-executable-perm
chmod -x libImaging/Jpeg2KEncode.c
# Strip shebang on non-executable file # Strip shebang on non-executable file
sed -i 1d PIL/OleFileIO.py sed -i 1d PIL/OleFileIO.py
@ -224,6 +198,10 @@ iconv --from=ISO-8859-1 --to=UTF-8 PIL/WalImageFile.py > PIL/WalImageFile.py.new
touch -r PIL/WalImageFile.py PIL/WalImageFile.py.new && \ touch -r PIL/WalImageFile.py PIL/WalImageFile.py.new && \
mv PIL/WalImageFile.py.new PIL/WalImageFile.py mv PIL/WalImageFile.py.new PIL/WalImageFile.py
# Make sample scripts non-executable
chmod -x Scripts/diffcover-run.sh
chmod -x Scripts/diffcover-install.sh
%if %{with_python3} %if %{with_python3}
# Create Python 3 source tree # Create Python 3 source tree
rm -rf %{py3dir} rm -rf %{py3dir}
@ -236,10 +214,6 @@ cp -a . %{py3dir}
find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python}|' find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python}|'
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
pushd Sane
CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
popd
%if 0%{?with_docs} %if 0%{?with_docs}
pushd docs pushd docs
PYTHONPATH=$PWD/../build/%py2_libbuilddir make html PYTHONPATH=$PWD/../build/%py2_libbuilddir make html
@ -253,10 +227,6 @@ pushd %{py3dir}
find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python3}|' find -name '*.py' | xargs sed -i '1s|^#!.*python|#!%{__python3}|'
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
pushd Sane
CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
popd
%if 0%{?with_docs} %if 0%{?with_docs}
pushd docs pushd docs
PYTHONPATH=$PWD/../build/%py3_libbuilddir make html SPHINXBUILD=sphinx-build-%python3_version PYTHONPATH=$PWD/../build/%py3_libbuilddir make html SPHINXBUILD=sphinx-build-%python3_version
@ -272,13 +242,9 @@ popd
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} %{__python} setup.py install --skip-build --root %{buildroot}
pushd Sane
%{__python} setup.py install --skip-build --root %{buildroot}
popd
# Fix non-standard-executable-perm # Fix non-standard-executable-perm
chmod 0755 %{buildroot}%{python_sitearch}/PIL/*.so chmod 0755 %{buildroot}%{python_sitearch}/PIL/*.so
chmod 0755 %{buildroot}%{python_sitearch}/*.so
%if %{with_python3} %if %{with_python3}
# Install Python 3 modules # Install Python 3 modules
@ -286,14 +252,10 @@ 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} %{__python3} setup.py install --skip-build --root %{buildroot}
pushd Sane
%{__python3} setup.py install --skip-build --root %{buildroot}
popd
popd popd
# Fix non-standard-executable-perm # Fix non-standard-executable-perm
chmod 0755 %{buildroot}%{python3_sitearch}/PIL/*.so chmod 0755 %{buildroot}%{python3_sitearch}/PIL/*.so
chmod 0755 %{buildroot}%{python3_sitearch}/*.so
%endif %endif
# The scripts are packaged in %%doc # The scripts are packaged in %%doc
@ -323,10 +285,10 @@ popd
%files %files
%doc README.rst CHANGES.rst docs/COPYING %doc README.rst CHANGES.rst
%license docs/COPYING
%{python_sitearch}/* %{python_sitearch}/*
# These are in subpackages # These are in subpackages
%exclude %{python_sitearch}/*sane*
%exclude %{python_sitearch}/PIL/_imagingtk* %exclude %{python_sitearch}/PIL/_imagingtk*
%exclude %{python_sitearch}/PIL/ImageTk* %exclude %{python_sitearch}/PIL/ImageTk*
%exclude %{python_sitearch}/PIL/SpiderImagePlugin* %exclude %{python_sitearch}/PIL/SpiderImagePlugin*
@ -341,10 +303,6 @@ popd
%doc docs/_build/html %doc docs/_build/html
%endif # with_docs %endif # with_docs
%files sane
%doc Sane/CHANGES Sane/demo*.py Sane/sanedoc.txt
%{python_sitearch}/*sane*
%files tk %files tk
%{python_sitearch}/PIL/_imagingtk* %{python_sitearch}/PIL/_imagingtk*
%{python_sitearch}/PIL/ImageTk* %{python_sitearch}/PIL/ImageTk*
@ -355,10 +313,10 @@ popd
%if %{with_python3} %if %{with_python3}
%files -n %{name3} %files -n %{name3}
%doc README.rst CHANGES.rst docs/COPYING %doc README.rst CHANGES.rst
%license docs/COPYING
%{python3_sitearch}/* %{python3_sitearch}/*
# These are in subpackages # These are in subpackages
%exclude %{python3_sitearch}/*sane*
%exclude %{python3_sitearch}/PIL/_imagingtk* %exclude %{python3_sitearch}/PIL/_imagingtk*
%exclude %{python3_sitearch}/PIL/ImageTk* %exclude %{python3_sitearch}/PIL/ImageTk*
%exclude %{python3_sitearch}/PIL/SpiderImagePlugin* %exclude %{python3_sitearch}/PIL/SpiderImagePlugin*
@ -373,10 +331,6 @@ popd
%doc docs/_build/html %doc docs/_build/html
%endif # with_docs %endif # with_docs
%files -n %{name3}-sane
%doc Sane/CHANGES Sane/demo*.py Sane/sanedoc.txt
%{python3_sitearch}/*sane*
%files -n %{name3}-tk %files -n %{name3}-tk
%{python3_sitearch}/PIL/_imagingtk* %{python3_sitearch}/PIL/_imagingtk*
%{python3_sitearch}/PIL/ImageTk* %{python3_sitearch}/PIL/ImageTk*
@ -388,8 +342,11 @@ popd
%endif %endif
%changelog %changelog
* Fri Jan 02 2015 Sandro Mani <manisandro@gmail.com> - 2.7.0-1 * Mon Jan 12 2015 Sandro Mani <manisandro@gmail.com> - 2.7.0-1
- Update to 2.7.0 - Update to 2.7.0
- Drop sane subpackage, is in python-sane now
- Fix python3 headers directory
- Drop Obsoletes: python3-pillow on python3-pillow-qt
* Mon Oct 13 2014 Sandro Mani <manisandro@gmail.com> - 2.6.1-1 * Mon Oct 13 2014 Sandro Mani <manisandro@gmail.com> - 2.6.1-1
- Update to 2.6.1 - Update to 2.6.1