%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} %define oname uTidylib %global tidyp_version %((readlink %{_libdir}/libtidyp.so || echo x-0.so.0) | sed 's|.*-\\([0-9.]*\\)\\.so.*|\\1|') Summary: Python wrapper for tidy, from the HTML tidy project Name: python-tidy Version: 0.2 Release: 8%{?dist} License: MIT Group: Development/Languages URL: http://utidylib.berlios.de/ Source0: http://download.berlios.de/utidylib/%{oname}-%{version}.zip # Upstream bug: # http://developer.berlios.de/bugs/?func=detailbug&bug_id=14691&group_id=1810 Patch0: python-tidy-0.2-64-bit-safe.patch Requires: python >= 2.5 libtidyp = %{tidyp_version} BuildRequires: python-devel >= 2.5 # For testing Patch1: python-tidy-0.2-testsuite.patch Patch2: python-tidy-0.2-libtidyp.patch BuildRequires: python-twisted-core libtidyp-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description Python wrapper (bindings) for tidylib, this allows you to tidy HTML files through a Pythonic interface. %prep %setup -q -n %{oname}-%{version} %patch0 -p1 %patch1 -p1 # Patch to use libtidyp, then insert version number %patch2 -p1 sed -i 's|@TIDYP_VERSION@|%{tidyp_version}|' tidy/lib.py %build %{__python} setup.py build %install %{__rm} -rf %{buildroot} %{__python} setup.py install -O1 --skip-build --root %{buildroot} %check PYTHONPATH=%{buildroot}%{python_sitelib} trial tidy %clean %{__rm} -rf %{buildroot} %files %defattr(-, root, root, -) %doc LICENSE README.txt %{python_sitelib}/* %changelog * Thu Jul 22 2010 David Malcolm - 0.2-8 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sun Jul 26 2009 Fedora Release Engineering - 0.2-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Thu Feb 26 2009 Fedora Release Engineering - 0.2-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Nov 29 2008 Ignacio Vazquez-Abrams - 0.2-5 - Rebuild for Python 2.6 * Sat Oct 18 2008 Terje Rosten - 0.2-4 - Not 64 bits clean, #467246, thanks to Jose Pedro Oliveira for report and patch. * Sun Feb 17 2008 Terje Rosten - 0.2-3 - Fix license (again) * Sun Feb 17 2008 Terje Rosten - 0.2-2 - Simplify %%files - Fix license, req and group * Sat Feb 16 2008 Terje Rosten - 0.2-1 - Initial build.