File python-ZEO.spec of Package python-ZEO
#
# spec file for package python-ZEO
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2013 LISA GmbH, Bingen, 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-ZEO
Version: 4.0.0b1
Release: 0
Url: http://docs.pylonsproject.org
Summary: Client-Server storage implementation for ZODB
License: ZPL-2.1
Group: Development/Languages/Python
Source: http://pypi.python.org/packages/source/Z/ZEO/ZEO-%{version}.tar.gz
Requires: python-ZODB >= 4.0.0
Requires: python-transaction
Requires: python-persistent
Requires: python-zc.lockfile
Requires: python-ZConfig
Requires: python-zdaemon
Requires: python-zope.interface
BuildRequires: python-ZODB >= 4.0.0
BuildRequires: python-transaction
BuildRequires: python-persistent
BuildRequires: python-zc.lockfile
BuildRequires: python-ZConfig
BuildRequires: python-zdaemon
BuildRequires: python-zope.interface
BuildRequires: python-six
# Documentation requirements:
BuildRequires: python-Sphinx
# Testing requirements:
BuildRequires: python-zope.testing
BuildRequires: python-manuel
BuildRequires: python-random2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires(post): update-alternatives
Requires(postun): update-alternatives
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
BuildRequires: python-ordereddict
BuildRequires: python-unittest2
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch: noarch
%endif
%description
ZEO provides a client-server storage implementation for ZODB.
%package doc
Summary: Client-Server storage implementation for ZODB
Group: Development/Languages/Python
Requires: %{name} = %{version}
%description doc
This package contains documentation files for %{name}.
%prep
%setup -q -n ZEO-%{version}
%build
python setup.py build
python setup.py build_sphinx && rm build/sphinx/html/.buildinfo
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
chmod 755 %{buildroot}%{python_sitelib}/ZEO/scripts/{parsezeolog,timeout,zeoqueue,cache_simul}.py
chmod 755 %{buildroot}%{python_sitelib}/ZEO/scripts/{zeoserverlog,zeoreplay,zeopack,zeoup}.py
chmod 755 %{buildroot}%{python_sitelib}/ZEO/zeoctl.py
for fn in runzeo zeoctl zeopack zeopasswd; do
mv %{buildroot}%{_bindir}/$fn %{buildroot}%{_bindir}/$fn-%{py_ver}
ln -s %{_bindir}/$fn-%{py_ver} %{buildroot}%{_bindir}/$fn
done
%check
python setup.py test
%pre
# Since binaries in /usr/bin became ghosted to be used with update-alternatives, we have
# to get rid of the old binaries resulting from the non-update-alternativies-ified package:
[[ ! -L %{_bindir}/runzeo ]] && rm -f %{_bindir}/runzeo
[[ ! -L %{_bindir}/zeoctl ]] && rm -f %{_bindir}/zeoctl
[[ ! -L %{_bindir}/zeopack ]] && rm -f %{_bindir}/zeopack
[[ ! -L %{_bindir}/zeopasswd ]] && rm -f %{_bindir}/zeopasswd
exit 0
%post
update-alternatives \
--install %{_bindir}/runzeo runzeo %{_bindir}/runzeo-%{py_ver} 20 \
--slave %{_bindir}/zeoctl zeoctl %{_bindir}/zeoctl-%{py_ver} \
--slave %{_bindir}/zeopack zeopack %{_bindir}/zeopack-%{py_ver} \
--slave %{_bindir}/zeopasswd zeopasswd %{_bindir}/zeopasswd-%{py_ver} \
%preun
if [ $1 -eq 0 ] ; then
update-alternatives --remove runzeo %{_bindir}/runzeo-%{py_ver}
fi
%files
%defattr(-,root,root,-)
%doc CHANGES.txt COPYING COPYRIGHT.txt LICENSE.txt README.txt
%ghost %attr(0755,root,root) %{_bindir}/runzeo
%{_bindir}/runzeo-%{py_ver}
%ghost %attr(0755,root,root) %{_bindir}/zeoctl
%{_bindir}/zeoctl-%{py_ver}
%ghost %attr(0755,root,root) %{_bindir}/zeopack
%{_bindir}/zeopack-%{py_ver}
%ghost %attr(0755,root,root) %{_bindir}/zeopasswd
%{_bindir}/zeopasswd-%{py_ver}
%{python_sitelib}/ZEO
%{python_sitelib}/ZEO-%{version}-py%{py_ver}.egg-info
%files doc
%defattr(-,root,root,-)
%doc build/sphinx/html
%changelog