add python3 subpackage (#585036)

This commit is contained in:
Luke Macken 2010-05-06 17:26:04 +00:00
parent dd7c63737f
commit ba061ceeae

View File

@ -1,8 +1,10 @@
%global with_python3 1
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: python-mako Name: python-mako
Version: 0.3.2 Version: 0.3.2
Release: 1%{?dist} Release: 2%{?dist}
Summary: Mako template library for Python Summary: Mako template library for Python
Group: Development/Languages Group: Development/Languages
@ -14,6 +16,12 @@ BuildArch: noarch
BuildRequires: python-setuptools-devel python-nose BuildRequires: python-setuptools-devel python-nose
Requires: python-beaker Requires: python-beaker
%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: /usr/bin/2to3
%endif # if with_python3
%description %description
Mako is a template library written in Python. It provides a familiar, non-XML Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's syntax which compiles into Python modules for maximum performance. Mako's
@ -24,17 +32,51 @@ componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python and flexible models available, while also maintaining close ties to Python
calling and scoping semantics. calling and scoping semantics.
%if 0%{?with_python3}
%package -n python3-mako
Summary: Mako template library for Python 3
Group: Development/Languages
%description -n python3-mako
Mako is a template library written in Python. It provides a familiar, non-XML
syntax which compiles into Python modules for maximum performance. Mako's
syntax and API borrows from the best ideas of many others, including Django
templates, Cheetah, Myghty, and Genshi. Conceptually, Mako is an embedded
Python (i.e. Python Server Page) language, which refines the familiar ideas of
componentized layout and inheritance to produce one of the most straightforward
and flexible models available, while also maintaining close ties to Python
calling and scoping semantics.
%endif # with_python3
%prep %prep
%setup -q -n Mako-%{version} %setup -q -n Mako-%{version}
%if 0%{?with_python3}
rm -rf %{py3dir}
cp -a . %{py3dir}
2to3 --write --nobackups %{py3dir} %{py3dir}/scripts/mako-render
%endif # with_python3
%build %build
%{__python} setup.py build %{__python} setup.py build
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py build
popd
%endif # with_python3
%install %install
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%if 0%{?with_python3}
pushd %{py3dir}
%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
mv $RPM_BUILD_ROOT/%{_bindir}/mako-render $RPM_BUILD_ROOT/%{_bindir}/python3-mako-render
popd
%endif # with_python3
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
@ -52,8 +94,17 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/mako-render %{_bindir}/mako-render
%{python_sitelib}/* %{python_sitelib}/*
%if 0%{?with_python3}
%files -n python3-mako
%defattr(-,root,root,-)
%{_bindir}/python3-mako-render
%{python3_sitelib}/*
%endif
%changelog %changelog
* Tue May 4 2010 David Malcolm <dmalcolm@redhat.com> - 0.3.2-2
- add python3 subpackage
* Tue May 04 2010 Luke Macken <lmacken@redhat.com> - 0.3.2-1 * Tue May 04 2010 Luke Macken <lmacken@redhat.com> - 0.3.2-1
- Update to 0.3.2 - Update to 0.3.2
- Run the test suite in %%check - Run the test suite in %%check