File python-utidy.spec of Package python-utidy
#
# spec file for package python-utidy
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: python-utidy
Version: 0.2
Release: 0
Summary: Python wrapper for libtidy
License: MIT
Group: Development/Libraries/Python
Url: http://utidylib.berlios.de/
Source: https://downloads.sourceforge.net/project/utidylib/utidylib/%{version}/uTidylib-%{version}.zip
BuildRequires: epydoc
BuildRequires: fdupes
BuildRequires: libtidy-devel
BuildRequires: python-devel
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} && 0%{?suse_version} > 1110
BuildArch: noarch
%endif
%{py_requires}
%description
A Python wrapper for libtidy. This package supports processing HTML with Tidy,
with all the options that the tidy command line supports.
%package devel-doc
Summary: API docs for uTidylib
Group: Development/Libraries/Python
Recommends: %{name} = %{version}
%description devel-doc
The %{name}-devel-doc package contains the API documentation for developers.
%prep
%setup -q -n uTidylib-%{version}
%build
export CFLAGS="%{optflags}"
python setup.py build
python gendoc.py
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# move documentation files to datadir
rm -r apidoc
mv %{buildroot}%{python_sitelib}/tidy/apidoc ./
# create hardlinks
%fdupes %{buildroot}
%fdupes apidoc
%files
%defattr(-,root,root)
%doc LICENSE README.path README.txt
%{python_sitelib}/tidy
%{python_sitelib}/uTidylib-%{version}-py%{py_ver}.egg-info
%files devel-doc
%defattr(-,root,root)
%doc apidoc
%changelog