%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 %bcond_with python2 Name: python-cheetah Version: 3.2.3 Release: 2%{?dist} Summary: Template engine and code generator License: MIT URL: https://cheetahtemplate.org/ Source: https://github.com/CheetahTemplate3/cheetah3/archive/%{version}/%{name}-%{version}.tar.gz # Patch mangled to avoid the reject on news #Patch0: https://github.com/CheetahTemplate3/cheetah3/commit/d9241f802160abee31e9bfe892e85770812bea75.patch Patch0: d9241f802160abee31e9bfe892e85770812bea75.patch BuildRequires: gcc %global _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. %description %{_description} %if %{with python2} %package -n python2-cheetah Summary: %summary %{?python_provide:%python_provide python2-cheetah} BuildRequires: python2-devel BuildRequires: python2-setuptools # There is python2-markdown up to f30 %if 0%{?fedora} && 0%{?fedora} < 31 BuildRequires: python2-markdown %endif BuildRequires: python2-pygments %description -n python2-cheetah %_description %endif %package -n python%{python3_pkgversion}-cheetah Summary: %summary %{?python_provide:%python_provide python%{python3_pkgversion}-cheetah} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-markdown # BuildRequires: python%%{python3_pkgversion}-pygments %description -n python%{python3_pkgversion}-cheetah %_description %prep %autosetup -p1 -n cheetah3-%{version} # remove unnecessary shebang lines to silence rpmlint %{__sed} -i -e '/^#!/,1d' Cheetah/Tests/*.py \ Cheetah/CheetahWrapper.py Cheetah/DirectiveAnalyzer.py \ Cheetah/Filters.py Cheetah/NameMapper.py Cheetah/Servlet.py \ Cheetah/Templates/SkeletonPage.py Cheetah/Tools/SiteHierarchy.py \ Cheetah/Version.py %build %if %{with python2} %py2_build %endif %py3_build %install %if %{with python2} %py2_install EGG_INFO=(%{buildroot}/%{python2_sitearch}/Cheetah*.egg-info) cp -r $EGG_INFO ${EGG_INFO//Cheetah3/Cheetah} sed -i "s/Name: Cheetah3/Name: Cheetah/" ${EGG_INFO//Cheetah3/Cheetah}/PKG-INFO rm %{buildroot}%{_bindir}/* %endif %py3_install # %%check # export PATH="%%{buildroot}/%%{_bindir}:$PATH" # export PYTHONPATH="%%{buildroot}/%%{python3_sitearch}" # %%{buildroot}/%%{_bindir}/cheetah test %if %{with python2} %files -n python2-cheetah %license LICENSE %doc ANNOUNCE.rst README.rst TODO BUGS %{python2_sitearch}/Cheetah %{python2_sitearch}/Cheetah*.egg-info %endif %files -n python%{python3_pkgversion}-cheetah %license LICENSE %doc ANNOUNCE.rst README.rst TODO BUGS %{_bindir}/cheetah* %{python3_sitearch}/Cheetah %{python3_sitearch}/Cheetah*.egg-info %changelog