New Python 2 conditionals, remove Python 3 conditionals
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
This commit is contained in:
parent
ff409a5a03
commit
8c53cb110b
@ -1,12 +1,15 @@
|
|||||||
%if 0%{?fedora} || 0%{?rhel} > 7
|
# python2 is not available on RHEL > 7
|
||||||
%global with_python3 1
|
%if 0%{?rhel} > 7
|
||||||
|
%bcond_with python2
|
||||||
|
%else
|
||||||
|
%bcond_without python2
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%global srcname tornado
|
%global srcname tornado
|
||||||
|
|
||||||
Name: python-%{srcname}
|
Name: python-%{srcname}
|
||||||
Version: 4.5.2
|
Version: 4.5.2
|
||||||
Release: 4%{?dist}
|
Release: 5%{?dist}
|
||||||
Summary: Scalable, non-blocking web server and tools
|
Summary: Scalable, non-blocking web server and tools
|
||||||
|
|
||||||
Group: Development/Libraries
|
Group: Development/Libraries
|
||||||
@ -17,13 +20,14 @@ Source0: https://files.pythonhosted.org/packages/source/t/tornado/tornado
|
|||||||
Patch0: python-tornado-cert.patch
|
Patch0: python-tornado-cert.patch
|
||||||
|
|
||||||
BuildRequires: gcc
|
BuildRequires: gcc
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
BuildRequires: python2-devel
|
BuildRequires: python2-devel
|
||||||
BuildRequires: python2-backports_abc
|
BuildRequires: python2-backports_abc
|
||||||
BuildRequires: python2-singledispatch
|
BuildRequires: python2-singledispatch
|
||||||
%if 0%{?with_python3}
|
%endif # with python2
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
%endif
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Tornado is an open source version of the scalable, non-blocking web
|
Tornado is an open source version of the scalable, non-blocking web
|
||||||
@ -35,6 +39,7 @@ reasonably fast. Because it is non-blocking and uses epoll, it can
|
|||||||
handle thousands of simultaneous standing connections, which means it is
|
handle thousands of simultaneous standing connections, which means it is
|
||||||
ideal for real-time web services.
|
ideal for real-time web services.
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%package -n python2-%{srcname}
|
%package -n python2-%{srcname}
|
||||||
Summary: Scalable, non-blocking web server and tools
|
Summary: Scalable, non-blocking web server and tools
|
||||||
%{?python_provide:%python_provide python2-%{srcname}}
|
%{?python_provide:%python_provide python2-%{srcname}}
|
||||||
@ -52,6 +57,7 @@ The framework is distinct from most mainstream web server frameworks
|
|||||||
reasonably fast. Because it is non-blocking and uses epoll, it can
|
reasonably fast. Because it is non-blocking and uses epoll, it can
|
||||||
handle thousands of simultaneous standing connections, which means it is
|
handle thousands of simultaneous standing connections, which means it is
|
||||||
ideal for real-time web services.
|
ideal for real-time web services.
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%package doc
|
%package doc
|
||||||
Summary: Examples for python-tornado
|
Summary: Examples for python-tornado
|
||||||
@ -63,7 +69,6 @@ Provides: python%{python3_pkgversion}-%{srcname}-doc = %{version}-%{releas
|
|||||||
Tornado is an open source version of the scalable, non-blocking web
|
Tornado is an open source version of the scalable, non-blocking web
|
||||||
server and and tools. This package contains some example applications.
|
server and and tools. This package contains some example applications.
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
|
||||||
%package -n python%{python3_pkgversion}-%{srcname}
|
%package -n python%{python3_pkgversion}-%{srcname}
|
||||||
Summary: Scalable, non-blocking web server and tools
|
Summary: Scalable, non-blocking web server and tools
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
|
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
|
||||||
@ -78,7 +83,6 @@ The framework is distinct from most mainstream web server frameworks
|
|||||||
reasonably fast. Because it is non-blocking and uses epoll, it can
|
reasonably fast. Because it is non-blocking and uses epoll, it can
|
||||||
handle thousands of simultaneous standing connections, which means it is
|
handle thousands of simultaneous standing connections, which means it is
|
||||||
ideal for real-time web services.
|
ideal for real-time web services.
|
||||||
%endif # with_python3
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{srcname}-%{version}
|
%setup -q -n %{srcname}-%{version}
|
||||||
@ -87,43 +91,39 @@ ideal for real-time web services.
|
|||||||
%{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py
|
%{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%if 0%{?with_python3}
|
|
||||||
%py3_build
|
%py3_build
|
||||||
%endif # with_python3
|
%{?with_python2:%py2_build}
|
||||||
%py2_build
|
|
||||||
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if 0%{?with_python3}
|
|
||||||
%py3_install
|
%py3_install
|
||||||
%endif # with_python3
|
%{?with_python2:%py2_install}
|
||||||
%py2_install
|
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if 0%{?with_python3}
|
|
||||||
%{__python3} -m tornado.test.runtests --verbose
|
%{__python3} -m tornado.test.runtests --verbose
|
||||||
%endif # with_python3
|
%{?with_python2:%{__python2} -m tornado.test.runtests --verbose}
|
||||||
%{__python2} -m tornado.test.runtests --verbose
|
|
||||||
|
|
||||||
|
|
||||||
|
%if %{with python2}
|
||||||
%files -n python2-%{srcname}
|
%files -n python2-%{srcname}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python2_sitearch}/%{srcname}/
|
%{python2_sitearch}/%{srcname}/
|
||||||
%{python2_sitearch}/%{srcname}-%{version}-*.egg-info
|
%{python2_sitearch}/%{srcname}-%{version}-*.egg-info
|
||||||
|
%endif # with python2
|
||||||
|
|
||||||
%files doc
|
%files doc
|
||||||
%doc demos
|
%doc demos
|
||||||
|
|
||||||
%if 0%{?with_python3}
|
|
||||||
%files -n python%{python3_pkgversion}-%{srcname}
|
%files -n python%{python3_pkgversion}-%{srcname}
|
||||||
%doc README.rst
|
%doc README.rst
|
||||||
%{python3_sitearch}/%{srcname}/
|
%{python3_sitearch}/%{srcname}/
|
||||||
%{python3_sitearch}/%{srcname}-%{version}-*.egg-info
|
%{python3_sitearch}/%{srcname}-%{version}-*.egg-info
|
||||||
%endif
|
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 26 2018 Lumír Balhar <lbalhar@redhat.com> - 4.5.2-5
|
||||||
|
- New conditionals for Python 2
|
||||||
|
- Drop Python 3 conditional
|
||||||
|
|
||||||
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.5.2-4
|
* Mon Feb 12 2018 Iryna Shcherbina <ishcherb@redhat.com> - 4.5.2-4
|
||||||
- Update Python 2 dependency declarations to new packaging standards
|
- Update Python 2 dependency declarations to new packaging standards
|
||||||
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
|
(See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
|
||||||
|
Loading…
Reference in New Issue
Block a user