File python-conmin.spec of Package python-conmin
#
# spec file for package python-conmin
#
# 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 conmin
Name: python-%{modname}
Version: 1.0.1
Release: 0
Summary: An implementation of the CONMIN gradient descent optimization algorithm
License: SUSE-Public-Domain
Group: Development/Libraries/Python
Source0: http://www.openmdao.org/dists/%{modname}-%{version}.tar.gz
Url: http://www.openmdao.org
%if 0%{?suse_version} <= 1110
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
Requires: python-numpy
BuildRequires: fdupes
BuildRequires: python-numpy-devel
BuildRequires: python-setuptools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
CONMIN stands for "CONstraint MINimization". CONMIN is a gradient descent
optimization algorithm developed by NASA.
%prep
%setup -q -n %{modname}-%{version}
%build
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
# add minsing __init__.py to prevent import error
echo "import %{modname}" > %{buildroot}%{python_sitearch}/%{modname}/__init__.py
%fdupes -s %{buildroot}%{python_sitearch}
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{python_sitearch}/%{modname}
%{python_sitearch}/%{modname}-%{version}-py%{py_ver}.egg-info
%changelog