Blob Blame History Raw
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}

Name:		pypar
Version:	2.1.4_94
Release:	2%{?dist}
Summary:	Parallel programming with Python
Group:		Development/Libraries
License:	GPLv2+
URL:		http://sourceforge.net/projects/pypar
Source0:	http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tgz
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	numpy
BuildRequires:	python-devel
BuildRequires:	python-setuptools

%description
Pypar is an efficient but easy-to-use module that allows programs written in
Python to run in parallel on multiple processors and communicate using message
passing. Pypar provides bindings to a subset of the message passing interface
standard MPI.

%package common
Summary:	Common files for pypar packages
Group:		Documentation
BuildArch:	noarch

%description common
This package contains common files shared by all MPI flavors of pypar:
the license, the documentation and the examples.

%package openmpi
Summary:	Parallel programming with Python, Open MPI version
Group:          Development/Libraries
Obsoletes:	%{name} < %{version}-%{release}
Requires:	%{name}-common = %{version}-%{release}
Provides:	pypar-runtime = %{version}-%{release}
BuildRequires:	openmpi-devel
Requires:       numpy
Requires:	openmpi

%description openmpi
Pypar is an efficient but easy-to-use module that allows programs written in
Python to run in parallel on multiple processors and communicate using message
passing. Pypar provides bindings to a subset of the message passing interface
standard MPI.

This package contains pypar compiled against Open MPI.

%package mpich2
Summary:        Parallel programming with Python, MPICH2 version
Group:          Development/Libraries
Requires:	%{name}-common = %{version}-%{release}
Provides:	pypar-runtime = %{version}-%{release}
BuildRequires:	mpich2-devel
Requires:       numpy
Requires:	mpich2

%description mpich2
Pypar is an efficient but easy-to-use module that allows programs written in
Python to run in parallel on multiple processors and communicate using message
passing. Pypar provides bindings to a subset of the message passing interface
standard MPI.

This package contains pypar compiled against MPICH2.


%prep
# Setup buildroot but don't extract anything yet
%setup -q -c -T

# Decompress tarball
tar zxf %{SOURCE0}

# Make separate dirs for all MPI variants
for mpi in openmpi mpich2; do 
 cp -r pypar_%{version} $mpi
done 

# Clean out unneeded dir
rm -rf pypar_%{version}


%build
export CC=mpicc
export CXX=mpicxx

# Build Open MPI version
%{_openmpi_load}
cd openmpi/source 
CFLAGS="%{optflags}" python -c 'import setuptools; execfile("setup.py")' build
cd -
%{_openmpi_unload}

# Build MPICH2 version
%{_mpich2_load}
cd mpich2/source
CFLAGS="%{optflags}" python -c 'import setuptools; execfile("setup.py")' build
cd -
%{_mpich2_unload}


%install
rm -rf %{buildroot}

export CC=mpicc
export CXX=mpicxx
export LD=mpicc

%{_openmpi_load}
cd openmpi/source
python -c 'import setuptools; execfile("setup.py")' install -O1 --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{python_sitearch}/openmpi
mv %{buildroot}%{python_sitearch}/pypar/ %{buildroot}%{python_sitearch}/Pypar*.egg-info %{buildroot}%{python_sitearch}/openmpi
cd -
%{_openmpi_unload}

%{_mpich2_load}
cd mpich2/source
python -c 'import setuptools; execfile("setup.py")' install -O1 --skip-build --root %{buildroot}
mkdir -p %{buildroot}%{python_sitearch}/mpich2
mv %{buildroot}%{python_sitearch}/pypar/ %{buildroot}%{python_sitearch}/Pypar*.egg-info %{buildroot}%{python_sitearch}/mpich2
cd -
%{_mpich2_unload}


%clean
rm -rf %{buildroot}

%files common
%defattr(-,root,root,-)
%doc openmpi/documentation/* openmpi/LICENSE openmpi/demos/

%files openmpi
%defattr(-,root,root,-)
%{python_sitearch}/openmpi/pypar/
%{python_sitearch}/openmpi/Pypar*.egg-info

%files mpich2
%defattr(-,root,root,-)
%{python_sitearch}/mpich2/pypar/
%{python_sitearch}/mpich2/Pypar*.egg-info

%changelog
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.1.4_94-2
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Tue Dec 22 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.4_94-1
- Update to 2.1.4_94, fixing MPICH2 build issue.

* Mon Dec 21 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.3_91-1
- Implement MPI guidelines, adding MPICH2 package.
- Update to 2.1.3_91.

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0_66-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jul 23 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-4
- Openmpi seems to have been fixed, fix build in rawhide.

* Thu Jun 04 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-3
- Fix build in rawhide.

* Fri May 15 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-2
- Merge examples into main package and %doc.
- Spec file cleanups.

* Mon Mar 02 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-1
- Update to 2.1.0_66.
- Branch examples into subpackage.

* Sun Feb 29 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_64-1
- Update to 2.1.0_64.

* Sat Feb 28 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_63-1
- Update to 2.1.0_63 that should fix rpmlint errors.

* Thu Feb 26 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_53-1
- First release.