Package python-module-mpi4py: Specfile

%define mpiimpl openmpi
%define mpidir %_libexecdir/%mpiimpl
%define oname mpi4py

Name: python-module-%oname
Version: 1.2.1
Release: alt1.svn20100626.2
Summary: MPI bindings for Python
License: Public
Group: Development/Python
Url: http://www.cimec.org.ar/python/
Packager: Eugeny A. Rostovtsev (REAL) <real at altlinux.org>

# http://mpi4py.googlecode.com/svn/trunk
Source: %oname-%version.tar.gz

BuildRequires(pre): rpm-build-python rpm-macros-make
BuildPreReq: %mpiimpl-devel
BuildPreReq: python-devel python-module-Cython libmpe2-devel
%setup_python_module %oname

%description
This package is constructed on top of the MPI-1
specification and provides an object oriented interface
which closely follows MPI-2 C++ bindings. It supports
point-to-point (sends, receives) and collective
(broadcasts, scatters, gathers) communications of any
*picklable* Python object.

%package devel
Summary: Headers of MPI bindings for Python
Group: Development/Python
Requires: %name = %version-%release
Requires: %mpiimpl-devel python-devel

%description devel
This package is constructed on top of the MPI-1
specification and provides an object oriented interface
which closely follows MPI-2 C++ bindings. It supports
point-to-point (sends, receives) and collective
(broadcasts, scatters, gathers) communications of any
*picklable* Python object.

This package contains headers of MPI bindings for Python.

%package doc
Summary: Documentation for mpi4py, MPI bindings for Python
Group: Development/Documentation
BuildArch: noarch

%description doc
Documentation for mpi4py, MPI bindings for Python.

%prep
%setup

%build
source %mpidir/bin/mpivars.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-Rpath=%mpidir/lib -L%mpidir/lib"

sed -i 's|(MPIDIR)|%mpidir|' setup.cfg
%add_optflags -I%mpidir/include -I%_includedir/python%_python_version
%make_ext config
%make_build_ext

%install
source %mpidir/bin/mpivars.sh
export OMPI_LDFLAGS="-Wl,--as-needed,-Rpath=%mpidir/lib -L%mpidir/lib"
export PATH=$PATH:%mpidir/bin

OPTFLAGS="%optflags -I%mpidir/include -I%_includedir/python%_python_version"
export CFLAGS="${OPTFLAGS}"
export CXXFLAGS="${OPTFLAGS}"
export FFLAGS="${OPTFLAGS}"
%python_install --optimize=2

install -d %buildroot%_docdir/%name
cp -fR docs/source %buildroot%_docdir/%name/

%files
%doc LICENSE.txt HISTORY.txt README.txt THANKS.txt
%python_sitelibdir/*
%exclude %python_sitelibdir/%oname/include

%files devel
%python_sitelibdir/%oname/include

%files doc
%_docdir/%name

%changelog
* Mon Mar 07 2011 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.2.1-alt1.svn20100626.2
- Rebuilt with debuginfo
- Extracted headers into separate package

* Tue Oct 12 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.2.1-alt1.svn20100626.1
- Fixed overlinking of libraries

* Tue Jul 13 2010 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.2.1-alt1.svn20100626
- Version 1.2.1

* Wed Dec 16 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.0.0-alt1.M51.1
- Port for branch 5.1

* Thu Jul 23 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.0.0-alt2
- Rebuild with python 2.6

* Sun May 17 2009 Eugeny A. Rostovtsev (REAL) <real at altlinux.org> 1.0.0-alt1
- Initial build for Sisyphus