File python-deap.spec of Package python-deap

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


%define modname deap
Name:           python-%{modname}
Version:        0.9.1
Release:        0
Summary:        A distributed evolutionary algorithm library in the Python language
License:        GPL-3.0
Group:          Development/Libraries/Python
Source0:        https://deap.googlecode.com/files/deap-%{version}.tar.gz
Url:            https://code.google.com/p/deap/
%if  0%{?suse_version} <= 1110
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%else
BuildArch:      noarch
Requires:       python(abi) >= %{py_ver}
%endif
Requires:       python-numpy
BuildRequires:  fdupes
BuildRequires:  latex2html
BuildRequires:  python-Pygments
BuildRequires:  python-Sphinx
BuildRequires:  python-matplotlib
BuildRequires:  python-numpy-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
DEAP is intended to be an easy to use distributed evolutionary algorithm
library in the Python language. Its two main components are modular and
can be used separately. The first module is a Distributed Task Manager
(DTM), which is intended to run on cluster of computers. The second
part is the Evolutionary Algorithms in Python (EAP) framework.

%package doc
Summary:        Documentation for %{name}
Group:          Documentation/HTML
Recommends:     %{name} = %{version}

%description doc
Documentation and help files for %{name}


%prep
%setup -q -n %{modname}-%{version}

%build
python setup.py build

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

# build the doc pages
export PYTHONPATH=%{buildroot}%{python_sitelib}
make -C doc PAPER=letter html
find doc/_build/html -type f -name ".*" -exec rm {} \;
# fix spurious-executable-perm rpmlint warning
find doc/_build/html -type f -name "*.py" -exec chmod 644 {} \;
# remove duplicates
%fdupes -s doc/_build/html

%files
%defattr(-,root,root)
%doc LICENSE.txt
%{python_sitelib}/%{modname}
%{python_sitelib}/%{modname}-%{version}-py%{py_ver}.egg-info

%files doc
%defattr(-,root,root)
%doc doc/_build/html README.txt

%changelog
openSUSE Build Service is sponsored by