%global __python3 /usr/bin/python3.11 %global python3_pkgversion 3.11 Name: python-mako Version: 1.1.4 Release: 9%{?dist} BuildArch: noarch # Mostly MIT, but _ast_util.py is Python licensed License: MIT and Python Summary: Mako template library for Python URL: http://www.makotemplates.org/ Source0: https://github.com/sqlalchemy/mako/archive/rel_%(echo %{version} | sed "s/\./_/g").tar.gz # patch for Python 3.11 compatibility to reduce exception message Patch: https://github.com/sqlalchemy/mako/commit/9b8da4b1e2bdc025b643f2061aa32bf7ae0c78a8.patch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-markupsafe %global _description\ Mako is a template library written in Python. It provides a familiar, non-XML\ syntax which compiles into Python modules for maximum performance. Mako's\ syntax and API borrows from the best ideas of many others, including Django\ templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded\ Python (i.e. Python Server Page) language, which refines the familiar ideas of\ componentized layout and inheritance to produce one of the most straightforward\ and flexible models available, while also maintaining close ties to Python\ calling and scoping semantics. %description %_description %package -n python%{python3_pkgversion}-mako Summary: %{summary} # Beaker is the preferred caching backend, but is not strictly necessary Recommends: python%{python3_pkgversion}-beaker Obsoletes: python2-mako < 1.1.0-3 Obsoletes: python-mako-doc < 1.1.4-6 %{?python_provide:%python_provide python%{python3_pkgversion}-mako} %description -n python%{python3_pkgversion}-mako %_description This package contains the mako module built for use with python3. %prep %autosetup -p1 -n mako-rel_%(echo %{version} | sed "s/\./_/g") # the package ends up installed as %%{version}.dev0 otherwise: sed -i '/tag_build = dev/d' setup.cfg %build %py3_build %install %py3_install mv %{buildroot}/%{_bindir}/mako-render %{buildroot}/%{_bindir}/mako-render-%{python3_version} ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render-3 ln -s ./mako-render-%{python3_version} %{buildroot}/%{_bindir}/mako-render %check pytest-%{python3_pkgversion} %files -n python%{python3_pkgversion}-mako %license LICENSE %doc CHANGES README.rst examples %{_bindir}/mako-render %{_bindir}/mako-render-3 %{_bindir}/mako-render-%{python3_version} %{python3_sitelib}/mako/ %{python3_sitelib}/Mako-*.egg-info/ %changelog