[python-dtopt] Added python3 subpackage

Ralph Bean ☃ ralph at fedoraproject.org
Tue Feb 26 15:46:11 UTC 2013


commit 28a679ddc17191b5643a3fef2dfec82f87a007d2
Author: Ralph Bean <rbean at redhat.com>
Date:   Tue Feb 19 16:14:26 2013 -0500

    Added python3 subpackage

 python-dtopt.spec |   64 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 62 insertions(+), 2 deletions(-)
---
diff --git a/python-dtopt.spec b/python-dtopt.spec
index 4e0611f..000839e 100644
--- a/python-dtopt.spec
+++ b/python-dtopt.spec
@@ -1,9 +1,13 @@
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 
+%if 0%{?fedora} > 12
+%global with_python3 1
+%endif
+
 Name:           python-dtopt
 Summary:        Add options to doctest examples while they are running
 Version:        0.1
-Release:        11%{?dist}
+Release:        12%{?dist}
 License:        MIT
 Group:          System Environment/Libraries
 URL:            http://pypi.python.org/pypi/dtopt/
@@ -12,25 +16,71 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 BuildRequires:  python-setuptools-devel
 
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+BuildRequires:  python3-setuptools
+%endif
+
+
 %description
 dtopts adds options to doctest examples while they are running. When
 using the doctest module it is often convenient to use the ELLIPSIS
 option, which allows you to use ... as a wildcard. But you either have
 to setup the test runner to use this option, or you must put #doctest:
 +ELLIPSIS on every example that uses this feature. dtopt lets you enable
-this option globally from within a doctest, by doing: 
+this option globally from within a doctest, by doing:
 >>> from dtopt import ELLIPSIS
 
+%if 0%{?with_python3}
+%package -n python3-dtopt
+Summary:        Add options to doctest examples while they are running
+Version:        0.1
+
+%description -n python3-dtopt
+dtopts adds options to doctest examples while they are running. When
+using the doctest module it is often convenient to use the ELLIPSIS
+option, which allows you to use ... as a wildcard. But you either have
+to setup the test runner to use this option, or you must put #doctest:
++ELLIPSIS on every example that uses this feature. dtopt lets you enable
+this option globally from within a doctest, by doing:
+>>> from dtopt import ELLIPSIS
+%endif
+
 %prep
 %setup -q -n dtopt-%{version}
 
+# Remove bundled egg info if it exists.
+rm -rf *.egg-info
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+pushd %{py3dir}
+# There is a print statement in the test that is not python3 compatible.
+rm dtopt/tests.py*
+popd
+%endif
+
+
 %build
 %{__python} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
+
 %install
 %{__rm} -rf %{buildroot}
 %{__python} setup.py install --skip-build --root %{buildroot}
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install -O1 --skip-build --root %{buildroot}
+popd
+%endif
+
 %clean
 %{__rm} -rf %{buildroot}
 
@@ -40,7 +90,17 @@ this option globally from within a doctest, by doing:
 %{python_sitelib}/dtopt/
 %{python_sitelib}/dtopt*.egg-info/
 
+%if 0%{?with_python3}
+%files -n python3-dtopt
+%doc docs/*
+%{python3_sitelib}/dtopt/
+%{python3_sitelib}/dtopt*.egg-info/
+%endif
+
 %changelog
+* Tue Feb 19 2013 Ralph Bean <rbean at redhat.com> - 0.1-12
+- Added python3 subpackage.
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.1-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 


More information about the scm-commits mailing list