File python-elementtidy.spec of Package python-elementtidy
# vim: set sw=4 ts=4 et:
Name: python-elementtidy
Version: 1.0
%define pkg_version 1.0-20050212
Release: 0
Summary: Python module with a tidylib interface for ElementTree
# http://effbot.org/media/downloads/elementtidy-%{pkg_version}.zip
Source: elementtidy-%{pkg_version}.tar.bz2
# pbleser: make the build use the system-wide libtidy instead of the one it ships
Patch1: python-elementtidy-use_system_libtidy.patch
URL: http://effbot.org/zone/element-tidylib.htm
Group: Development/Libraries/Python
License: MIT/X
BuildRoot: %{_tmppath}/build-%{name}-%{version}
BuildRequires: libtidy-devel
BuildRequires: python python-devel
BuildRequires: gcc glibc-devel
%py_requires
%description
The TidyHTMLTreeBuilder parser can read (almost) arbitrary HTML files, and turn
them into well-formed element trees. This parser uses a library version of Dave
Raggett’s HTML Tidy utility to fix any problems with the HTML before converting
it to XHTML (the XML version of HTML).
%prep
%setup -q -n "elementtidy-%{pkg_version}"
%patch1
# make sure it doesn't use the in-tree libtidy:
%__rm -rf ./tidylib
# fix wrong EOL
%__sed -i 's/\r$//' README
%build
%__python ./setup.py build
%install
%__python ./setup.py install \
--prefix="%{_prefix}" \
--root="%{buildroot}" \
--record-rpm=files.lst
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files -f files.lst
%defattr(-,root,root)
%doc README