%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 13 %global python_major python%{py_major} %global pkgname tornado %global pkgname_doc tornado-doc %global meta_package python3-%{pkgname} %global meta_package_doc python3-%{pkgname_doc} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") %global python3_sitearch64 %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") # Configure tests for gcc first, so default is GCC if installed on the machine # To force gcc : --define 'gcc_compiler=x' # To use XLC : --define 'gcc_compiler=0' %{!?gcc_compiler: %define gcc_compiler 1} %{!?default_bits: %define default_bits 64} Name: %{python_major}-%{pkgname} Version: 6.0.3 Release: 2 Summary: Scalable, non-blocking web server and tools License: ASL 2.0 URL: http://www.tornadoweb.org Source0: https://files.pythonhosted.org/packages/source/t/tornado/%{pkgname}-%{version}.tar.gz Group: Development/Librariesa Prefix: %{_prefix} BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description Tornado is an open source version of the scalable, non-blocking web server and tools. The framework is distinct from most mainstream web server frameworks (and certainly most Python frameworks) because it is non-blocking and reasonably fast. Because it is non-blocking and uses epoll, it can handle thousands of simultaneous standing connections, which means it is ideal for real-time web services. %if %{gcc_compiler} == 1 This version has been compiled with GCC. %else This version has been compiled with XLC. %endif %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} %description -n %{meta_package} This is a Meta-package for %{name} package %package -n %{python_major}-%{pkgname_doc} Summary: Examples for python-tornado Group: Documentation Provides: %{python_major}-%{pkgname-doc} = %{version}-%{release} BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description -n %{python_major}-%{pkgname_doc} Tornado is an open source version of the scalable, non-blocking web server and and tools. This package contains some example applications. %package -n %{meta_package_doc} Summary: Meta-package for %{python_major}-%{pkgname_doc} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{python_major}-%{pkgname_doc} = %{version}-%{release} %description -n %{meta_package_doc} This is a Meta-package for %{python_major}-%{pkgname_doc} package %prep %autosetup -n %{pkgname}-%{version} echo "dotests=%{dotests}" echo "default_bits=%{default_bits}" echo "gcc_compiler=%{gcc_compiler}" %build export PATH=/opt/freeware/bin:$PATH # Choose XLC or GCC %if %{gcc_compiler} == 1 export CC__="/opt/freeware/bin/gcc" export FLAG32="-maix32" export FLAG64="-maix64" echo "CC Version:" $CC__ --version %else export CC__="xlc_r" export FLAG32="-q32" export FLAG64="-q64" echo "CC Version:" $CC__ -qversion %endif type $CC__ export CC32=" ${CC__} ${FLAG32} -D_LARGE_FILES" export CC64=" ${CC__} ${FLAG64} -D_LARGE_FILES" %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root ${RPM_BUILD_ROOT} %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE README.rst PKG-INFO %{python3_sitearch64}/* %files -n %{meta_package} %defattr(-,root,system,-) %files -n %{python_major}-%{pkgname_doc} %doc demos %doc docs %doc LICENSE README.rst PKG-INFO %files -n %{meta_package_doc} %defattr(-,root,system,-) %changelog * Wed Feb 15 2023 Ranjit Ranjan - 6.0.3-2 - tornado build for python3.9 * Tue Dec 3 2019 Baanu Tumma - 6.0.3-1 - Updated to latest version, built using python3 * Wed Sep 20 2017 Ravi Hirekurabar - 4.5.1-1 - Updated to 4.5.1 * Mon May 22 2017 Michael Wilson - 4.4.2-1 - Update to version 4.4.2 * Fri Nov 21 2014 Gerard Visiedo - 4.0.2-1 - First version for AIX V6.1 and higher