[pyxdg/f17] 0.23 & python3

Tom Callaway spot at fedoraproject.org
Mon Oct 8 15:54:17 UTC 2012


commit 768165c3a16b44b2bd9fd877330e5b7329cc5e98
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Mon Oct 8 11:55:09 2012 -0400

    0.23 & python3

 pyxdg.spec |   71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 sources    |    2 +-
 2 files changed, 67 insertions(+), 6 deletions(-)
---
diff --git a/pyxdg.spec b/pyxdg.spec
index 2134d4b..9cefb6b 100644
--- a/pyxdg.spec
+++ b/pyxdg.spec
@@ -1,8 +1,12 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%if 0%{?fedora} > 12
+%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:           pyxdg
-Version:        0.19
-Release:        4%{?dist}
+Version:        0.23
+Release:        1%{?dist}
 Summary:        Python library to access freedesktop.org standards
 Group:          Development/Libraries
 License:        LGPLv2
@@ -10,22 +14,65 @@ URL:            http://freedesktop.org/Software/pyxdg
 Source0:        http://www.freedesktop.org/~lanius/%{name}-%{version}.tar.gz
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
-
-BuildRequires:  python-devel
+BuildRequires:	python-nose
+BuildRequires:  python2-devel
+%if 0%{?with_python3}
+BuildRequires:  python3-devel
+%endif # if with_python3
 
 %description
 PyXDG is a python library to access freedesktop.org standards 
 
+%if 0%{?with_python3}
+%package -n python3-pyxdg
+Summary:	Python3 library to access freedesktop.org standards
+Group:		Development/Libraries
+
+%description -n python3-pyxdg
+PyXDG is a python library to access freedesktop.org standards. This
+package contains a Python 3 version of PyXDG.
+%endif # with_python3
+
 %prep
 %setup -q
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
+%endif # with_python3
+
+find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|'
+
 %build
 %{__python} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
 %install
 rm -rf $RPM_BUILD_ROOT 
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root=$RPM_BUILD_ROOT
+popd
+%endif # with_python3
+
 %{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT 
 
+%check
+nosetests
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+nosetests
+popd
+%endif # with_python3
+
 %clean
 rm -rf $RPM_BUILD_ROOT 
 
@@ -35,7 +82,21 @@ rm -rf $RPM_BUILD_ROOT
 %{python_sitelib}/xdg
 %{python_sitelib}/pyxdg-*.egg-info
 
+%if 0%{?with_python3}
+%files -n python3-pyxdg
+%doc AUTHORS COPYING ChangeLog README TODO
+%{python3_sitelib}/xdg
+%{python3_sitelib}/pyxdg-*.egg-info
+%endif #with_python3
+
 %changelog
+* Mon Oct  8 2012 Tom Callaway <spot at fedoraproject.org> - 0.23-1
+- update to 0.23
+- enable python3
+
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.19-5
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
 * Sat Jan 14 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.19-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
 
diff --git a/sources b/sources
index c324e52..818c2c5 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-9f33542e846d0fc1e0bfa992a8555b0a  pyxdg-0.19.tar.gz
+0710357dfb914ac22122566299cac61c  pyxdg-0.23.tar.gz


More information about the scm-commits mailing list