bec0353
%if 0%{?rhel} && 0%{?rhel} <= 6
bec0353
%{!?__python2:        %global __python2 /usr/bin/python2}
bec0353
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
bec0353
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
bec0353
%endif
bec0353
bec0353
%if 0%{?fedora}
482f214
%global with_python3 1
482f214
%endif
2f841ef
2f841ef
%global srcname Chameleon
2f841ef
2f841ef
Name:           python-chameleon
bec0353
Version:        2.16
bec0353
Release:        1%{?dist}
2f841ef
Summary:        XML-based template compiler
2f841ef
2f841ef
Group:          Development/Languages
2f841ef
License:        BSD
2f841ef
URL:            http://chameleon.repoze.org/
092a2ef
Source0:        http://pypi.python.org/packages/source/C/Chameleon/Chameleon-%{version}.tar.gz
2f841ef
2f841ef
BuildArch:      noarch
482f214
2f841ef
BuildRequires:  python2-devel
2f841ef
# For docs
482f214
BuildRequires:  python-sphinx
2f841ef
# For tests to run
482f214
BuildRequires:  python-setuptools
482f214
BuildRequires:  python-lxml
482f214
BuildRequires:  python-zope-interface
482f214
482f214
%if 0%{?with_python3}
482f214
BuildRequires:  python3-devel
482f214
BuildRequires:  python3-sphinx
482f214
BuildRequires:  python3-setuptools
482f214
BuildRequires:  python3-lxml
482f214
BuildRequires:  python3-zope-interface
482f214
%endif
2f841ef
817a375
%if 0%{?rhel} && 0%{?rhel} <= 6
482f214
BuildRequires:  python-unittest2
817a375
%endif
817a375
2f841ef
%if 0%{?rhel} && 0%{?rhel} < 6
482f214
BuildRequires:  python-elementtree
482f214
Requires:       python-elementtree
e126c79
BuildRequires:  python-ordereddict
e126c79
Requires:       python-ordereddict
2f841ef
%endif
2f841ef
2f841ef
Requires: python-setuptools
092a2ef
Requires: python-zope-interface
2f841ef
Requires: python-lxml
2f841ef
2f841ef
%description
2f841ef
Chameleon is an XML attribute language template compiler. It comes with
2f841ef
implementations for the Zope Page Templates (ZPT) and Genshi templating
2f841ef
languages.
2f841ef
2f841ef
The engine compiles templates into Python byte-code. This results in
2f841ef
performance which is on average 10-15 times better than implementations which
2f841ef
use run-time interpretation.
2f841ef
482f214
%if 0%{?with_python3}
482f214
%package -n python3-chameleon
482f214
Summary:        XML-based template compiler
482f214
Group:          Development/Languages
482f214
482f214
Requires:   python3-setuptools
482f214
Requires:   python3-zope-interface
482f214
Requires:   python3-lxml
482f214
482f214
%description -n python3-chameleon
482f214
Chameleon is an XML attribute language template compiler. It comes with
482f214
implementations for the Zope Page Templates (ZPT) and Genshi templating
482f214
languages.
482f214
482f214
The engine compiles templates into Python byte-code. This results in
482f214
performance which is on average 10-15 times better than implementations which
482f214
use run-time interpretation.
482f214
%endif
482f214
2f841ef
%prep
2f841ef
%setup -q -n %{srcname}-%{version}
2f841ef
482f214
%if 0%{?with_python3}
482f214
rm -rf %{py3dir}
482f214
cp -a . %{py3dir}
482f214
%endif
482f214
2f841ef
%build
482f214
%if 0%{?with_python3}
482f214
pushd %{py3dir}
482f214
%{__python3} setup.py build
482f214
popd
482f214
%endif
482f214
bec0353
%{__python2} setup.py build
2f841ef
2f841ef
PYTHONPATH=`pwd`/src make html
2f841ef
2f841ef
%install
482f214
%if 0%{?with_python3}
482f214
pushd %{py3dir}
482f214
%{__python3} setup.py install --skip-build --root=%{buildroot}
482f214
popd
482f214
%endif
482f214
bec0353
%{__python2} setup.py install --skip-build --root %{buildroot}
2f841ef
2f841ef
# No need to ship docs and tests as part of the module
bec0353
rm -rf %{buildroot}%{python2_sitelib}/chameleon/docs
bec0353
rm -rf  %{buildroot}%{python2_sitelib}/chameleon/tests
2f841ef
# Data files for the tests
bec0353
find %{buildroot}%{python2_sitelib}/chameleon -name '*.txt' -exec rm \{\} \;
2f841ef
2f841ef
# Clean up the documentation
2f841ef
mv _build/html .
2f841ef
rm -rf html/.buildinfo
2f841ef
092a2ef
%check
482f214
%if 0%{?with_python3}
482f214
pushd %{py3dir}
482f214
%{__python3} setup.py test
482f214
popd
482f214
%endif
2f841ef
bec0353
%{__python2} setup.py test
2f841ef
2f841ef
%files
092a2ef
%doc *.rst *.txt docs html
bec0353
%{python2_sitelib}/chameleon/
bec0353
%{python2_sitelib}/Chameleon-%{version}*
2f841ef
482f214
%if 0%{?with_python3}
482f214
%files -n python3-chameleon
482f214
%doc *.rst *.txt docs html
482f214
%{python3_sitelib}/chameleon/
482f214
%{python3_sitelib}/Chameleon-%{version}*
482f214
%endif
2f841ef
2f841ef
%changelog
bec0353
* Wed Aug 20 2014 Ralph Bean <rbean@redhat.com> - 2.16-1
bec0353
- Latest upstream.
bec0353
- Modernize python2 macros.
bec0353
adf34b1
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.15-3
adf34b1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
adf34b1
abfdf8a
* Wed May 14 2014 Bohuslav Kabrda <bkabrda@redhat.com> - 2.15-2
abfdf8a
- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4
abfdf8a
358501c
* Fri Apr 11 2014 Ralph Bean <rbean@redhat.com> - 2.15-1
358501c
- Latest upstream.
358501c
e126c79
* Fri Jan 17 2014 Ralph Bean <rbean@redhat.com> - 2.11-4
e126c79
- Add dependency on ordereddict for el6.
e126c79
8addafe
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-3
8addafe
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
8addafe
fab77fc
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.11-2
fab77fc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
fab77fc
482f214
* Wed Jan 16 2013 Ralph Bean <rbean@redhat.com> - 2.11-1
482f214
- Latest upstream version.
482f214
- More specific file/dir ownership.
482f214
- Removed unnecessary buildroot.
482f214
- Removed unnecessary defattr.
482f214
- Removed unnecessary clean section.
482f214
- Packaging a python3 subpackage.
482f214
efac29b
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-3
efac29b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
efac29b
8725d66
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.7.0-2
8725d66
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
8725d66
fcbbeeb
* Tue Dec 13 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.7.0-1
fcbbeeb
- New upstream release
fcbbeeb
817a375
* Thu Nov 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.3-1.1
817a375
- Fix to build on RHEL6
817a375
817a375
* Thu Nov 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.3-1
3402345
- New upstream release
3402345
cf5e237
* Mon Oct 3 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.5.1-1
cf5e237
- New upstream release
cf5e237
5daf04a
* Sun Aug 21 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3.8-1
5daf04a
- New upstream release
5daf04a
30263d6
* Thu Aug 18 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.3.6-1
30263d6
- New upstream release
30263d6
092a2ef
* Wed Aug 10 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.2-1
092a2ef
- New upstream release
092a2ef
092a2ef
* Fri Jul 15 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 2.0-1
092a2ef
- New upstream release
092a2ef
- This release removes the genshi-like syntax support -- F17+, only
092a2ef
145c2f7
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.12-5
145c2f7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
145c2f7
2f841ef
* Sat Sep 18 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-4
2f841ef
- Move COPYING file out of the ast directory and into docdir.
2f841ef
2f841ef
* Fri Sep 17 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-3
2f841ef
- Fix unittests on python-2.7.
2f841ef
2f841ef
* Thu Sep 16 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-2
2f841ef
- Add a patch so we can run with newer versions of the optional deps
2f841ef
2f841ef
* Wed Sep 15 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.2.12-1
2f841ef
- Initial package