Пакет OOSuite: Specfile

BuildRequires(pre): rpm-build-python
%define python_noarch %_libexecdir/python%__python_version/site-packages

%define dirs DerApproximator FuncDesigner OpenOpt

Name: OOSuite
Version: 0.25
Release: alt1.svn20090925
Summary: OpenOpt Suite
License: BSD
Group: Sciences/Mathematics
Url: http://openopt.org/
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

# svn://openopt.org/PythonPackages
Source: %name-%version.tar.gz

BuildPreReq: python-devel gcc-fortran
BuildPreReq: python-module-numpy python-module-setuptools
BuildPreReq: python-module-matplotlib-gtk
BuildPreReq: libglpk-devel >= 4.38
BuildPreReq: python-module-cvxopt python-module-pswarm_py
BuildPreReq: python-module-pyipopt python-module-pywrapper
BuildPreReq: python-module-scipy libatlas-devel

%description
OpenOpt is a free optimization framework that was created in June of
2007. It is a relatively new project that is currently developed in the
optimization department of the Cybernetics Institute at the Ukrainian
National Academy of Sciences, in collaboration with the SciPy
development team. OpenOpt interfaces with many different algorithms for
solving optimization problems (solvers), some of which are written in C
or Fortran.

%package -n python-module-toms587
Summary: Python wrapper of toms587
Group: Development/Python
%setup_python_module toms587
%py_provides toms587
Conflicts: python-module-toms_587
Obsoletes: python-module-toms_587

%description -n python-module-toms587
This package contains python wrapper of toms587.

%package -n python-module-openopt
Summary: Python module of Numerical optimization framework
Group: Development/Python
BuildArch: noarch
%setup_python_module openopt
Requires: libglpk >= 4.38
Requires: python-module-scipy >= 0.8.0
Requires: python-module-matplotlib-gtk
%py_requires scipy setuptools matplotlib cvxopt
%py_requires pswarm_py pyipopt pywrapper toms587

%description -n python-module-openopt
OpenOpt is a free optimization framework that was created in June of
2007. It is a relatively new project that is currently developed in the
optimization department of the Cybernetics Institute at the Ukrainian
National Academy of Sciences, in collaboration with the SciPy
development team. OpenOpt interfaces with many different algorithms for
solving optimization problems (solvers), some of which are written in C
or Fortran.

This package contains python module of OpenOpt.

%package -n python-module-DerApproximator
Summary: A python module for finite-differences derivatives approximation
Group: Development/Python
%setup_python_module DerApproximator

%description -n python-module-DerApproximator
DerApproximator - tool to get (or check user-supplied) derivatives via
finite-difference approximation.

%package -n python-module-FuncDesigner
Summary: A python module for function design and automatic derivatives
Group: Development/Python
%setup_python_module FuncDesigner

%description -n python-module-FuncDesigner
FuncDesigner - tool to rapidly build functions and get their derivatives
via automatic differentiation. Also, you can solve/optimize problems
coded in FuncDesigner by OpenOpt.

%prep
%setup

%build
f2py -m toms587 \
	-c OpenOpt/openopt/solvers/Standalone/toms587.f \
	-lblas
export PYTHONPATH=$PWD
for dir in %dirs; do
	pushd $dir
	%python_build
	popd
done

%install
for dir in %dirs; do
	pushd $dir
	%python_install --optimize=2
	popd
done

install -d  %buildroot%python_sitelibdir
install -m644 toms587.so %buildroot%python_sitelibdir

%ifarch x86_64
mv %buildroot%python_noarch/DerApproximator* \
	%buildroot%python_sitelibdir/
mv %buildroot%python_noarch/FuncDesigner* \
	%buildroot%python_sitelibdir/
%endif
cp -fR FuncDesigner/FuncDesigner/examples \
	FuncDesigner/FuncDesigner/tests \
	%buildroot%python_sitelibdir/FuncDesigner/
cp -fR DerApproximator/tests \
	%buildroot%python_sitelibdir/DerApproximator/

%files -n python-module-toms587
%doc OpenOpt/openopt/solvers/Standalone/toms587.f
%python_sitelibdir/toms587.so

%files -n python-module-openopt
%doc OpenOpt/ChangeLog.txt OpenOpt/COPYING.txt OpenOpt/README.txt
%doc OpenOpt/openopt/doc/*
%python_noarch/openopt*

%files -n python-module-DerApproximator
%doc DerApproximator/COPYING.txt
%python_sitelibdir/DerApproximator*

%files -n python-module-FuncDesigner
%python_sitelibdir/FuncDesigner*

%changelog
* Sat Oct 03 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.25-alt1.svn20090925
- Initial build for Sisyphus (obsoletes old OpenOpt)

* Sat Sep 05 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt3.svn20090820.1
- Rebuilt with updated requirements

* Thu Aug 20 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt3.svn20090820
- Upstream changes:
  + minor change for graphic output, when last point cord has NaN (thx
    dmitrey).
  + minor changes for some examples (thx dmitrey).

* Sat Aug 08 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt3.svn20090808
- Upstream changes:
  + range -> xrange (thx dmitrey).
  + minor bugfix for scipy_cobyla and probably similar NLP solvers
    w/o involving gradient (thx dmitrey).

* Tue Aug 04 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt3.svn20090801
- Rebuild with modules: cvxopt, pswarm_py, pyipopt, pywrapper, toms_587

* Fri Jul 31 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt2.svn20090801.1
- New snapshot
- Fixed requirements for GUI

* Thu Jul 30 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt2.svn20090701
- Fixed requirements

* Wed Jul 01 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.24-alt1.svn20090701
- Version 0.24

* Mon Apr 20 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.23-alt1.svn20090420
- Version 0.23

* Sun Apr 19 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 0.21-alt1
- Initial build for Sisyphus