File python-ecspy.spec of Package python-ecspy

#
# spec file for package python-ecspy
#
# Copyright (c) 2012 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 ecspy
Name:           python-%{modname}
Version:        1.1
Release:        0
Summary:        A free framework for creating evolutionary computations
License:        GPL-3.0
Group:          Development/Libraries/Python
Source0:        http://pypi.python.org/packages/source/e/%{modname}/%{modname}-%{version}.tar.bz2
Url:            http://pypi.python.org/pypi/ecspy
%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
%endif
Requires:       python-numpy
BuildRequires:  fdupes
BuildRequires:  python-Pygments
BuildRequires:  python-Sphinx
BuildRequires:  python-numpy-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
ECsPy (Evolutionary Computations in Python) is a free, open source
framework for creating evolutionary computations in Python.
Additionally, ECsPy provides an easy-to-use canonical genetic
algorithm (GA), evolution strategy (ES), estimation of distribution
algorithm (EDA), differential evolution algorithm (DEA), and particle
swarm optimizer (PSO) for users who don't need much customization.


%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 docs PAPER=letter html
find docs/_build/html -type f -name ".*" -exec rm {} \;
# fix wrong end of line
find docs/_build/html -type f -name '*.txt' -exec sed -i 's/\r//' {} \;
sed -i 's/\r//' README.txt

%clean
rm -rf %{buildroot}

%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 docs/_build/html README.txt

%changelog
openSUSE Build Service is sponsored by