From b1309d714bb74a94119669c7583b9dbc2b459a34 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Mon, 8 Oct 2012 11:58:02 -0400 Subject: [PATCH] 0.23 & python3 --- .gitignore | 1 + pyxdg.spec | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++---- sources | 2 +- 3 files changed, 65 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index cef6a0b..1532554 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ pyxdg-0.19.tar.gz +/pyxdg-0.23.tar.gz diff --git a/pyxdg.spec b/pyxdg.spec index ae10d4d..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: 5%{?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,18 @@ 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 - 0.23-1 +- update to 0.23 +- enable python3 + * Sat Jul 21 2012 Fedora Release Engineering - 0.19-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_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