%bcond_with dotests %global __tar /opt/freeware/bin/tar %global py_minor 16 %global py_major 3.9 %global python_major python%{py_major} %global pkgname cheetah3 %global meta_package python3-%{pkgname} %global python3_sitearch64 %(%{python_major} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") Name: %{python_major}-%{pkgname} Version: 3.2.4 Release: 2 Summary: Template engine and code generator License: MIT URL: https://pypi.python.org/pypi/%{pkgname} Source0: https://files.pythonhosted.org/packages/source/c/%{pkgname}/Cheetah3-3.2.4.tar.gz BuildArch: ppc BuildRequires: %{python_major}-devel >= %{py_major}.%{py_minor} BuildRequires: %{python_major}-setuptools >= 65.2.0 Requires: %{python_major} >= %{py_major}.%{py_minor} %description Cheetah is an open source template engine and code generation tool, written in Python. It can be used standalone or combined with other tools and frameworks. Web development is its principal use, but Cheetah is very flexible and is also being used to generate C++ code, Java, SQL, form emails and even Python code. %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. %prep %autosetup -n Cheetah3-%{version} %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-cheetah cd ${RPM_BUILD_ROOT}/%{_bindir} for file in *; do mv $file $file-3.9 ln -sf $file-3.9 $file-3 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 %doc README.rst PKG-INFO TODO %{_bindir}/*3.9 %{python3_sitearch64}/* %files -n %{meta_package} %defattr(-,root,system,-) %{_bindir}/* %exclude %{_bindir}/*3.9 %changelog * Wed Jan 11 2023 Sangeetha Bandi - 3.2.4-2 - cheetah3 for python3.9 * Tue Jan 21 2020 Reshma V Kumar - 3.2.4-1 - Update to latest version - Build with python3 * Thu May 11 2016 Ravi Hirekurabar - 2.4.4-1 - Initial Port.