File python-cssutils.spec of Package python-cssutils

#
# spec file for package python-cssutils
#
# Copyright (c) 2015 SUSE LINUX 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-cssutils
Version:        1.0
Release:        0
Url:            http://cthedot.de/cssutils/
Summary:        A CSS Cascading Style Sheets library for Python
License:        LGPL-3.0+
Group:          Development/Languages/Python
Source:         http://pypi.python.org/packages/source/c/cssutils/cssutils-%{version}.zip
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  python-devel
BuildRequires:  python-setuptools
BuildRequires:  unzip
Provides:       python-css-utils-doc = %{version}
Obsoletes:      python-css-utils-doc < %{version}
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%else
BuildArch:      noarch
%endif

%description
A Python package to parse and build CSS Cascading Style Sheets. DOM only, not any rendering facilities!

%prep
%setup -q -n cssutils-%{version}
sed -i "1d" src/cssutils/{parse,codec,sac,serialize,scripts/csscapture,_codec2,errorhandler,scripts/cssparse,_codec3,scripts/csscombine,tokenize2,__init__}.py # Fix non-executable scripts
sed -i "s/\r//" src/cssutils/{sac,scripts/csscombine,tokenize2}.py COPYING COPYING.LESSER examples/{website,minify,imports,cssencodings,style,testutil,codec}.py # Fix EOL encodings

%build
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}

%files
%defattr(-,root,root,-)
%doc COPYING COPYING.LESSER README.txt examples
%{_bindir}/css*
%{python_sitelib}/cssutils-%{version}-py*.egg-info/
%{python_sitelib}/cssutils/
%{python_sitelib}/encutils/

%changelog
openSUSE Build Service is sponsored by