%{!?dotests: %define dotests 1} %define name python3-cherrypy %define srcname CherryPy %define version 18.5.0 %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 && echo 1 || echo 0) %if %{is_python_64} %define python_sitelib64 %(python3 -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(1))") %endif Summary: Pythonic, object-oriented web development framework Name: %{name} Version: %{version} Release: %{release} Source0: http://download.cherrypy.org/%{srcname}-%{version}.tar.gz Url: http://www.cherrypy.org License: MIT Group: Development/Languages Prefix: %{_prefix} BuildRequires: python3 >= 3.7.3 BuildRequires: python3-devel >= 3.7.3 BuildRequires: python3-nose >= 1.3.7 #for running test cases BuildRequires: python3-jaraco.collections >= 3.0.0 Buildrequires: python3-zc.lockfile >= 2.0 BuildRequires: python3-cheroot >= 8.2.1 BuildRequires: python3-portend >= 2.6 BuildRequires: python3-pytest >= 5.3.1, python3-py >= 1.8.0, python3-pluggy >= 0.13.0 #To run test cases pip install pytest-flake8, pytest-black, pytest-cov, requests_toolbelt, path Requires: python3-cheroot >= 8.2.1 Requires: python3-jaraco.collections >= 3.0.0 Requires: python3-more-itertools >= 7.2.0 Requires: python3-portend >= 2.6 Requires: python3-zc.lockfile >= 2.0 BuildArch: noarch %description CherryPy allows developers to build web applications in much the same way they would build any other object-oriented Python program. This usually results in smaller source code developed in less time. %prep %setup -q -n %{srcname}-%{version} %build 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} #renaming the files in bindir to avoid conflict with python-cherrypy cd ${RPM_BUILD_ROOT}/%{_bindir} for file in ${RPM_BUILD_ROOT}/%{_bindir}/*; do mv $file $file-3 done ( cd ${RPM_BUILD_ROOT} mkdir -p usr/bin cd usr/bin ln -sf ../..%{_bindir}/* . ) %check if [ "%{dotests}" == 1 ] then (LANG=C.utf-8 python3 -m pytest || true) fi %clean [ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT} %files %defattr(-,root,system,-) %doc README.rst %doc cherrypy/tutorial %{_bindir}/cherryd* /usr/bin/cherryd* %{python_sitelib}/* %changelog * Wed Jan 22 2020 Baanu Tumma - 18.5.0-1 - Updated to 18.5.0, built using python3 * Fri Oct 06 2017 Ravi Hirekurabar - 10.2.0-1 - Updated to 10.2.0 * Fri Nov 21 2014 Gerard Visiedo - 3.6.0-1 - First version for AIX V6.1 and higher