File python-cssutils.spec of Package python-cssutils

#
# spec file for package python-cssutils (Version 0.9.8a1)
#
# Copyright (c) 2011 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/
#

# norootforbuild


Name:           python-cssutils
Version:        0.9.8a1
Release:        1
Summary:        Cascading Style Sheets (CSS) parser and library for Python
Source:         http://cssutils.googlecode.com/files/cssutils-%{version}.zip
Url:            http://cthedot.de/cssutils
Group:          Development/Libraries/Python
License:        LGPLv3+
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} >= 1120
BuildArch:      noarch
%endif
BuildRequires:  unzip
BuildRequires:  dos2unix python-devel python-setuptools >= 0.6
BuildRequires:  python-xml
# Needed for unittests:
BuildRequires:  python-chardet python-minimock
%py_requires
Recommends:     %{name}-doc >= %{version}

%description
A Python package to parse and build CSS Cascading Style Sheets.
Currently a DOM only, no rendering options.

%package doc
License:        LGPLv3+
Summary:        Documentation and examples for cssutils
Group:          Development/Libraries/Perl

%description doc
HTML and TeX documentation for cssutils as well as examples of how to use them.

%prep
%setup -q -n cssutils-%{version}
find . -type f -print0 | xargs -0 dos2unix
find . -type f -name \*.py -print0 | xargs -0 sed -i -e 's,/usr/bin/env python,/usr/bin/python,'

%build
export CFLAGS="%{optflags}"
python ./setup.py build

%install
python ./setup.py install \
   --prefix=%{_prefix} \
   --root=%{buildroot} \
   --record-rpm=%{name}.files

# Remove any remaining files from sphinx:
rm -rf docs/html/.doctrees
rm -rf docs/html/.buildinfo

mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
cp -av docs/html %{buildroot}%{_defaultdocdir}/%{name}
cp -av CHANGELOG.txt COPYING COPYING.LESSER README.txt %{buildroot}%{_defaultdocdir}/%{name}

%clean
rm -rf %{buildroot}

%files -f %{name}.files
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}
%doc %{_defaultdocdir}/%{name}/*.txt
%doc %{_defaultdocdir}/%{name}/COPYING*

%files doc
%defattr(-,root,root)
%dir %{_defaultdocdir}/%{name}/html
%doc %{_defaultdocdir}/%{name}/html

%changelog
openSUSE Build Service is sponsored by