# # spec file for package python-cssutils (Version 0.9.7a4) # # Copyright (c) 2010 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.7a4 Release: 1 Summary: Cascading Style Sheets (CSS) parser and library for Python # retreived from http://cssutils.googlecode.com/files/cssutils-0.9.7a4.zip Source: cssutils-%{version}.tar.bz2 Patch0: %{name}-copy.py.patch 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: dos2unix python-devel python-setuptools BuildRequires: dos2unix python-devel python-setuptools >= 0.6 unzip BuildRequires: python-sphinx 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} %patch0 find . -type f -print0 | xargs -0 dos2unix %build export CFLAGS="%{optflags}" python ./setup.py build ## HINT: ## python ./setup.py build_sphinx ## Broken: ## -> AttributeError: 'NoneType' object has no attribute 'startswith' ## If necessary, build the HTML documentation directly: export PYTHONPATH=./src/ sphinx-build -b html . docs/html %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) %{_defaultdocdir}/%{name}/*.txt %{_defaultdocdir}/%{name}/COPYING* %files doc %defattr(-,root,root) %dir %{_defaultdocdir}/%{name}/html %{_defaultdocdir}/%{name}/html/* %changelog