From 2f841ef3f493372f2ac6eb0ef5c9500281100166 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Sep 19 2010 19:36:55 +0000 Subject: Inital import --- diff --git a/.gitignore b/.gitignore index e69de29..7e62d5e 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/Chameleon-1.2.12.tar.gz diff --git a/python-chameleon-loosen-deps.patch b/python-chameleon-loosen-deps.patch new file mode 100644 index 0000000..b8d11d9 --- /dev/null +++ b/python-chameleon-loosen-deps.patch @@ -0,0 +1,16 @@ +diff -up Chameleon-1.2.12/setup.py.bak Chameleon-1.2.12/setup.py +--- Chameleon-1.2.12/setup.py.bak 2010-09-16 23:21:20.886604103 -0400 ++++ Chameleon-1.2.12/setup.py 2010-09-16 23:21:36.414606323 -0400 +@@ -45,9 +45,9 @@ setup(name="Chameleon", + 'i18nize' : [ "lxml", ], + }, + tests_require=install_requires + [ +- 'zope.interface==3.5.2', +- 'zope.component==3.7.1', +- 'zope.i18n==3.7.1', ++ 'zope.interface>=3.5.2', ++ 'zope.component>=3.7.1', ++ 'zope.i18n>=3.7.1', + 'lxml', + ], + test_suite="chameleon.tests", diff --git a/python-chameleon-py27.patch b/python-chameleon-py27.patch new file mode 100644 index 0000000..d98dee5 --- /dev/null +++ b/python-chameleon-py27.patch @@ -0,0 +1,26 @@ +Index: Chameleon-1.2.12/src/chameleon/genshi/language.txt +=================================================================== +--- Chameleon-1.2.12.orig/src/chameleon/genshi/language.txt ++++ Chameleon-1.2.12/src/chameleon/genshi/language.txt +@@ -599,7 +599,7 @@ validate + ... """, data=Markup("incorrect")) + Traceback (most recent call last): + ... +- ValidationError: Insertion of u'incorrect' is not allowed. ++ ParseError: mismatched tag: line 1, column 7266 + + >>> config.VALIDATION = False + +Index: Chameleon-1.2.12/src/chameleon/zpt/language.txt +=================================================================== +--- Chameleon-1.2.12.orig/src/chameleon/zpt/language.txt ++++ Chameleon-1.2.12/src/chameleon/zpt/language.txt +@@ -747,7 +747,7 @@ validate + ... """, data=Markup("incorrect")) + Traceback (most recent call last): + ... +- ValidationError: Insertion of u'incorrect' is not allowed. ++ ParseError: mismatched tag: line 1, column 7266 + + >>> config.VALIDATION = False + diff --git a/python-chameleon.spec b/python-chameleon.spec new file mode 100644 index 0000000..420d577 --- /dev/null +++ b/python-chameleon.spec @@ -0,0 +1,108 @@ +%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} + +%global srcname Chameleon + +Name: python-chameleon +Version: 1.2.12 +Release: 4%{?dist} +Summary: XML-based template compiler + +Group: Development/Languages +License: BSD +URL: http://chameleon.repoze.org/ +Source0: http://pypi.python.org/packages/source/C/Chameleon/Chameleon-1.2.12.tar.gz +# setup.py specifies specific versions but newer versions can work as well. +# Loosen those deps up so we can run with the system packages installed +Patch0: python-chameleon-loosen-deps.patch +# Python2.7 changes the Excpetions that are raised by elementtree +Patch1: python-chameleon-py27.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +BuildArch: noarch +BuildRequires: python2-devel +# For docs +BuildRequires: python-sphinx +# For tests to run +BuildRequires: python-setuptools +BuildRequires: python-lxml +BuildRequires: python-zope-interface +# These are reviewed but not yet in the Buildroot to build against +#BuildRequires: python-zope-i18n +#BuildRequires: python-zope-component + +%if 0%{?rhel} && 0%{?rhel} < 6 +BuildRequires: python-elementtree +Requires: python-elementtree +%endif + +Requires: python-setuptools +Requires: python-lxml +# These are optional dependencies. Will add them once they're reviewed and in Fedora +#Requires: python-zope-i18n +#Requires: python-zope-component + + +%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. + +%prep +%setup -q -n %{srcname}-%{version} +%patch0 -p1 +%if 0%{?fedora} >= 14 +# Elementree behaviour only changed in python-2.7 +%patch1 -p1 +%endif + +%build +%{__python} setup.py build + +PYTHONPATH=`pwd`/src make html + +%install +rm -rf %{buildroot} +%{__python} setup.py install --skip-build --root %{buildroot} + +# No need to ship docs and tests as part of the module +rm -rf %{buildroot}%{python_sitelib}/chameleon/docs +rm -rf %{buildroot}%{python_sitelib}/chameleon/tests +# Data files for the tests +find %{buildroot}%{python_sitelib}/chameleon -name '*.txt' -exec rm \{\} \; + +# Clean up the documentation +mv _build/html . +rm -rf html/.buildinfo + +mv %{buildroot}%{python_sitelib}/chameleon/ast/COPYING COPYING.ast + +%clean +rm -rf %{buildroot} + +# We can enable these when the BuildRequires are satisfied +#check +#{__python} setup.py test + +%files +%defattr(-,root,root,-) +%doc *.rst *.txt html COPYING.ast +%{_bindir}/* +%{python_sitelib}/* + + +%changelog +* 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 diff --git a/sources b/sources index e69de29..46819b9 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +eeef119cc646698562a0dfed13e33285 Chameleon-1.2.12.tar.gz