[python-simplemediawiki] Update to 1.2.0b2 and enable Python 3 building

Ian Weller ianweller at fedoraproject.org
Mon Aug 12 15:58:23 UTC 2013


commit ad1dd54832a4734b499915abae8b68676e83cb69
Author: Ian Weller <ian at ianweller.org>
Date:   Mon Aug 12 11:57:53 2013 -0400

    Update to 1.2.0b2 and enable Python 3 building

 python-simplemediawiki.spec |   80 +++++++++++++++++++++++++++++++++---------
 1 files changed, 63 insertions(+), 17 deletions(-)
---
diff --git a/python-simplemediawiki.spec b/python-simplemediawiki.spec
index ce94036..2989b68 100644
--- a/python-simplemediawiki.spec
+++ b/python-simplemediawiki.spec
@@ -1,23 +1,25 @@
-%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
-%endif
-
 %global tarball_name simplemediawiki
+%global full_version %{version}b2
+
+%if 0%{?fedora}
+%global with_python3 1
+%endif
 
 Name:           python-%{tarball_name}
-Version:        1.1.1
-Release:        4%{?dist}
+Version:        1.2.0
+Release:        0.1.b2%{?dist}
 Summary:        Extremely low-level wrapper to the MediaWiki API
 
-Group:          Development/Libraries
 License:        LGPLv2+
 URL:            https://github.com/ianweller/python-simplemediawiki
-Source0:        http://pypi.python.org/packages/source/s/%{tarball_name}/%{tarball_name}-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Source0:        http://pypi.python.org/packages/source/s/%{tarball_name}/%{tarball_name}-%{full_version}.tar.gz
 
 BuildArch:      noarch
-BuildRequires:  python-devel python-simplejson python-sphinx python-kitchen
-Requires:       python-simplejson python-kitchen
+BuildRequires:  python2-devel python-kitchen python-nose
+Requires:       python-kitchen python-sphinx
+%if 0%{?with_python3}
+BuildRequires:  python3-devel python3-nose python3-sphinx
+%endif
 
 %description
 The module simplemediawiki is an extremely low-level wrapper to the MediaWiki 
@@ -25,25 +27,69 @@ API. It automatically handles cookies and g zip compression so that you can
 make basic calls to the API in the easiest way possible. It also provides a 
 few functions to make day-to-day API access easier.
 
+%if 0%{?with_python3}
+%package -n python3-%{tarball_name}
+Summary:        Extremely low-level wrapper to the MediaWiki API
+
+%description -n python3-%{tarball_name}
+The module simplemediawiki is an extremely low-level wrapper to the MediaWiki
+API. It automatically handles cookies and g zip compression so that you can
+make basic calls to the API in the easiest way possible. It also provides a
+few functions to make day-to-day API access easier.
+
+This is the Python 3 version.
+%endif
+
 %prep
-%setup -qn %{tarball_name}-%{version}
+%setup -qn %{tarball_name}-%{full_version}
+
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+%endif
 
 %build
 %{__python} setup.py build build_sphinx
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build build_sphinx
+popd
+%endif
+
 %install
-rm -rf %{buildroot}
-%{__python} setup.py install -O1 --root=%{buildroot} --record=INSTALLED_FILES
+%{__python} setup.py install --skip-build --root %{buildroot}
 
-%clean
-rm -rf %{buildroot}
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
+
+%check
+%{__python} setup.py nosetests
+
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py nosetests
+popd
+%endif
 
 %files
-%defattr(-,root,root)
 %doc COPYING PKG-INFO README build/sphinx/html
 %{python_sitelib}/*
 
+%if 0%{?with_python3}
+%files -n python3-%{tarball_name}
+%doc COPYING PKG-INFO README build/sphinx/html
+%{python3_sitelib}/*
+%endif
+
 %changelog
+* Mon Aug 12 2013 Ian Weller <iweller at redhat.com> - 1.2.0-0.1.b2
+- Update to version 1.2.0b1
+- Add Python 3 support
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.1.1-4
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list