File python-nose.spec of Package python-nose

#
# spec file for package python-nose
#
# 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/
#


%define modname nose

Name:           python-nose
Summary:        A unittest extension offering automatic test suite discovery
Version:        1.0.0
Release:        1
Url:            http://somethingaboutorange.com/mrl/projects/nose/
License:        GNU LGPL
Group:          Development/Libraries/Python
Source:         %{modname}-%{version}.tar.bz2
Requires:       python-setuptools
BuildRequires:  python-devel python-setuptools
%{py_requires}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
nose provides an alternate test discovery and running process for unittest, one
that is intended to mimic the behavior of py.test as much as is reasonably
possible without resorting to magic. By default, nose will run tests in files
or directories under the current working directory whose names include "test".

nose also supports doctest tests and may optionally provide a test coverage
report.

%prep
%setup -q -n %{modname}-%{version}
sed -i 's,man/man1,share/man/man1,' setup.py

%build
export CFLAGS="$RPM_OPT_FLAGS"
python setup.py build

%install
python setup.py install --prefix=%{_prefix} --root=$RPM_BUILD_ROOT --record-rpm=INSTALLED_FILES
sed -i 's,nosetests.1,nosetests.1.gz,' INSTALLED_FILES
# we need sphinx to build the complete docu
# until then, remove special directories from docu
rm -rf doc/{.static,.templates}
# fix wrong line encoding in example script
sed -i "s|||" examples/attrib_plugin.py

%clean
rm -rf %{buildroot}

%files -f INSTALLED_FILES
%defattr(-,root,root)
%doc doc examples AUTHORS CHANGELOG NEWS README.txt lgpl.txt

%changelog