[python-tempita] Apply patch by kylev to create python3-tempita subpackage
Nick Bebout
nb at fedoraproject.org
Thu Aug 12 02:03:38 UTC 2010
commit f5268f9a73ff8d3f963a1e0b4f36e5165bf369ad
Author: Nick Bebout <nb at fedoraproject.org>
Date: Wed Aug 11 22:03:17 2010 -0400
Apply patch by kylev to create python3-tempita subpackage
python-tempita.spec | 57 +++++++++++++++++++++++++++++++++++++++++++++-
tempita-py3-compat.diff | 24 +++++++++++++++++++
2 files changed, 79 insertions(+), 2 deletions(-)
---
diff --git a/python-tempita.spec b/python-tempita.spec
index baaca31..ea38d9c 100644
--- a/python-tempita.spec
+++ b/python-tempita.spec
@@ -1,16 +1,19 @@
-%if 0%{?fedora} <= 12 || 0%{?rhel} <= 5
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif
Name: python-tempita
Version: 0.4
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: A very small text templating language
Group: Development/Languages
License: MIT
URL: http://pythonpaste.org/tempita/
Source0: http://pypi.python.org/packages/source/T/Tempita/Tempita-%{version}.tar.gz
+Patch0: tempita-py3-compat.diff
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
@@ -21,21 +24,62 @@ BuildRequires: python-setuptools
%endif
BuildRequires: python-nose
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%endif # if with_python3
+
%description
Tempita is a small templating language for text substitution.
+%if 0%{?with_python3}
+%package -n python3-tempita
+Summary: A very small text templating language
+Group: Development/Languages
+# Without one of these there's no aes implementation which means there's no way to
+# have encrypted cookies. This is a reduction in features over the python2 version.
+# Currently there's no working python3 port for either:
+# http://allmydata.org/trac/pycryptopp/ticket/35
+# http://lists.dlitz.net/pipermail/pycrypto/2010q2/000253.html
+#%if 0%{?fedora}
+#Requires: python3-pycryptopp
+#%else
+#Requires: python3-crypto
+#%endif
+
+%description -n python3-tempita
+Tempita is a small templating language for text substitution.
+%endif # with_python3
+
+
%prep
%setup -q -n Tempita-%{version}
+%patch0 -p1 -b .py3compat
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif # with_python3
%build
%{__python} setup.py build
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
+popd
+%endif # with_python3
%clean
%{__rm} -rf %{buildroot}
@@ -51,8 +95,17 @@ nosetests
%{python_sitelib}/tempita/
%{python_sitelib}/*.egg-info
+%if 0%{?with_python3}
+%files -n python3-tempita
+%defattr(-,root,root,-)
+%{python3_sitelib}/tempita/
+%{python3_sitelib}/*.egg-info
+%endif
%changelog
+* Tue Aug 3 2010 Kyle VanderBeek <kylev at kylev.com> - 0.4-5
+- Add python3-tempita subpackage.
+
* Thu Jul 22 2010 David Malcolm <dmalcolm at redhat.com> - 0.4-4
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
diff --git a/tempita-py3-compat.diff b/tempita-py3-compat.diff
new file mode 100644
index 0000000..806300b
--- /dev/null
+++ b/tempita-py3-compat.diff
@@ -0,0 +1,24 @@
+diff -r 21248eaca98c -r cfd954445f47 setup.py
+--- a/setup.py Tue Oct 27 23:52:47 2009 +0000
++++ b/setup.py Tue Aug 03 12:44:18 2010 -0700
+@@ -1,8 +1,12 @@
+-from setuptools import setup, find_packages
+-import sys, os
++from setuptools import setup
++import sys
+
+ version = '0.4'
+
++extra = {}
++if sys.version_info >= (3,):
++ extra['use_2to3'] = True
++
+ setup(name='Tempita',
+ version=version,
+ description="A very small text templating language",
+@@ -39,4 +43,5 @@
+ test_suite='nose.collector',
+ include_package_data=True,
+ zip_safe=True,
++ **extra
+ )
More information about the scm-commits
mailing list