%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_major 3.9 %global py_minor 16 %global python_major python%{py_major} %global pkgname cheroot %global meta_package python3-%{pkgname} %global python3_sitearch %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(0))") Name: %{python_major}-%{pkgname} Version: 8.2.1 Release: 2 Summary: Highly-optimized, pure-python HTTP server License: BSD URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/c/%{pkgname}/%{pkgname}-%{version}.tar.gz Patch0: python3-cheroot-8.2.1-skip-test.patch BuildArch: noarch BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} Requires: %{python_major}-jaraco.functools >= 3.0.0 Requires: %{python_major}-more-itertools >= 7.2.0 Requires: %{python_major}-six >= 1.13.0 %description Cheroot is the high performance, pure Python HTTP server used by CherryPy.Status The test suite currently relies on pytest. It's being run via Travis CI.Contribute Cheroot. %package -n %{meta_package} Summary: Meta-package for %{name} Requires: python3 >= %{py_major}.%{py_minor} Requires: %{name} = %{version}-%{release} Requires: python3-jaraco.functools >= 3.0.0 Requires: python3-more-itertools >= 7.2.0 Requires: python3-six >= 1.13.0 %description -n %{meta_package} This is a Meta-package for %{name} package. %prep %autosetup -n %{pkgname}-%{version} -p0 # Remove bundled egg-info rm -rf %{srcname}.egg-info # remove backports.functools_lru_cache from setup.cfg. it's a py2 dep sed -i '/backports.functools_lru_cache/d' setup.cfg # ssl test fail # https://github.com/cherrypy/cheroot/issues/173 sed -i '214i@pytest.mark.skip(reason="Skip test_tls_client_auth: https://github.com/cherrypy/cheroot/issues/195")' cheroot/test/test_ssl.py # testmon is not needed to tests to run successfully # the f31 version of testmon requires pytest < 4 # which is not in f31 sed -i 's/ --testmon//' pytest.ini sed -i 's/ -n auto//' pytest.ini sed -i '/pytest-testmon/d' setup.cfg %build export PATH=/opt/freeware/bin:$PATH %{python_major} setup.py build %install [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %{python_major} setup.py install --root %{buildroot} #renaming the files in bindir to avoid conflict with python-cheroot cd ${RPM_BUILD_ROOT}/%{_bindir} for file in *; do mv $file $file-3.9 ln -sf $file-3.9 $file done %check %if %{with dotests} #python3 -m venv python_venv #. ./python_venv/bin/activate #pip3 install pytest #pip3 install hypothesis #ulimit -d unlimited #ulimit -n unlimited #ulimit -m unlimited # ulimit -f unlimited #( python runtests.py -m 'full' -v || true ) #deactivate %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %license LICENSE.md %doc README.rst %{_bindir}/cheroot-%{py_major} %{python3_sitearch}/* %files -n %{meta_package} %defattr(-,root,system,-) %{_bindir}/cheroot %changelog * Mon Mar 13 2023 Raghu N Arava - 8.2.1-2 - cheroot for python3.9