Blob Blame Raw
%if 0%{?fedora} || 0%{?rhel} >= 8
%global with_python3 1
%endif

%global srcname Chameleon

Name:           python-chameleon
Version:        3.6.1
Release:        1%{?dist}
Summary:        XML-based template compiler

License:        BSD
URL:            https://github.com/malthe/chameleon
Source0:        %pypi_source %{srcname}

BuildArch:      noarch

BuildRequires:  python2-devel
# For tests to run
BuildRequires:  python2-setuptools
BuildRequires:  python2-lxml
BuildRequires:  python2-zope-interface

%if 0%{?with_python3}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-lxml
BuildRequires:  python3-zope-interface
%endif

%if 0%{?rhel} && 0%{?rhel} <= 6
BuildRequires:  python-unittest2
%endif

%global _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.

%description %_description

%package -n python2-chameleon
Summary: %summary
Requires: python2-setuptools
Requires: python2-zope-interface
Requires: python2-lxml
%{?python_provide:%python_provide python2-chameleon}

%description -n python2-chameleon %_description

%if 0%{?with_python3}
%package -n python3-chameleon
Summary: %summary

Requires:   python3-setuptools
Requires:   python3-zope-interface
Requires:   python3-lxml
%{?python_provide:%python_provide python3-chameleon}

%description -n python3-chameleon %_description
%endif

%prep
%autosetup -n Chameleon-%{version}

%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif

%install
%py2_install
%if 0%{?with_python3}
%py3_install
%endif

# No need to ship tests as part of the module
rm -rf  %{buildroot}%{python2_sitelib}/chameleon/tests
# Data files for the tests
find %{buildroot}%{python2_sitelib}/chameleon -name '*.txt' -exec rm \{\} \;
%if 0%{?with_python3}
rm -rf  %{buildroot}%{python3_sitelib}/chameleon/tests
find %{buildroot}%{python3_sitelib}/chameleon -name '*.txt' -exec rm \{\} \;
%endif

%check
%{__python2} setup.py test
%if 0%{?with_python3}
%{__python3} setup.py test
%endif


%files -n python2-chameleon
%doc README.rst
%{python2_sitelib}/chameleon/
%{python2_sitelib}/Chameleon-%{version}*

%if 0%{?with_python3}
%files -n python3-chameleon
%doc README.rst
%{python3_sitelib}/chameleon/
%{python3_sitelib}/Chameleon-%{version}*
%endif

%changelog
* Tue Apr 09 2019 Miro Hrončok <mhroncok@redhat.com> - 3.6.1-1
- Update to 3.6.1 (#1678778)

* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Wed Jul 25 2018 Pierre-Yves Chibon <pingou@pingoured.fr> - 3.4-1
- Update to 3.4
- Modernize spec file a little
- Drop building the documentation as apparently upstream stopped shipping it in
  their tarball

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Sun Jun 17 2018 Miro Hrončok <mhroncok@redhat.com> - 3.2-4
- Rebuilt for Python 3.7

* Fri Mar 09 2018 Iryna Shcherbina <ishcherb@redhat.com> - 3.2-3
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Dec 18 2017 Kevin Fenzi <kevin@scrye.com> - 3.2-1
- Update to 3.2. Fixes bug #1504336

* Wed Aug 09 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.1-3
- Python 2 binary package renamed to python2-chameleon
  See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 25 2017 Kevin Fenzi <kevin@scrye.com> - 3.1-1
- Update to 3.1. Fixes bug #1425631

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Wed Dec 28 2016 Kevin Fenzi <kevin@scrye.com> - 3.0-1
- Update to 3.0. Fixes bug #1402375

* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 2.25-2
- Rebuild for Python 3.6

* Sun Sep 25 2016 Kevin Fenzi <kevin@scrye.com> - 2.25-1
- Update to 2.25. Fixes bug #1379057

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-4
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.24-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.24-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Wed Oct 28 2015 Ralph Bean <rbean@redhat.com> - 2.24-1
- new version

* Tue Oct 27 2015 Ralph Bean <rbean@redhat.com> - 2.23-1
- new version

* Wed Sep 16 2015 Ralph Bean <rbean@redhat.com> - 2.20-1
- new version

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.16-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Wed Aug 20 2014 Ralph Bean <rbean@redhat.com> - 2.16-1
- Latest upstream.
- Modernize python2 macros.

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.15-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.15-2
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4

* Fri Apr 11 2014 Ralph Bean <rbean@redhat.com> - 2.15-1
- Latest upstream.

* Fri Jan 17 2014 Ralph Bean <rbean@redhat.com> - 2.11-4
- Add dependency on ordereddict for el6.

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Wed Jan 16 2013 Ralph Bean <rbean@redhat.com> - 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 <rel-eng@lists.fedoraproject.org> - 2.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Dec 13 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.7.0-1
- New upstream release

* Thu Nov 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.3-1.1
- Fix to build on RHEL6

* Thu Nov 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.3-1
- New upstream release

* Mon Oct 3 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.1-1
- New upstream release

* Sun Aug 21 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3.8-1
- New upstream release

* Thu Aug 18 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3.6-1
- New upstream release

* Wed Aug 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.2-1
- New upstream release

* Fri Jul 15 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-1
- New upstream release
- This release removes the genshi-like syntax support -- F17+, only

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.12-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat Sep 18 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-4
- Move COPYING file out of the ast directory and into docdir.

* Fri Sep 17 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-3
- Fix unittests on python-2.7.

* Thu Sep 16 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-2
- Add a patch so we can run with newer versions of the optional deps

* Wed Sep 15 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-1
- Initial package