0ab2f77
%{!?python_sitearch: %global python_sitearch %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
0ab2f77
0ab2f77
Name:		pypar
61198a8
Version:	2.1.5_108
0e7dd23
Release:	6%{?dist}
0ab2f77
Summary:	Parallel programming with Python
0ab2f77
Group:		Development/Libraries
0ab2f77
License:	GPLv2+
61198a8
URL:		http://code.google.com/p/pypar/
61198a8
Source0:	http://pypar.googlecode.com/files/pypar-%{version}.tgz
0c42200
# Get rid of OpenMPI specific stuff
0c42200
Patch0:		pypar-mpich.patch
0c42200
0ab2f77
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
0ab2f77
0ab2f77
BuildRequires:	numpy
634d499
BuildRequires:	python-devel
634d499
BuildRequires:	python-setuptools
0ab2f77
b6f34c5
%description
b6f34c5
Pypar is an efficient but easy-to-use module that allows programs written in
b6f34c5
Python to run in parallel on multiple processors and communicate using message
b6f34c5
passing. Pypar provides bindings to a subset of the message passing interface
b6f34c5
standard MPI.
0ab2f77
b6f34c5
%package common
b6f34c5
Summary:	Common files for pypar packages
b6f34c5
Group:		Documentation
b6f34c5
BuildArch:	noarch
b6f34c5
b6f34c5
%description common
b6f34c5
This package contains common files shared by all MPI flavors of pypar:
b6f34c5
the license, the documentation and the examples.
b6f34c5
b6f34c5
%package openmpi
b6f34c5
Summary:	Parallel programming with Python, Open MPI version
b6f34c5
Group:          Development/Libraries
b6f34c5
Obsoletes:	%{name} < %{version}-%{release}
b6f34c5
Requires:	%{name}-common = %{version}-%{release}
b6f34c5
Provides:	pypar-runtime = %{version}-%{release}
b6f34c5
BuildRequires:	openmpi-devel
b6f34c5
Requires:       numpy
b6f34c5
Requires:	openmpi
0ab2f77
b6f34c5
%description openmpi
b6f34c5
Pypar is an efficient but easy-to-use module that allows programs written in
b6f34c5
Python to run in parallel on multiple processors and communicate using message
b6f34c5
passing. Pypar provides bindings to a subset of the message passing interface
b6f34c5
standard MPI.
0ab2f77
b6f34c5
This package contains pypar compiled against Open MPI.
0ab2f77
Deji Akingunola f204bce
%package mpich
b6f34c5
Summary:        Parallel programming with Python, MPICH2 version
b6f34c5
Group:          Development/Libraries
b6f34c5
Requires:	%{name}-common = %{version}-%{release}
b6f34c5
Provides:	pypar-runtime = %{version}-%{release}
Deji Akingunola f204bce
BuildRequires:	mpich-devel
b6f34c5
Requires:       numpy
Deji Akingunola f204bce
Requires:	mpich
Deji Akingunola f204bce
Provides:	%{name}-mpich2 = %{version}-%{release}
Deji Akingunola f204bce
Obsoletes:	%{name}-mpich2 < 2.1.5_108-2
0ab2f77
Deji Akingunola f204bce
%description mpich
0ab2f77
Pypar is an efficient but easy-to-use module that allows programs written in
0ab2f77
Python to run in parallel on multiple processors and communicate using message
0ab2f77
passing. Pypar provides bindings to a subset of the message passing interface
0ab2f77
standard MPI.
0ab2f77
Deji Akingunola f204bce
This package contains pypar compiled against MPICH.
b6f34c5
b6f34c5
0ab2f77
%prep
b6f34c5
# Setup buildroot but don't extract anything yet
b6f34c5
%setup -q -c -T
b6f34c5
b6f34c5
# Decompress tarball
b6f34c5
tar zxf %{SOURCE0}
b6f34c5
b6f34c5
# Make separate dirs for all MPI variants
Deji Akingunola f204bce
for mpi in openmpi mpich; do 
b6f34c5
 cp -r pypar_%{version} $mpi
b6f34c5
done 
b6f34c5
b6f34c5
# Clean out unneeded dir
b6f34c5
rm -rf pypar_%{version}
b6f34c5
Deji Akingunola f204bce
# Prepare mpich source
Deji Akingunola f204bce
cd mpich
0c42200
%patch0 -p1
0c42200
cd ..
0c42200
0c42200
# Prepare OpenMPI source
0c42200
libmpiso=$(ls -1 %{_libdir}/openmpi/lib/libmpi.so.? | tail -n 1)
0c42200
if [ -n "$libmpiso" -a -f "$libmpiso" ] ; then
0c42200
 sed -i "s|libmpi.so.0|$(basename $libmpiso)|g" openmpi/source/pypar.py
0c42200
else
0c42200
 exit 1
0c42200
fi
0ab2f77
0ab2f77
%build
b6f34c5
export CC=mpicc
b6f34c5
export CXX=mpicxx
b6f34c5
b6f34c5
# Build Open MPI version
b6f34c5
%{_openmpi_load}
b6f34c5
cd openmpi/source 
0ab2f77
CFLAGS="%{optflags}" python -c 'import setuptools; execfile("setup.py")' build
b6f34c5
cd -
b6f34c5
%{_openmpi_unload}
b6f34c5
b6f34c5
# Build MPICH2 version
Deji Akingunola f204bce
%{_mpich_load}
Deji Akingunola f204bce
cd mpich/source
b6f34c5
CFLAGS="%{optflags}" python -c 'import setuptools; execfile("setup.py")' build
b6f34c5
cd -
Deji Akingunola f204bce
%{_mpich_unload}
0ab2f77
0ab2f77
0ab2f77
%install
0ab2f77
rm -rf %{buildroot}
b6f34c5
b6f34c5
export CC=mpicc
b6f34c5
export CXX=mpicxx
b6f34c5
export LD=mpicc
b6f34c5
b6f34c5
%{_openmpi_load}
b6f34c5
cd openmpi/source
0ab2f77
python -c 'import setuptools; execfile("setup.py")' install -O1 --skip-build --root %{buildroot}
b6f34c5
mkdir -p %{buildroot}%{python_sitearch}/openmpi
b6f34c5
mv %{buildroot}%{python_sitearch}/pypar/ %{buildroot}%{python_sitearch}/Pypar*.egg-info %{buildroot}%{python_sitearch}/openmpi
b6f34c5
cd -
b6f34c5
%{_openmpi_unload}
b6f34c5
Deji Akingunola f204bce
%{_mpich_load}
Deji Akingunola f204bce
cd mpich/source
b6f34c5
python -c 'import setuptools; execfile("setup.py")' install -O1 --skip-build --root %{buildroot}
Deji Akingunola f204bce
mkdir -p %{buildroot}%{python_sitearch}/mpich
Deji Akingunola f204bce
mv %{buildroot}%{python_sitearch}/pypar/ %{buildroot}%{python_sitearch}/Pypar*.egg-info %{buildroot}%{python_sitearch}/mpich
b6f34c5
cd -
Deji Akingunola f204bce
%{_mpich_unload}
b6f34c5
0ab2f77
0ab2f77
%clean
0ab2f77
rm -rf %{buildroot}
0ab2f77
b6f34c5
%files common
b6f34c5
%defattr(-,root,root,-)
b6f34c5
%doc openmpi/documentation/* openmpi/LICENSE openmpi/demos/
b6f34c5
b6f34c5
%files openmpi
0ab2f77
%defattr(-,root,root,-)
b6f34c5
%{python_sitearch}/openmpi/pypar/
b6f34c5
%{python_sitearch}/openmpi/Pypar*.egg-info
b6f34c5
Deji Akingunola f204bce
%files mpich
b6f34c5
%defattr(-,root,root,-)
Deji Akingunola f204bce
%{python_sitearch}/mpich/pypar/
Deji Akingunola f204bce
%{python_sitearch}/mpich/Pypar*.egg-info
0ab2f77
0ab2f77
%changelog
0e7dd23
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5_108-6
0e7dd23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
0e7dd23
5df17af
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5_108-5
5df17af
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
5df17af
Deji Akingunola 0b92520
* Sat Feb 22 2014 Deji Akingunola <dakingun@gmail.com> - 2.1.5_108-4
Deji Akingunola 0b92520
- Rebuild for mpich-3.1
Deji Akingunola 0b92520
0953d6b
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5_108-3
0953d6b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
0953d6b
Deji Akingunola f204bce
* Sat Jul 20 2013 Deji Akingunola <dakingun@gmail.com> - 2.1.5_108-2
Deji Akingunola f204bce
- Rename mpich2 sub-packages to mpich and rebuild for mpich-3.0
Deji Akingunola f204bce
61198a8
* Sat Feb 02 2013 Susi Lehtola <jussilehtola@fedoraproject.org> - 2.1.5_108-1
61198a8
- Update to 2.1.5_108.
61198a8
4f91e27
* Fri Nov 02 2012 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.4_94-7.1
4f91e27
- Bump due to MPICH2 update.
4f91e27
c3eb1d2
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4_94-7
c3eb1d2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
c3eb1d2
7695797
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4_94-6
7695797
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
7695797
0c42200
* Thu Nov 17 2011 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.4_94-5
0c42200
- Drop OpenMPI specific workaround in pypar.py from MPICH2 version.
0c42200
- Patch in correct version of OpenMPI in pypar.py (BZ #754262).
0c42200
Deji Akingunola 257f13b
* Wed Mar 30 2011 Deji Akingunola <dakingun@gmail.com> - 2.1.4_94-4
Deji Akingunola 257f13b
- Rebuild for mpich2 soname bump
Deji Akingunola 257f13b
b4c04f2
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.4_94-3
b4c04f2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
b4c04f2
6139ba1
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.1.4_94-2
6139ba1
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
6139ba1
b6f34c5
* Tue Dec 22 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.4_94-1
b6f34c5
- Update to 2.1.4_94, fixing MPICH2 build issue.
b6f34c5
b6f34c5
* Mon Dec 21 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.3_91-1
b6f34c5
- Implement MPI guidelines, adding MPICH2 package.
b6f34c5
- Update to 2.1.3_91.
b6f34c5
28061d8
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.0_66-5
28061d8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
28061d8
b6f34c5
* Thu Jul 23 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-4
06802d2
- Openmpi seems to have been fixed, fix build in rawhide.
06802d2
b6f34c5
* Thu Jun 04 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-3
0ab2f77
- Fix build in rawhide.
0ab2f77
b6f34c5
* Fri May 15 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-2
0ab2f77
- Merge examples into main package and %doc.
0ab2f77
- Spec file cleanups.
0ab2f77
b6f34c5
* Mon Mar 02 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_66-1
0ab2f77
- Update to 2.1.0_66.
0ab2f77
- Branch examples into subpackage.
0ab2f77
b6f34c5
* Sun Feb 29 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_64-1
0ab2f77
- Update to 2.1.0_64.
0ab2f77
b6f34c5
* Sat Feb 28 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_63-1
0ab2f77
- Update to 2.1.0_63 that should fix rpmlint errors.
0ab2f77
b6f34c5
* Thu Feb 26 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 2.1.0_53-1
0ab2f77
- First release.