%if 0%{?fedora} > 12
%global with_python3 1
%endif
%global pypiname trollius
Name: python-trollius
Version: 1.0.4
Release: 2%{?dist}
Summary: A port of the Tulip asyncio module to Python 2
Group: Development/Libraries
License: ASL 2.0
URL: http://bitbucket.org/enovance/trollius/overview
Source0: http://pypi.python.org/packages/source/t/%{pypiname}/%{pypiname}-%{version}.tar.gz
#md5=8186f3b1685f79a36c208363fab740f4
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-mock
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
%endif #python3
# see https://fedoraproject.org/wiki/Packaging:Python#Macros
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Requires: python-futures
# required for check
BuildRequires: python-tox
BuildRequires: python-futures
%if 0%{?rhel}==6
# things required just by python2.6 on RHEL
Requires: python-ordereddict
# required for check with python2.6
# TODO : python-argparse required by unittest2, until
# new unittest2 package with correct deps
# https://bugzilla.redhat.com/show_bug.cgi?id=1065824
BuildRequires: python-argparse
BuildRequires: python-unittest2
%endif
%description
Trollius is a portage of the Tulip project (asyncio module, PEP 3156)
on Python 2. Trollius works on Python 2.6-3.4. It has been tested on
Windows, Linux, Mac OS X, FreeBSD and OpenIndiana.
%if 0%{?with_python3}
%package -n python3-trollius
Summary: A port of the Tulip asyncio module
%description -n python3-trollius
Trollius is a portage of the Tulip project (asyncio module, PEP
3156). Trollius works on Python 2.6-3.4. It has been tested on
Windows, Linux, Mac OS X, FreeBSD and OpenIndiana.
%endif #python3
%prep
%setup -q -n %{pypiname}-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
%endif
%build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif
%{__python2} setup.py build
%install
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
popd
%endif
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
%check
%if 0%{?fedora}
%{__python2} setup.py test
%endif
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py test
popd
%endif
%files
%defattr(-,root,root,-)
%doc README
%{python2_sitelib}/trollius
%{python2_sitelib}/%{pypiname}-%{version}-py2.?.egg-info
%if 0%{?with_python3}
%files -n python3-trollius
%defattr(-,root,root,-)
%doc README
%dir %{python3_sitelib}/trollius
%{python3_sitelib}/trollius/*.py
%{python3_sitelib}/trollius/__pycache__
%{python3_sitelib}/%{pypiname}-%{version}-py3.?.egg-info
%endif
%changelog
* Mon Jun 15 2015 Ian Wienand <iwienand@redhat.com> - 1.0.4-2
- add python3 - rhbz#1230868
* Wed Jan 7 2015 Ian Wienand <iwienand@redhat.com> - 1.0.4-1
- update to 1.0.4
- add python-mock as build dependency for tests
* Fri Aug 15 2014 Ian Wienand <iwienand@redhat.com> - 1.0.1-1
- update to 1.0.1
* Mon Jul 7 2014 Ian Wienand <iwienand@redhat.com> - 0.4-1
- update to 0.4
- 0.3 changed module name to trollius for python3.4 compatability
(issue #8; see README)
* Wed Apr 16 2014 Ian Wienand <iwienand@redhat.com> - 0.2-2
- fix python-ordereddict dependency typo
* Mon Mar 24 2014 Ian Wienand <iwienand@fedora19> - 0.2-1
- update to 0.2
* Tue Mar 4 2014 <iwienand@redhat.com> - 0.1.5-3
- add python-futures as build-dep
- add __python2* macros; convert to them
* Thu Feb 20 2014 <iwienand@redhat.com> - 0.1.5-2
- change license to ASL 2.0
- add defattr (from rpmlint)
- add group tag (from rpmlint)
* Tue Feb 18 2014 <iwienand@redhat.com> - 0.1.5-1
- Initial release