%define _sysconfdir /etc/lam

Summary: The LAM (Local Area Multicomputer) programming environment.
Name: lam
Version: 6.5.8
Release: 4
License: BSD
Epoch: 2
Group: Development/Libraries
Source: http://www.lam-mpi.org/download/files/lam-%{version}.tar.bz2
Source1: lam.sh
Source2: lam.csh
Patch1: lam-6.5.6-errno.patch
Patch2: lam-6.5.6-configure.patch
URL: http://www.lam-mpi.org/
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc-g77 fileutils perl
Requires: openssh-server openssh-clients
ExcludeArch: s390 s390x

%description
LAM (Local Area Multicomputer) is an Message-Passing Interface (MPI)
programming environment and development system for heterogeneous
computers on a network. With LAM/MPI, a dedicated cluster or an
existing network computing infrastructure can act as one parallel
computer to solve one problem. LAM/MPI is considered to be "cluster
friendly" because it offers daemon-based process startup/control as
well as fast client-to-client message passing protocols. LAM/MPI can
use TCP/IP and/or shared memory for message passing (different RPMs
are supplied for this -- see the main LAM website at
http://www.mpi.nd.edu/lam/ for details).<

LAM features a full implementation of MPI version 1 (with the
exception that LAM does not support cancelling of sends), and much of
version 2. Compliant applications are source code portable between LAM
and any other implementation of MPI. In addition to meeting the
standard, LAM/MPI offers extensive monitoring capabilities to support
debugging. Monitoring happens on two levels: On one level, LAM/MPI has
the hooks to allow a snapshot of a process and message status to be
taken at any time during an application run. The status includes all
aspects of synchronization plus datatype map/signature, communicator
group membership and message contents (see the XMPI application on the
main LAM website). On the second level, the MPI library can produce a
cumulative record of communication, which can be visualized either at
runtime or post-mortem.

%prep
%setup -q

%patch1 -p1
%patch2 -p1

%build
%configure --with-rpi=usysv --with-rsh="/usr/bin/ssh -x -a" --libdir=%{_libdir} --with-cxx=/bin/false
make %{?_smp_mflags} all \
        MPI2CPP_BUILD_TARGET= MPI2CPP_EXAMPLES= MPI2CPP_INSTALL_TARGET=

%install
rm -rf $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install \
        MPI2CPP_BUILD_TARGET= MPI2CPP_EXAMPLES= MPI2CPP_INSTALL_TARGET=

pushd $RPM_BUILD_ROOT
#rm -f usr/include/mpi++.h
#ln -s mpi2c++/mpi++.h usr/include/mpi++.h

# balky has buildroot paths in the binary
perl -pi -e "s|(.*=).*hcp|\1/usr/bin/hcp|g" usr/bin/balky

mkdir -p $RPM_BUILD_ROOT/etc/profile.d
install -m 755 %SOURCE1 $RPM_BUILD_ROOT/etc/profile.d/
install -m 755 %SOURCE2 $RPM_BUILD_ROOT/etc/profile.d/
popd

# This page is malformatted, and mans isn't a standard mandir (#67595)
rm -fr $RPM_BUILD_ROOT/%{_mandir}/mans

ln -f romio/COPYRIGHT romio/ROMIO-COPYRIGHT
ln -f romio/doc/README romio/ROMIO-README
ln -f romio/README_LAM romio/ROMIO-README_LAM

rm -rf $RPM_BUILD_ROOT/usr/share/lam/doc

# just includes a non-manpage
rm -f $RPM_BUILD_ROOT/%{mandir}/man3/libmpi.3

# FIXME: sanitize /usr/include/lam_config.h for bi-arch

# remove unpackaged files from the buildroot
rm -rf $RPM_BUILD_ROOT%{_datadir}/lam

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc LICENSE HISTORY INSTALL README RELEASE_NOTES romio/doc/users-guide.ps.gz
%doc romio/ROMIO-COPYRIGHT romio/ROMIO-README romio/ROMIO-README_LAM
%config(noreplace) /etc/lam
%config(noreplace) /etc/profile.d/*
%{_bindir}/*
%{_mandir}/*/*
%{_includedir}/*
%{_libdir}/*a

%changelog
* Fri Feb 7 2003 Lon Hohberger <lhh@redhat.com> 6.5.8-4
- Disabled s390 and s390x architectures for now.

* Wed Jan 22 2003 Tim Powers <timp@redhat.com>
- rebuilt

* Thu Jan  9 2003 Bill Nottingham <notting@redhat.com> 2:6.5.8-2
- rebuild, shrink

* Fri Dec 20 2002 Elliot Lee <sopwith@redhat.com> 2:6.5.8-1
- Update to new version in hopes of a fix for varargs problems
- Since it doesn't fix it, turn off mpi2c++ altogether - a package
  that builds without C++ wrappers is preferable to a package that doesn't
  build at all

* Thu Dec 12 2002 Tim Powers <timp@redhat.com> 2:6.5.6-10
- remove unpackaged files from the buildroot

* Wed Nov 20 2002 Jakub Jelinek <jakub@redhat.com> 6.5.6-9
- Always #include <errno.h> instead of declaring errno by hand.
- Start tweaking for Hammer
- Remove unpackaged files

* Thu Jul 18 2002 Trond Eivind Glomsrød <teg@redhat.com> 6.5.6-8
- Fix  #63548

* Thu Jun 27 2002 Trond Eivind Glomsrød <teg@redhat.com> 6.5.6-7
- Remove malplaced and malformatted manpage (#67955).
- Fix hpf77. A wrapper was a little to zealous in avoiding
 /usr for includes and libs (#67321)

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Feb 21 2002 Trond Eivind Glomsrød <teg@redhat.com> 6.5.6-4
- Rebuild

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Tue Dec  4 2001 Trond Eivind Glomsrød <teg@redhat.com> 6.5.6-2
- use ssh (#56946)

* Tue Nov 27 2001 Trond Eivind Glomsrød <teg@redhat.com> 6.5.6-1
- 6.5.6

* Fri Nov  2 2001 Trond Eivind Glomsrød <teg@redhat.com> 6.5.5-1
- 6.5.5
- License change - from a  BSDish license to BSD

* Fri Aug 17 2001 Trond Eivind Glomsrød <teg@redhat.com> 6.5.4-1
- 6.5.4, from the stable branch. Minor bugfixes, more docs. This also
  made allmost all references to the buildroot go away.
- fix the remaining reference
- Don't include examples as they are too tied with the buildroot.
- Add perl and file-utils as build dependencies
- don't include doc/* as documentation, that directory disappeared a
  long time ago (rpm doesn't fail if something in the doc section is
  missing )

* Mon Jul 16 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 6.5.3
- remove now obsolete patches and workarounds during the build process

* Fri May 25 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 6.5.2
- No longer exclude IA64

* Sat Apr  7 2001 Trond Eivind Glomsrød <teg@redhat.com>
- Fix from CVS so hpc and hf77 (C++ and FORTRAN compiler interfaces)
  don't specify -I/usr/include - this breaks some compilations of MPI
  programs (#34796)

* Wed Apr  4 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 6.5.1 final
- update URL
- add epoch, as rpm thought 6.5.1 newer than 6.5b7 newer
  than  6.5.1 etc.

* Tue Mar 27 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 6.5b7
- fix lamhelpdir problems

* Fri Mar  2 2001 Trond Eivind Glomsrød <teg@redhat.com>
- 6.5b5 - this is just a renaming of the 6.3.3b series,
  and should hopefully be indentical to 6.5 final

* Mon Feb 12 2001 Trond Eivind Glomsrød <teg@redhat.com>
- make a link from mpi++.h, not mpi++, to mpi2c++/mpi++.h
  (#27249)
- 6.3.3b58, which should work better on SMP machines in
  a cluster

* Tue Nov 28 2000 Trond Eivind Glomsrød <teg@redhat.com>
- 6.3.3b47

* Thu Aug 17 2000 Trond Eivind Glomsrød <teg@redhat.com>
- 6.3.3b28, which should match the release. One known
  problem on SCO, otherwise none. This includes
  fixing some programs which didn't work in the
  last build.

* Thu Jul 27 2000 Harald Hoyer <harald@redhat.com>
- fixed the install process, that the lam tools have the
  right path set. make all;make DESTDIR install is
  our friend.

* Wed Jul 19 2000 Trond Eivind Glomsrød <teg@redhat.com>
- a new and better world without dirty tricks necesarry.
  All hail the 6.3.3beta (beta 20 - all my requests and
  patches seem to be in now :)

* Fri Jun 16 2000 Trond Eivind Glomsrød <teg@redhat.com>
- substituted some old dirty tricks for new ones to make
  it build. More needed.
- Removed C++ (won't build) and ROMIO (who cares) support

* Thu Jun 15 2000 Trond Eivind Glomsrød <teg@redhat.com>
- ugly tricks to make it use %%{_mandir}
- patch to make it build with current compiler and glibc
- don't build on IA64

* Tue Apr 25 2000 Trond Eivind Glomsrød <teg@redhat.com>
- changed RPI to usysv - this should be good for
  (clusters of) SMPs.

* Wed Mar 28 2000 Harald Hoyer <harald@redhat.com>
- patched scheme Makefile

* Tue Mar 28 2000 Harald Hoyer <harald@redhat.com>
- new subminor version
- patched Makefile to build otb daemons, to satisfy conf.otb and build all
  stuff

* Sat Mar 04 2000 Cristian Gafton <gafton@redhat.com>
- fixed the whole tree the hard way - get into each Makefile and fix
  brokeness on a case by case basis. Traces of Buildroot should be
  erradicated by now.

* Thu Mar 02 2000 Cristian Gafton <gafton@redhat.com>
- put back the mpi2c++ stuff.

* Tue Feb 29 2000 Cristian Gafton <gafton@redhat.com>
- take out the mpi2c++ in a separate package

* Fri Feb 04 2000 Cristian Gafton <gafton@redhat.com>
- first version of the package