%define tarname Mako

Summary:	Mako template library for Python
Name:		python-mako
Version:	1.3.0
Release:	1%{dist}
Group:		Development/Python
License:	MIT
Url:		http://www.makotemplates.org/
Source0:	https://files.pythonhosted.org/packages/source/M/Mako/Mako-%{version}.tar.gz
BuildArch:	noarch
BuildRequires:	python%{python3_pkgversion}-markupsafe
BuildRequires:	python%{python3_pkgversion}-devel
BuildRequires:	python%{python3_pkgversion}-setuptools
Requires:	python%{python3_pkgversion}-markupsafe >= 0.9.2


%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 python%{python3_pkgversion}.


%prep
%autosetup -p1 -n Mako-%{version}
 
# 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



%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/

