%if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")} %endif %if 0%{?fedora} %global with_python3 1 %endif %global srcname Chameleon Name: python-chameleon Version: 3.1 Release: 2%{?dist} Summary: XML-based template compiler Group: Development/Languages License: BSD URL: https://github.com/malthe/chameleon Source0: https://github.com/malthe/chameleon/archive/%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel # For docs BuildRequires: python-sphinx # For tests to run BuildRequires: python-setuptools BuildRequires: python-lxml BuildRequires: python-zope-interface %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3-sphinx BuildRequires: python3-setuptools BuildRequires: python3-lxml BuildRequires: python3-zope-interface %endif %if 0%{?rhel} && 0%{?rhel} <= 6 BuildRequires: python-unittest2 %endif %if 0%{?rhel} && 0%{?rhel} < 6 BuildRequires: python-elementtree Requires: python-elementtree BuildRequires: python-ordereddict Requires: python-ordereddict %endif Requires: python-setuptools Requires: python-zope-interface Requires: python-lxml %description Chameleon is an XML attribute language template compiler. It comes with implementations for the Zope Page Templates (ZPT) and Genshi templating languages. The engine compiles templates into Python byte-code. This results in performance which is on average 10-15 times better than implementations which use run-time interpretation. %if 0%{?with_python3} %package -n python3-chameleon Summary: XML-based template compiler Group: Development/Languages Requires: python3-setuptools Requires: python3-zope-interface Requires: python3-lxml %description -n python3-chameleon Chameleon is an XML attribute language template compiler. It comes with implementations for the Zope Page Templates (ZPT) and Genshi templating languages. The engine compiles templates into Python byte-code. This results in performance which is on average 10-15 times better than implementations which use run-time interpretation. %endif %prep %autosetup -n chameleon-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %{__python2} setup.py build PYTHONPATH=`pwd`/src make html %install %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install --skip-build --root=%{buildroot} popd %endif %{__python2} setup.py install --skip-build --root %{buildroot} # No need to ship docs and tests as part of the module rm -rf %{buildroot}%{python2_sitelib}/chameleon/docs rm -rf %{buildroot}%{python2_sitelib}/chameleon/tests # Data files for the tests find %{buildroot}%{python2_sitelib}/chameleon -name '*.txt' -exec rm \{\} \; # Clean up the documentation mv _build/html . rm -rf html/.buildinfo %check %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py test popd %endif %{__python2} setup.py test %files %doc *.rst *.txt docs html %{python2_sitelib}/chameleon/ %{python2_sitelib}/Chameleon-%{version}* %if 0%{?with_python3} %files -n python3-chameleon %doc *.rst *.txt docs html %{python3_sitelib}/chameleon/ %{python3_sitelib}/Chameleon-%{version}* %endif %changelog * Thu Jul 27 2017 Fedora Release Engineering - 3.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Feb 25 2017 Kevin Fenzi - 3.1-1 - Update to 3.1. Fixes bug #1425631 * Sat Feb 11 2017 Fedora Release Engineering - 3.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Wed Dec 28 2016 Kevin Fenzi - 3.0-1 - Update to 3.0. Fixes bug #1402375 * Mon Dec 19 2016 Miro HronĨok - 2.25-2 - Rebuild for Python 3.6 * Sun Sep 25 2016 Kevin Fenzi - 2.25-1 - Update to 2.25. Fixes bug #1379057 * Tue Jul 19 2016 Fedora Release Engineering - 2.24-4 - https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages * Thu Feb 04 2016 Fedora Release Engineering - 2.24-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Tue Nov 10 2015 Fedora Release Engineering - 2.24-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 * Wed Oct 28 2015 Ralph Bean - 2.24-1 - new version * Tue Oct 27 2015 Ralph Bean - 2.23-1 - new version * Wed Sep 16 2015 Ralph Bean - 2.20-1 - new version * Thu Jun 18 2015 Fedora Release Engineering - 2.16-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild * Wed Aug 20 2014 Ralph Bean - 2.16-1 - Latest upstream. - Modernize python2 macros. * Sat Jun 07 2014 Fedora Release Engineering - 2.15-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild * Wed May 14 2014 Bohuslav Kabrda - 2.15-2 - Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 * Fri Apr 11 2014 Ralph Bean - 2.15-1 - Latest upstream. * Fri Jan 17 2014 Ralph Bean - 2.11-4 - Add dependency on ordereddict for el6. * Sun Aug 04 2013 Fedora Release Engineering - 2.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Thu Feb 14 2013 Fedora Release Engineering - 2.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Jan 16 2013 Ralph Bean - 2.11-1 - Latest upstream version. - More specific file/dir ownership. - Removed unnecessary buildroot. - Removed unnecessary defattr. - Removed unnecessary clean section. - Packaging a python3 subpackage. * Sat Jul 21 2012 Fedora Release Engineering - 2.7.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Sat Jan 14 2012 Fedora Release Engineering - 2.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Tue Dec 13 2011 Toshio Kuratomi - 2.7.0-1 - New upstream release * Thu Nov 10 2011 Toshio Kuratomi - 2.5.3-1.1 - Fix to build on RHEL6 * Thu Nov 10 2011 Toshio Kuratomi - 2.5.3-1 - New upstream release * Mon Oct 3 2011 Toshio Kuratomi - 2.5.1-1 - New upstream release * Sun Aug 21 2011 Toshio Kuratomi - 2.3.8-1 - New upstream release * Thu Aug 18 2011 Toshio Kuratomi - 2.3.6-1 - New upstream release * Wed Aug 10 2011 Toshio Kuratomi - 2.2-1 - New upstream release * Fri Jul 15 2011 Toshio Kuratomi - 2.0-1 - New upstream release - This release removes the genshi-like syntax support -- F17+, only * Tue Feb 08 2011 Fedora Release Engineering - 1.2.12-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Sat Sep 18 2010 Toshio Kuratomi - 1.2.12-4 - Move COPYING file out of the ast directory and into docdir. * Fri Sep 17 2010 Toshio Kuratomi - 1.2.12-3 - Fix unittests on python-2.7. * Thu Sep 16 2010 Toshio Kuratomi - 1.2.12-2 - Add a patch so we can run with newer versions of the optional deps * Wed Sep 15 2010 Toshio Kuratomi - 1.2.12-1 - Initial package