- Move away from pkgconfig-style buildrequires to support SLE

- Implement update-alternatives
- License update: HPND

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pillow?expand=0&rev=4
This commit is contained in:
Sascha Peilicke 2013-11-18 09:41:29 +00:00 committed by Git OBS Bridge
parent aafc86e796
commit 698b0816f7
2 changed files with 48 additions and 12 deletions

View File

@ -1,8 +1,13 @@
-------------------------------------------------------------------
Mon Nov 18 09:07:13 UTC 2013 - speilicke@suse.com
- Move away from pkgconfig-style buildrequires to support SLE
- Implement update-alternatives
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Nov 14 11:38:42 UTC 2013 - cfarrell@suse.com Thu Nov 14 11:38:42 UTC 2013 - cfarrell@suse.com
- license update: HPND - License update: HPND
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Nov 12 10:18:12 UTC 2013 - speilicke@suse.com Tue Nov 12 10:18:12 UTC 2013 - speilicke@suse.com

View File

@ -32,12 +32,14 @@ BuildRequires: tk-devel
BuildRequires: unzip BuildRequires: unzip
%if 0%{?suse_version} > 1210 %if 0%{?suse_version} > 1210
BuildRequires: libjpeg8-devel BuildRequires: libjpeg8-devel
BuildRequires: libwebp-devel
%endif %endif
BuildRequires: pkgconfig(freetype2) BuildRequires: freetype2-devel
BuildRequires: pkgconfig(lcms) BuildRequires: liblcms-devel
BuildRequires: pkgconfig(libtiff-4) BuildRequires: libtiff-devel
BuildRequires: pkgconfig(libwebp) BuildRequires: zlib-devel
BuildRequires: pkgconfig(zlib) Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} <= 1110 %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)")} %{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
@ -78,23 +80,52 @@ CFLAGS="%{optflags}" python setup.py build
%install %install
python setup.py install --prefix=%{_prefix} --root=%{buildroot} python setup.py install --prefix=%{_prefix} --root=%{buildroot}
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
done
%check %check
python setup.py test python setup.py test
python selftest.py python selftest.py
%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 %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc CHANGES.rst README.rst %doc CHANGES.rst README.rst
%{_bindir}/pilconvert.py %ghost %{_bindir}/pilconvert
%{_bindir}/pildriver.py %{_bindir}/pilconvert-%{py_ver}
%{_bindir}/pilfile.py %ghost %{_bindir}/pildriver
%{_bindir}/pilfont.py %{_bindir}/pildriver-%{py_ver}
%{_bindir}/pilprint.py %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
%{python_sitearch}/Pillow-%{version}-py%{py_ver}.egg-info %{python_sitearch}/Pillow-%{version}-py%{py_ver}.egg-info
%exclude %{python_sitearch}/PIL/ImageTk* %exclude %{python_sitearch}/PIL/ImageTk*
%exclude %{python_sitearch}/PIL/_imagingtk* %exclude %{python_sitearch}/PIL/_imagingtk*
%if 0%{?suse_version} > 1210
%ghost %{_sysconfdir}/alternatives/pilconvert
%ghost %{_sysconfdir}/alternatives/pildriver
%ghost %{_sysconfdir}/alternatives/pilfile
%ghost %{_sysconfdir}/alternatives/pilfont
%ghost %{_sysconfdir}/alternatives/pilprint
%endif
%files tk %files tk
%defattr(-,root,root,-) %defattr(-,root,root,-)