95bab69
%if 0%{?fedora} > 12
95bab69
%global with_python3 1
95bab69
%endif
95bab69
4bafe4f
%global pypiname trollius
4bafe4f
Name:           python-trollius
172ead8
Version:        2.1
cea4aa4
Release:        5%{?dist}
4bafe4f
Summary:        A port of the Tulip asyncio module to Python 2
4bafe4f
4bafe4f
Group:          Development/Libraries
4bafe4f
License:        ASL 2.0
e768b78
URL:            https://github.com/haypo/trollius
172ead8
Source0:        https://files.pythonhosted.org/packages/source/t/%{pypiname}/%{pypiname}-%{version}.tar.gz
4bafe4f
4bafe4f
BuildArch:      noarch
4bafe4f
BuildRequires:  python2-devel
4bafe4f
BuildRequires:  python-setuptools
0b28c59
BuildRequires:  python-mock
95bab69
%if 0%{?with_python3}
95bab69
BuildRequires:  python3-devel
95bab69
BuildRequires:  python3-setuptools
95bab69
%endif #python3
4bafe4f
4bafe4f
# see https://fedoraproject.org/wiki/Packaging:Python#Macros
4bafe4f
%if 0%{?rhel} && 0%{?rhel} <= 6
4bafe4f
%{!?__python2: %global __python2 /usr/bin/python2}
4bafe4f
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
4bafe4f
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
4bafe4f
%endif
4bafe4f
4bafe4f
Requires:  python-futures
74c6672
Requires:  python-six
4bafe4f
4bafe4f
# required for check
e768b78
BuildRequires:  python-unittest2
4bafe4f
BuildRequires:  python-futures
4bafe4f
4bafe4f
%if 0%{?rhel}==6
4bafe4f
# things required just by python2.6 on RHEL
254513f
Requires:  python-ordereddict
4bafe4f
%endif
4bafe4f
4bafe4f
%description
4bafe4f
e768b78
Trollius provides infrastructure for writing single-threaded
e768b78
concurrent code using coroutines, multiplexing I/O access over sockets
e768b78
and other resources, running network clients and servers, and other
e768b78
related primitives.
e768b78
e768b78
Trollius is a portage of the asyncio project (PEP 3156) on Python
e768b78
2. Trollius works on Python 2.6-3.5. It has been tested on Windows,
e768b78
Linux, Mac OS X, FreeBSD and OpenIndiana.
4bafe4f
95bab69
%if 0%{?with_python3}
95bab69
%package -n python3-trollius
95bab69
Summary: A port of the Tulip asyncio module
95bab69
95bab69
%description -n python3-trollius
95bab69
e768b78
Trollius provides infrastructure for writing single-threaded
e768b78
concurrent code using coroutines, multiplexing I/O access over sockets
e768b78
and other resources, running network clients and servers, and other
e768b78
related primitives.
95bab69
e768b78
Trollius is a portage of the asyncio project (PEP 3156) on Python
e768b78
2. Trollius works on Python 2.6-3.5. It has been tested on Windows,
e768b78
Linux, Mac OS X, FreeBSD and OpenIndiana.
e768b78
%endif #python3
95bab69
95bab69
%prep
4bafe4f
%setup -q -n %{pypiname}-%{version}
4bafe4f
95bab69
%if 0%{?with_python3}
95bab69
rm -rf %{py3dir}
95bab69
cp -a . %{py3dir}
95bab69
%endif
95bab69
4bafe4f
%build
95bab69
95bab69
%if 0%{?with_python3}
95bab69
pushd %{py3dir}
95bab69
%{__python3} setup.py build
95bab69
popd
95bab69
%endif
95bab69
4bafe4f
%{__python2} setup.py build
4bafe4f
4bafe4f
%install
95bab69
%if 0%{?with_python3}
95bab69
pushd %{py3dir}
95bab69
%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
95bab69
popd
95bab69
%endif
95bab69
4bafe4f
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
4bafe4f
4bafe4f
%check
4bafe4f
ad02647
# these are currently causing koji builds to hang
ad02647
#python runtests.py -v1 -x test_subprocess_kill
ad02647
#%if 0%{?with_python3}
ad02647
#pushd %{py3dir}
ad02647
#%{__python3} runtests.py -v1 -x test_subprocess_kill
ad02647
#popd
ad02647
#%endif
95bab69
4bafe4f
%files
4bafe4f
%defattr(-,root,root,-)
e768b78
%doc README.rst
15427b8
%{python2_sitelib}/trollius
4bafe4f
%{python2_sitelib}/%{pypiname}-%{version}-py2.?.egg-info
4bafe4f
95bab69
%if 0%{?with_python3}
95bab69
%files -n python3-trollius
95bab69
%defattr(-,root,root,-)
e768b78
%doc README.rst
95bab69
%dir %{python3_sitelib}/trollius
95bab69
%{python3_sitelib}/trollius/*.py
95bab69
%{python3_sitelib}/trollius/__pycache__
95bab69
%{python3_sitelib}/%{pypiname}-%{version}-py3.?.egg-info
95bab69
%endif
4bafe4f
4bafe4f
%changelog
cea4aa4
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.1-5
cea4aa4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cea4aa4
74c6672
* Tue Feb  7 2017 Ian Wienand <iwienand@redhat.com> - 2.1-4
74c6672
- Add python-six dependency (rhbz#1402775)
74c6672
1786f54
* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 2.1-3
1786f54
- Rebuild for Python 3.6
1786f54
732605a
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1-2
732605a
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
732605a
172ead8
* Tue Jun 14 2016 Matthias Runge <mrunge@redhat.com> - 2.1-1
172ead8
- update to 2.1 (rhbz#1101234)
172ead8
989ebaa
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.0-3
989ebaa
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
989ebaa
e72077d
* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-2
e72077d
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5
e72077d
e768b78
* Tue Jul 14 2015 Ian Wienand <iwienand@redhat.com> - 2.0-1
e768b78
- update to 2.0 - rhbz#1101234
e768b78
4cb02ce
* Mon Jun 15 2015 Ian Wienand <iwienand@redhat.com> - 1.0.4-2
95bab69
- add python3 - rhbz#1230868
95bab69
0b28c59
* Wed Jan  7 2015 Ian Wienand <iwienand@redhat.com> - 1.0.4-1
0b28c59
- update to 1.0.4
0b28c59
- add python-mock as build dependency for tests
0b28c59
40dc38b
* Fri Aug 15 2014 Ian Wienand <iwienand@redhat.com> - 1.0.1-1
40dc38b
- update to 1.0.1
40dc38b
15427b8
* Mon Jul  7 2014 Ian Wienand <iwienand@redhat.com> - 0.4-1
15427b8
- update to 0.4
15427b8
- 0.3 changed module name to trollius for python3.4 compatability
15427b8
  (issue #8; see README)
15427b8
feae7d7
* Wed Apr 16 2014 Ian Wienand <iwienand@redhat.com> - 0.2-2
feae7d7
- fix python-ordereddict dependency typo
feae7d7
937c4e3
* Mon Mar 24 2014 Ian Wienand <iwienand@fedora19> - 0.2-1
937c4e3
- update to 0.2
937c4e3
4bafe4f
* Tue Mar  4 2014  <iwienand@redhat.com> - 0.1.5-3
4bafe4f
- add python-futures as build-dep
4bafe4f
- add __python2* macros; convert to them
4bafe4f
4bafe4f
* Thu Feb 20 2014  <iwienand@redhat.com> - 0.1.5-2
4bafe4f
- change license to ASL 2.0
4bafe4f
- add defattr (from rpmlint)
4bafe4f
- add group tag (from rpmlint)
4bafe4f
4bafe4f
* Tue Feb 18 2014  <iwienand@redhat.com> - 0.1.5-1
4bafe4f
- Initial release