#
# spec file for package python-Cheetah3
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name:           python-Cheetah3
Version:        3.1.0
Release:        1.3
Summary:        Template engine and code generation tool
License:        MIT
Group:          Development/Languages/Python
URL:            http://cheetahtemplate.org/
Source:         https://files.pythonhosted.org/packages/source/C/Cheetah3/Cheetah3-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module setuptools}
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Conflicts:      python-Cheetah
Provides:       Cheetah3 = %{version}
%python_subpackages

%description
Cheetah3 is a template engine and code generation tool.

It can be used standalone or combined with other tools and frameworks. Web
development is its principle use, but Cheetah is flexible and can also be
used to generate C++ game code, Java, SQL, form emails and even Python code.

It is a fork of the original CheetahTemplate library.

%prep
%setup -q -n Cheetah3-%{version}

%build
%python_build

%install
%python_install
%fdupes %{buildroot}/%{_prefix}

for p in cheetah cheetah-analyze cheetah-compile
do
    %python_clone -a %{buildroot}%{_bindir}/$p
done

%post
%python_install_alternative cheetah cheetah-analyze cheetah-compile

%postun
%python_uninstall_alternative cheetah cheetah-analyze cheetah-compile

%files %{python_files}
%license LICENSE
%doc ANNOUNCE.rst README.rst BUGS
%python_alternative %{_bindir}/cheetah
%python_alternative %{_bindir}/cheetah-analyze
%python_alternative %{_bindir}/cheetah-compile
%{python_sitearch}/*

%changelog
* Fri Apr  6 2018 mpluskal@suse.com
- Update to version 3.1.0:
  * Fix Cheetah to work with PyPy.
  * Code cleanup: fix code style to satisfy flake8 linter.
  * Rename www directory to docs.
* Fri Dec 29 2017 mpluskal@suse.com
- Conflict with python-cheetah
* Thu Dec 28 2017 jengelh@inai.de
- Remove some filler wording from descriptions.
  The summary can do without repeating the software name.
- Avoid running fdupes over partition boundaries.
* Sun Dec 24 2017 mpluskal@suse.com
- Cleanup spec file
  * Run spec-cleaner
  * Remove text that does not belong to describtions
  * Install license
- Build only python3 version
* Thu Dec  7 2017 boris@steki.net
- initial packaging