Blob Blame History Raw
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_py3 1
%endif

%global srcname ZEO

Name:           python-%{srcname}
Version:        5.1.1
Release:        1%{?dist}
Summary:        Client-server storage implementation for ZODB

License:        ZPLv2.1
URL:            http://www.zodb.org/
Source0:        https://files.pythonhosted.org/packages/source/Z/%{srcname}/%{srcname}-%{version}.tar.gz
BuildArch:      noarch

BuildRequires:  python2-devel
BuildRequires:  python2-funcsigs
BuildRequires:  python2-futures
BuildRequires:  python2-manuel
BuildRequires:  python2-mock
BuildRequires:  python2-msgpack
BuildRequires:  python2-pbr
BuildRequires:  python2-persistent
BuildRequires:  python2-random2
BuildRequires:  python2-setuptools
BuildRequires:  python2-six
BuildRequires:  python-transaction
BuildRequires:  python-trollius
BuildRequires:  python-zc-lockfile
BuildRequires:  python2-ZConfig
BuildRequires:  python-zdaemon
BuildRequires:  python2-ZODB
BuildRequires:  python2-zope-interface
BuildRequires:  python2-zope-testing

%if 0%{?with_py3}
BuildRequires:  python3-devel
BuildRequires:  python3-funcsigs
BuildRequires:  python3-manuel
BuildRequires:  python3-mock
BuildRequires:  python3-msgpack
BuildRequires:  python3-pbr
BuildRequires:  python3-persistent
BuildRequires:  python3-random2
BuildRequires:  python3-setuptools
BuildRequires:  python3-six
BuildRequires:  python3-transaction
BuildRequires:  python3-trollius
BuildRequires:  python3-uvloop
BuildRequires:  python3-zc-lockfile
BuildRequires:  python3-ZConfig
BuildRequires:  python3-zdaemon
BuildRequires:  python3-ZODB
BuildRequires:  python3-zope-interface
BuildRequires:  python3-zope-testing
%endif

%global common_desc                                                   \
ZEO is a client-server system for sharing a single storage among many \
clients.  When you use ZEO, the storage is opened in the ZEO server   \
process.  Client programs connect to this process using a ZEO         \
ClientStorage.  ZEO provides a consistent view of the database to all \
clients.  The ZEO client and server communicate using a custom RPC    \
protocol layered on top of TCP.

%description
%{common_desc}

%package -n python2-%{srcname}
Summary:        Client-server storage implementation for ZODB
Requires:       python2-persistent
Requires:       python2-setuptools
Requires:       python2-six
Requires:       python-transaction
Requires:       python-zc-lockfile
Requires:       python2-ZConfig
Requires:       python-zdaemon
Requires:       python2-ZODB
Requires:       python2-zope-interface

%{?python_provide:%python_provide python2-%{srcname}}

%description -n python2-%{srcname}
%{common_desc}

%if 0%{?with_py3}
%package -n python3-%{srcname}
Summary:        Client-server storage implementation for ZODB
Requires:       python3-persistent
Requires:       python3-setuptools
Requires:       python3-six
Requires:       python3-transaction
Requires:       python3-zc-lockfile
Requires:       python3-ZConfig
Requires:       python3-zdaemon
Requires:       python3-ZODB
Requires:       python3-zope-interface

%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
%{common_desc}
%endif

%prep
%setup -q -c

# Remove prebuilt egg
rm -fr %{srcname}-%{version}/src/%{srcname}.egg-info

# Remove backup files
find %{srcname}-%{version}/src -name \*~ -exec rm {} +
find %{srcname}-%{version}/src -name '#*#' -exec rm {} +

%if 0%{?with_py3}
# Prepare for a python3 build
cp -a %{srcname}-%{version} python3-%{srcname}-%{version}
%endif

%build
# Python 2 build
pushd %{srcname}-%{version}
%py2_build
popd

%if 0%{?with_py3}
# Python 3 build
pushd python3-%{srcname}-%{version}
%py3_build
popd
%endif

%install
%if 0%{?with_py3}
# Python 3 install
pushd python3-%{srcname}-%{version}
%py3_install
popd
for bin in runzeo zeo-nagios zeoctl zeopack; do
  mv %{buildroot}%{_bindir}/$bin %{buildroot}%{_bindir}/python3-${bin}
done

# Fix scripts
for script in $(grep -Rl '^#!' %{buildroot}%{python3_sitelib}/%{srcname}); do
  sed 's,%{_bindir}/env python.*,%{_bindir}/python3,' $script > $script.new
  touch -r $script $script.new
  mv -f $script.new $script
  chmod 0755 $script
done
%endif

# Python 2 install
pushd %{srcname}-%{version}
%py2_install
popd

# Fix scripts
for script in $(grep -Rl '^#!' %{buildroot}%{python2_sitelib}/%{srcname}); do
  sed 's,%{_bindir}/env python.*,%{_bindir}/python2,' $script > $script.new
  touch -r $script $script.new
  mv -f $script.new $script
  chmod 0755 $script
done

%check
# Python 2 tests
pushd %{srcname}-%{version}
%{__python2} setup.py test
popd

%if 0%{?with_py3}
# Python 3 tests
pushd python3-%{srcname}-%{version}
%{__python3} setup.py test
popd
%endif

%files -n python2-%{srcname}
%doc %{srcname}-%{version}/CHANGES.rst %{srcname}-%{version}/README.rst
%license %{srcname}-%{version}/COPYRIGHT.txt %{srcname}-%{version}/LICENSE.txt
%{_bindir}/runzeo
%{_bindir}/zeo-nagios
%{_bindir}/zeoctl
%{_bindir}/zeopack
%{python2_sitelib}/%{srcname}*

%if 0%{?with_py3}
%files -n python3-%{srcname}
%doc %{srcname}-%{version}/CHANGES.rst %{srcname}-%{version}/README.rst
%license %{srcname}-%{version}/COPYRIGHT.txt %{srcname}-%{version}/LICENSE.txt
%{_bindir}/python3-runzeo
%{_bindir}/python3-zeo-nagios
%{_bindir}/python3-zeoctl
%{_bindir}/python3-zeopack
%{python3_sitelib}/%{srcname}*
%endif

%changelog
* Sat Dec 23 2017 Jerry James <loganjerry@gmail.com> - 5.1.1-1
- New upstream release

* Sat Oct  7 2017 Jerry James <loganjerry@gmail.com> - 5.1.0-1
- New upstream release

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.0.4-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 5.0.4-2
- Rebuild for Python 3.6

* Sat Dec 10 2016 Jerry James <loganjerry@gmail.com> - 5.0.4-1
- New upstream release

* Tue Nov  1 2016 Jerry James <loganjerry@gmail.com> - 5.0.2-1
- New upstream release

* Tue Sep  6 2016 Jerry James <loganjerry@gmail.com> - 5.0.1-1
- New upstream release

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.2.1-2
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Mon Jul  4 2016 Jerry James <loganjerry@gmail.com> - 4.2.1-1
- New upstream release

* Fri Jun 17 2016 Jerry James <loganjerry@gmail.com> - 4.2.0-1
- New upstream release

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Mon Feb  1 2016 Jerry James <loganjerry@gmail.com> - 4.1.0-3
- Comply with latest python packaging guidelines

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jan 12 2015 Jerry James <loganjerry@gmail.com> - 4.1.0-1
- New upstream release
- Name python 3 binaries according to policy
- Use license macro

* Thu Jun 12 2014 Jerry James <loganjerry@gmail.com> - 4.0.0-1
- Initial RPM