%global module_name mwlib %{?filter_setup: %filter_provides_in %{python_sitearch}.*\.so$ %filter_setup } Name: python-%{module_name} Version: 0.13.5 Release: 1%{?dist} Summary: MediaWiki parser and utility library License: BSD URL: http://pediapress.com/code/ Source0: http://pypi.python.org/packages/source/m/mwlib/%{module_name}-%{version}.zip # Removes the following "requires" from setup.py for these reasons: # roman: part of python-docutils # timelib: replaced with dateutil Patch0: mwlib-clean-up-dependencies.patch # Unbundles apipkg Patch1: mwlib-unbundle-apipkg.patch # Replaces timelib with dateutil Patch2: mwlib-replace-timelib-with-dateutil.patch BuildRequires: python-devel BuildRequires: python-setuptools Requires: odfpy >= 0.9 Requires: pyPdf >= 1.12 Requires: pyparsing >= 1.4.11 Requires: python-apipkg Requires: python-bottle >= 0.10 Requires: python-dateutil Requires: python-docutils Requires: python-gevent Requires: python-lxml Requires: python-py >= 1.4 Requires: python-qserve >= 0.2.3 Requires: python-setuptools Requires: python-sqlite3dbm %description mwlib provides a library for parsing MediaWiki articles and converting them to different output formats. mwlib is used by Wikipedia's "Print/export" feature in order to generate PDF documents from Wikipedia articles. %prep %setup -qn %{module_name}-%{version} # Clean up dependencies %patch0 -p1 # Unbundle apipkg rm mwlib/apipkg.py %patch1 -p1 rm mwlib.egg-info/*.orig # Replace timelib with dateutil %patch2 -p1 sed -i '/^#!/d' mwlib/*.py mwlib/*/*.py mwlib/snippets.txt chmod a-x mwlib/*.py mwlib/*/*.py mwlib/snippets.txt %build CFLAGS="%{optflags}" %{__python} setup.py build %install %{__python} setup.py install -O1 --skip-build --root %{buildroot} mkdir -p %{buildroot}%{_datadir}/%{module_name} mv %{buildroot}%{_bindir}/*.py %{buildroot}%{_datadir}/%{module_name}/ rm %{buildroot}%{python_sitearch}/%{module_name}/templ/*.c %files %doc changelog.rst README.rst docs %{python_sitearch}/* %{_bindir}/mw-* %{_datadir}/%{module_name} %changelog * Mon Mar 05 2012 Ian Weller <iweller@redhat.com> - 0.13.5-1 - Update to 0.13.5 upstream * Wed Feb 15 2012 Ian Weller <iweller@redhat.com> - 0.13.4-1 - Update to 0.13.4 upstream - Update Requires: python-qserve >= 0.2.7 - Add Requires: python-simplejson - Rebase Patch0 (Clean up dependencies) - Rebase Patch1 (Unbundle apipkg) - Rename patches to not be version-specific - rm rm -rf buildroot * Mon Feb 13 2012 Ian Weller <iweller@redhat.com> - 0.13.3-4 - Requires: python-setuptools * Mon Feb 13 2012 Ian Weller <iweller@redhat.com> - 0.13.3-3 - BuildRequires: python-setuptools * Sat Feb 11 2012 Ian Weller <iweller@redhat.com> - 0.13.3-2 - Move off of py.apipkg into the separate module - Do a better job of unbundling apipkg completely - Fix provides filtering * Fri Jan 13 2012 Ian Weller <iweller@redhat.com> - 0.13.3-1 - Initial package build (again)