Blob Blame History Raw
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(plat_specific=True)")}

Name:           python-cheetah
Version:        2.0
Release:        0.2.rc7%{?dist}
Summary:        Template engine and code-generator

Group:          Development/Libraries
License:        MIT
URL:            http://cheetahtemplate.org/
Source:         http://download.sourceforge.net/cheetahtemplate/Cheetah-%{version}rc7.tar.gz

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  python-devel

Requires:       python-abi = %(%{__python} -c "import sys ; print sys.version[:3]")

%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 principle use, but
Cheetah is very flexible and is also being used to generate C++ game
code, Java, sql, form emails and even Python code.

%prep
%setup -q -n Cheetah-%{version}rc7

%build
export CFLAGS="$RPM_OPT_FLAGS"
%{__python} setup.py build

%install
rm -rf %{buildroot}
%{__python} setup.py install -O1 --root %{buildroot}

%check
export PATH="%{buildroot}/%{_bindir}:$PATH"
export PYTHONPATH="%{buildroot}/%{python_sitelib}"
%{__python} %{buildroot}/%{python_sitelib}/Cheetah/Tests/Test.py

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc CHANGES LICENSE README TODO

%{_bindir}/cheetah
%{_bindir}/cheetah-compile

%dir %{python_sitelib}/Cheetah
%{python_sitelib}/Cheetah/*.py
%{python_sitelib}/Cheetah/*.pyc
%{python_sitelib}/Cheetah/_namemapper.so
%{python_sitelib}/Cheetah/*.pyo

%dir %{python_sitelib}/Cheetah/Macros
%{python_sitelib}/Cheetah/Macros/*.py
%{python_sitelib}/Cheetah/Macros/*.pyc
%{python_sitelib}/Cheetah/Macros/*.pyo

%dir %{python_sitelib}/Cheetah/Templates
%{python_sitelib}/Cheetah/Templates/*.py
%{python_sitelib}/Cheetah/Templates/*.pyc
%{python_sitelib}/Cheetah/Templates/*.tmpl
%{python_sitelib}/Cheetah/Templates/*.pyo

%dir %{python_sitelib}/Cheetah/Tests
%{python_sitelib}/Cheetah/Tests/*.py
%{python_sitelib}/Cheetah/Tests/*.pyc
%{python_sitelib}/Cheetah/Tests/*.pyo

%dir %{python_sitelib}/Cheetah/Tools
%{python_sitelib}/Cheetah/Tools/*.py
%{python_sitelib}/Cheetah/Tools/*.pyc
%{python_sitelib}/Cheetah/Tools/*.txt
%{python_sitelib}/Cheetah/Tools/*.pyo

%dir %{python_sitelib}/Cheetah/Utils
%{python_sitelib}/Cheetah/Utils/*.py
%{python_sitelib}/Cheetah/Utils/*.pyc
%{python_sitelib}/Cheetah/Utils/*.pyo

%dir %{python_sitelib}/Cheetah/Utils/optik
%{python_sitelib}/Cheetah/Utils/optik/*.py
%{python_sitelib}/Cheetah/Utils/optik/*.pyc
%{python_sitelib}/Cheetah/Utils/optik/*.pyo

%changelog
* Mon Sep 11 2006 Mike Bonnet <mikeb@redhat.com> - 2.0-0.2.rc7
- un-%%ghost .pyo files

* Thu Jul 13 2006 Mike Bonnet <mikeb@redhat.com> - 2.0-0.1.rc7
- update to 2.0rc7
- change %%release format to conform to Extras packaging guidelines

* Sun May 21 2006 Mike Bonnet <mikeb@redhat.com> - 2.0-0.rc6.0
- update to 2.0rc6
- run the included test suite after install

* Thu Feb 16 2006 Mike Bonnet <mikeb@redhat.com> - 1.0-2
- Rebuild for Fedora Extras 5

* Wed Dec  7 2005 Mike Bonnet <mikeb@redhat.com> - 1.0-1
- Initial version