%{!?dotests: %global dotests 1} %bcond_with docs %define name python3-cheroot %define srcname cheroot %define version 8.2.1 %define release 1 %define is_python %(test -e /usr/bin/python3_32 && echo 1 || echo 0) %if %{is_python} %define python_sitelib %(python3_32 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif %define _libdir64 %{_prefix}/lib64 %define is_python_64 %(test -e /usr/bin/python3_64 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3_64 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %endif Summary: Highly-optimized, pure-python HTTP server Name: %{name} Version: %{version} Release: %{release} Source0: %{srcname}-%{version}.tar.gz Patch0: python3-cheroot-8.2.1-skip-test.patch License: BSD Group: Development/Libraries Prefix: %{_prefix} BuildArch: noarch Url: https://github.com/cherrypy/cheroot #To run testcases, requests-unixsocket,pyOpenSSL are required. Install them using following command # python3 -m pip install requests-unixsocket pyOpenSSL BuildRequires: python3 >= 3.7.4-1, python3-devel >= 3.7.4-1 BuildRequires:python3-jaraco.functools >= 3.0.0-1 Requires: python3 >= 3.7.4-1, python3-jaraco.functools >= 3.0.0, python3-more-itertools >= 7.2.0, python3-six >= 1.13.0-1 %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. %prep %setup -n %{srcname}-%{version} %patch0 -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 OBJECT_MODE=64 python3 setup.py build %install [ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT python3 setup.py install --skip-build --root ${RPM_BUILD_ROOT} %if %{dotests} %check LANG=C.utf-8 python3 -m pytest --ignore=build || true %endif %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc LICENSE.md README.rst %{python_sitelib}/* %{_bindir}/* %changelog * Tue Jan 21 2020 Reshma V Kumar - 8.2.1-1 - Initial build for AIX Toolbox