#
# Copyright (c) 2001-2003 The Trustees of Indiana University.  
#                         All rights reserved.
# Copyright (c) 1998-2001 University of Notre Dame. 
#                         All rights reserved.
# Copyright (c) 1994-1998 The Ohio State University.  
#                         All rights reserved.
# 
# This file is part of the LAM/MPI software package.  For license
# information, see the LICENSE file in the top level directory of the
# LAM/MPI source distribution.
# 
# $Id: lam-generic.spec,v 1.3 2003/05/30 22:08:07 jsquyres Exp $
#
%define _sysconfdir /etc/lam
%define _romiodocdir /usr/share/lam/doc
Summary: LAM/MPI (Local Area Multicomputer) programming environment
Summary(ja): MPIメッセージパッシング形式の並列アプリケーション作成環境
Name: lam
Version: 7.1.4
Release: 1%{?_dist_release}
License: BSD
Group: Development/Libraries
Source: lam-%{version}.tar.gz
Patch: lam-helppath.patch
URL: http://www.lam-mpi.org/
ExcludeArch: ia64
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: gcc-gfortran
Provides: mpi
Vendor: Project Vine
Distribution: Vine Linux

%description 
LAM (Local Area Multicomputer) is an 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 solving one problem.
LAM/MPI is considered to be "cluster friendly", in that 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 web site for details).

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


%prep
%setup -q

# Otherwise, this directory shows up on security reports
chmod -R o-w $RPM_BUILD_DIR/lam-%{version}


%build
%configure \
	--with-rpi=usysv \
	--with-fc=gfortran \
	--enable-shared \
	--enable-static \
	--sysconfdir=%{_sysconfdir} \

make %{?_smp_mflags} all


%install
rm -rf $RPM_BUILD_ROOT
%makeinstall

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

# Rename the ROMIO doc files so that we can install them in the same
# doc root later, and not overwrite LAM's doc files.

for file in README README_LAM COPYRIGHT; do
	mv $RPM_BUILD_DIR/lam-%{version}/romio/$file \
		$RPM_BUILD_DIR/lam-%{version}/romio/romio-$file
done
mv $RPM_BUILD_DIR/lam-%{version}/romio/doc/users-guide.ps.gz \
	$RPM_BUILD_DIR/lam-%{version}/romio/doc/romio-users-guide.ps.gz

# remove unused files
rm -f $RPM_BUILD_ROOT/%{_libdir}/lib*.la


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root)
%doc LICENSE HISTORY INSTALL README
%doc examples
%doc doc/*.pdf
# Need to fix ROMIO install script to install its docs in the Right place
%doc %{_romiodocdir}
%config %{_sysconfdir}
%{_bindir}/*
%{_mandir}/*/*
%{_includedir}/*
%{_libdir}/lam
%{_libdir}/*.a
%{_libdir}/*.so
%{_libdir}/*.so.*
#%{_datadir}/lam/lam-shell-setup.*
#%{_datadir}/lam/lam_module.tcl


%changelog
* Fri Sep 26 2008 Shu KONNO <owa@bg.wakwak.com> 7.1.4-1vl5
- fixed typo of last changelog release number
- removed lib*.la

* Sun Aug 24 2008 Shu KONNO <owa@bg.wakwak.com> 7.1.4-0.1vl5
- applied new versioning policy, spec in utf-8
- updated lam to 7.1.4
- added japanese summary

* Sun Dec 30 2007 Shu KONNO <owa@bg.wakwak.com> 7.0-1vl2
- updated gcc-g77 to gcc-gfortran in BuildRequires
- added "--with-fc=gfortran" to %%configure

* Thu Aug 28 2003 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 7.0-1vl1
- based on new upstream 
  (http://www.lam-mpi.org/download/files/lam-7.0-1.src.rpm)
- rebuild with new toolchains

* Thu Dec 21 2000 Jun Nishii <jun@vinelinux.org>
- 6.3.3b47-1vl2
- build with gcc

* Thu Dec 21 2000 Jun Nishii <jun@vinelinux.org>
- 6.3.3b47-1vl1
- use macros for spec
- correct path of helpfile

* 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