[python-chameleon] Latest upstream and a python3 subpackage.

Ralph Bean ralph at fedoraproject.org
Thu Jan 17 03:44:08 UTC 2013


commit 482f21402ca8459dd2ff3f968cb9804f208e74e7
Author: Ralph Bean <rbean at redhat.com>
Date:   Wed Jan 16 22:43:17 2013 -0500

    Latest upstream and a python3 subpackage.

 .gitignore            |    1 +
 python-chameleon.spec |   97 ++++++++++++++++++++++++++++++++++++++++---------
 sources               |    2 +-
 3 files changed, 81 insertions(+), 19 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index fde8c91..1af13eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 /Chameleon-2.5.1.tar.gz
 /Chameleon-2.5.3.tar.gz
 /Chameleon-2.7.0.tar.gz
+/Chameleon-2.11.tar.gz
diff --git a/python-chameleon.spec b/python-chameleon.spec
index d0e978f..3f19d5f 100644
--- a/python-chameleon.spec
+++ b/python-chameleon.spec
@@ -1,41 +1,50 @@
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%if 0%{?fedora} > 1
+%global with_python3 1
+%endif
 
 %global srcname Chameleon
 
 Name:           python-chameleon
-Version:        2.7.0
-Release:        3%{?dist}
+Version:        2.11
+Release:        1%{?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-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
+
 BuildRequires:  python2-devel
 # For docs
-BuildRequires: python-sphinx
+BuildRequires:  python-sphinx
 # For tests to run
-BuildRequires: python-setuptools
-BuildRequires: python-lxml
-BuildRequires: python-zope-interface
+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
+BuildRequires:  python-unittest2
 %endif
 
 %if 0%{?rhel} && 0%{?rhel} < 6
-BuildRequires: python-elementtree
-Requires: python-elementtree
+BuildRequires:  python-elementtree
+Requires:       python-elementtree
 %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
@@ -45,16 +54,51 @@ 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
 %setup -q -n %{srcname}-%{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
+
 %{__python} setup.py build
 
 PYTHONPATH=`pwd`/src make html
 
 %install
-rm -rf %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root=%{buildroot}
+popd
+%endif
+
 %{__python} setup.py install --skip-build --root %{buildroot}
 
 # No need to ship docs and tests as part of the module
@@ -68,18 +112,35 @@ mv _build/html .
 rm -rf html/.buildinfo
 
 %check
-%{__python} setup.py test
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py test
+popd
+%endif
 
-%clean
-rm -rf %{buildroot}
+%{__python} setup.py test
 
 %files
-%defattr(-,root,root,-)
 %doc *.rst *.txt docs html
-%{python_sitelib}/*
+%{python_sitelib}/chameleon/
+%{python_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
+* Wed Jan 16 2013 Ralph Bean <rbean at 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 at lists.fedoraproject.org> - 2.7.0-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 
diff --git a/sources b/sources
index 45e3ebd..af646e7 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-17dbb6b260d4c0c11848379cd3c33817  Chameleon-2.7.0.tar.gz
+df72458bf3dd26a744dcff5ad555c34b  Chameleon-2.11.tar.gz


More information about the scm-commits mailing list