File python-utidy.spec of Package python-utidy

#
# spec file for package python-utidy
#
# Copyright (c) 2013 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
License:        MIT
Summary:        Python wrapper for libtidy
Url:            http://utidylib.berlios.de/
Group:          Development/Libraries/Python
Source:         https://downloads.sourceforge.net/project/utidylib/utidylib/%{version}/uTidylib-%{version}.zip
BuildRequires:  epydoc
BuildRequires:  fdupes
BuildRequires:  libtidy-devel
BuildRequires:  python-ctypes
BuildRequires:  python-devel
BuildRequires:  unzip
Requires:       python-ctypes
BuildArch:      noarch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build


%{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
Requires:       %{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
install -d -m 755 %{buildroot}%{_defaultdocdir}/%{name}
mv %{buildroot}%{python_sitelib}/tidy/apidoc %{buildroot}%{_defaultdocdir}/%{name}
rm -rf %{buildroot}%{python_sitelib}/tidy/apidoc

# create hardlinks
%fdupes %{buildroot}

%files
%defattr(-,root,root)
%doc LICENSE README.path README.txt
%exclude %{_defaultdocdir}/%{name}/apidoc
%{python_sitelib}/tidy
%{python_sitelib}/uTidylib-%{version}-py%{py_ver}.egg-info

%files devel-doc
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}/apidoc

%changelog
openSUSE Build Service is sponsored by