--- libtidy/python-tidy.spec 2010-08-06 13:58:54.000000000 +0100 +++ libtidyp/python-tidy.spec 2010-08-06 14:58:23.903331478 +0100 @@ -2,6 +2,8 @@ %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 @@ -13,11 +15,12 @@ # 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 libtidy >= 0.99.0 +Requires: python >= 2.5 libtidyp = %{tidyp_version} BuildRequires: python-devel >= 2.5 # For testing Patch1: python-tidy-0.2-testsuite.patch -BuildRequires: python-twisted-core libtidy >= 0.99.0 +Patch2: python-tidy-0.2-libtidyp.patch +BuildRequires: python-twisted-core libtidyp-devel BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -30,6 +33,10 @@ %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