c22eb48
%global commit 1f38ac79ef9a224f4d84e465bcf91f71aff670db
c22eb48
%global shortcommit %(c=%{commit}; echo ${c:0:7})
9f8e514
9f8e514
%if 0%{?fedora} >= 24
c22eb48
%global with_python3 1
9f8e514
%endif
9f8e514
9f8e514
9f8e514
%global library tinyrpc
9f8e514
%global module tinyrpc
9f8e514
9f8e514
Name:       python-%{library}
9f8e514
Version:    0.5
c22eb48
Release:    4.20170523git1f38ac%{?dist}
9f8e514
Summary:    A modular RPC library
9f8e514
License:    MIT
9f8e514
URL:        https://github.com/mbr/%{library}
9f8e514
c22eb48
Source0:    https://github.com/mbr/%{library}/archive/%{commit}/%{library}-%{version}-%{shortcommit}.tar.gz
9f8e514
9f8e514
BuildArch:  noarch
9f8e514
9f8e514
%package -n python2-%{library}
9f8e514
Summary:    A modular RPC library
9f8e514
%{?python_provide:%python_provide python2-%{library}}
9f8e514
9f8e514
BuildRequires:  python2-devel
9f8e514
BuildRequires:  python-setuptools
9f8e514
BuildRequires:  git
9f8e514
BuildRequires:  python-funcsigs
9f8e514
BuildRequires:  python-gevent
9f8e514
BuildRequires:  python-greenlet
9f8e514
BuildRequires:  python-mock
9f8e514
BuildRequires:  python-py
9f8e514
BuildRequires:  python-pytest
9f8e514
BuildRequires:  python-requests
9f8e514
BuildRequires:  python-six
9f8e514
BuildRequires:  python-sphinx
9f8e514
BuildRequires:  python-werkzeug
9f8e514
BuildRequires:  python-zmq
9f8e514
9f8e514
Requires:  python-funcsigs
9f8e514
Requires:  python-gevent
9f8e514
Requires:  python-greenlet
9f8e514
Requires:  python-requests
9f8e514
Requires:  python-six
9f8e514
Requires:  python-werkzeug
9f8e514
Requires:  python-zmq
9f8e514
9f8e514
%description -n python2-%{library}
9f8e514
tinyrpc is a library for making and handling RPC calls in python. 
9f8e514
9f8e514
9f8e514
%package -n python2-%{library}-tests
9f8e514
Summary:    Tests for python2-tinyrpc library
9f8e514
9f8e514
Requires:  python-funcsigs
9f8e514
Requires:  python-gevent
9f8e514
Requires:  python-greenlet
9f8e514
Requires:  python-mock
9f8e514
Requires:  python-py
9f8e514
Requires:  python-pytest
9f8e514
Requires:  python-requests
9f8e514
Requires:  python-six
9f8e514
Requires:  python-werkzeug
9f8e514
Requires:  python-zmq
9f8e514
Requires:  python2-%{library} = %{version}-%{release}
9f8e514
9f8e514
9f8e514
%description -n python2-%{library}-tests
9f8e514
Tests for  python2-tinyrpc library
9f8e514
9f8e514
%package -n python-%{library}-doc
9f8e514
Summary:   Documentation for tinyrpc library
9f8e514
9f8e514
9f8e514
%description -n python-%{library}-doc
9f8e514
Documentation for tinyrpc library
9f8e514
9f8e514
%if 0%{?with_python3}
9f8e514
%package -n python3-%{library}
9f8e514
Summary:    A modular RPC library
9f8e514
%{?python_provide:%python_provide python3-%{library}}
9f8e514
9f8e514
BuildRequires:  python3-devel
9f8e514
BuildRequires:  python3-setuptools
9f8e514
BuildRequires:  python3-funcsigs
9f8e514
BuildRequires:  python3-gevent
9f8e514
BuildRequires:  python3-greenlet
9f8e514
BuildRequires:  python3-mock
9f8e514
BuildRequires:  python3-py
9f8e514
BuildRequires:  python3-pytest
9f8e514
BuildRequires:  python3-requests
9f8e514
BuildRequires:  python3-six
9f8e514
BuildRequires:  python3-sphinx
9f8e514
BuildRequires:  python3-werkzeug
9f8e514
BuildRequires:  python3-zmq
9f8e514
9f8e514
Requires:  python3-funcsigs
9f8e514
Requires:  python3-gevent
9f8e514
Requires:  python3-greenlet
9f8e514
Requires:  python3-requests
9f8e514
Requires:  python3-six
9f8e514
Requires:  python3-werkzeug
9f8e514
Requires:  python3-zmq
9f8e514
9f8e514
9f8e514
%description -n python3-%{library}
9f8e514
tinyrpc is a library for making and handling RPC calls in python.
9f8e514
9f8e514
%package -n python3-%{library}-tests
9f8e514
Summary:    Tests for python2-tinyrpc library
9f8e514
9f8e514
Requires:  python3-funcsigs
9f8e514
Requires:  python3-gevent
9f8e514
Requires:  python3-greenlet
9f8e514
Requires:  python3-mock
9f8e514
Requires:  python3-py
9f8e514
Requires:  python3-pytest
9f8e514
Requires:  python3-requests
9f8e514
Requires:  python3-six
9f8e514
Requires:  python3-werkzeug
9f8e514
Requires:  python3-zmq
9f8e514
Requires:  python3-%{library} = %{version}-%{release}
9f8e514
9f8e514
%description -n python3-%{library}-tests
9f8e514
Tests for  python2-tinyrpc library
9f8e514
9f8e514
%endif # with_python3
9f8e514
9f8e514
9f8e514
%description
9f8e514
tinyrpc is a library for making and handling RPC calls in python.
9f8e514
9f8e514
%prep
c22eb48
%autosetup -n %{library}-%{commit} -S git
9f8e514
9f8e514
sed -i -e '/^#!\//, 1d' tinyrpc/*.py tinyrpc/*/*.py tests/*.py
9f8e514
9f8e514
# Let's handle dependencies ourseleves
9f8e514
9f8e514
%build
9f8e514
%py2_build
9f8e514
%if 0%{?with_python3}
9f8e514
%py3_build
9f8e514
%endif
9f8e514
9f8e514
# generate html docs
9f8e514
%{__python2} setup.py build_sphinx
9f8e514
# remove the sphinx-build leftovers
9f8e514
rm -rf build/sphinx/html/.{doctrees,buildinfo}
9f8e514
9f8e514
%install
9f8e514
%py2_install
9f8e514
# Copy tests
9f8e514
mkdir -p %{buildroot}%%{python2_sitelib}/%{library}/tests
9f8e514
cp -r tests %{buildroot}%{python2_sitelib}/%{library}/tests
9f8e514
%if 0%{?with_python3}
9f8e514
%py3_install
9f8e514
# Copy tests
9f8e514
mkdir -p %{buildroot}%%{python3_sitelib}/%{library}/tests
9f8e514
cp -r tests %{buildroot}%{python3_sitelib}/%{library}/tests
9f8e514
%endif
9f8e514
9f8e514
%check
9f8e514
export PYTHONPATH=.
9f8e514
py.test -rs
9f8e514
%if 0%{?with_python3}
c22eb48
py.test-3 -rs --ignore=tests/test_transport.py --ignore=tests/test_wsgi_transport.py
9f8e514
%endif
9f8e514
9f8e514
%files -n python2-%{library}
9f8e514
%license LICENSE
9f8e514
%{python2_sitelib}/%{module}
9f8e514
%{python2_sitelib}/%{module}-*.egg-info
9f8e514
%exclude %{python2_sitelib}/%{module}/tests
9f8e514
9f8e514
%files -n python2-%{library}-tests
9f8e514
%license LICENSE
9f8e514
%{python2_sitelib}/%{module}/tests
9f8e514
9f8e514
%files -n python-%{library}-doc
9f8e514
%license LICENSE
9f8e514
%doc build/sphinx/html README.rst
9f8e514
9f8e514
%if 0%{?with_python3}
9f8e514
%files -n python3-%{library}
9f8e514
%license LICENSE
9f8e514
%{python3_sitelib}/%{module}
9f8e514
%{python3_sitelib}/%{module}-*.egg-info
9f8e514
%exclude %{python3_sitelib}/%{module}/tests
9f8e514
9f8e514
%files -n python3-%{library}-tests
9f8e514
%license LICENSE
9f8e514
%{python3_sitelib}/%{module}/tests
9f8e514
%endif # with_python3
9f8e514
9f8e514
%changelog
c22eb48
* Mon May 15 2017 Lumír Balhar <lbalhar@redhat.com> - 0.5-4.20170523git1f38ac
c22eb48
- Move to the latest upstream commit
c22eb48
- Disable non-working tests
c22eb48
- Enable python3 subpackage
c22eb48
0572759
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5-3
0572759
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
0572759
9f8e514
* Thu Jan 12 2017 Alfredo Moralejo <amoralej@redhat.com> 0.5-2
9f8e514
- Some fixes applied to spec.
9f8e514
9f8e514
* Thu Jan 12 2017 Alfredo Moralejo <amoralej@redhat.com> 0.5-1
9f8e514
- Initial spec