# $Id: Portfile,v 1.2 2005/09/21 19:00:18 mww Exp $

PortSystem 1.0

name			pvm
version			3.4.5
categories		science parallel net
platforms		darwin
maintainers		mww@opendarwin.org
description		pvm permits a network of computers to act as a cluster
long_description	PVM (Parallel Virtual Machine) is a software package that \
				permits a heterogeneous collection of Unix and/or Windows \
				computers hooked together by a network to be used as a single \
				large parallel computer. Thus large computational problems can \
				be solved more cost effectively by using the aggregate power \
				and memory of many computers.

homepage		http://www.csm.ornl.gov/pvm/
master_sites	http://www.netlib.org/pvm3/ \
				ftp://ftp.netlib.org/pvm3/ \
				ftp://ftp.chg.ru/pub/prog/parallel/pvm3/
distfiles		${name}${version}.tgz
checksums		md5 086e6d707b40adba04bddba8e5b6b17d

set pvm_root	${prefix}/lib/pvm
set pvm_droot	${destroot}${pvm_root}
set pvm_arch	DARWIN

worksrcdir		pvm3

use_configure	no

build.env		PVM_ROOT=${worksrcpath}

platform darwin 8 {
	build.env-append CC=/usr/bin/gcc-3.3 CPP=/usr/bin/cpp-3.3
}

destroot	{
	xinstall -m 755 -d ${pvm_droot}/lib/${pvm_arch}/ ${pvm_droot}/conf
	file copy ${worksrcpath}/bin ${pvm_droot}
	xinstall -m 755 -W ${worksrcpath}/lib/${pvm_arch}/ pvm pvmd3 pvmgs \
		${pvm_droot}/lib/${pvm_arch}/
	xinstall -m 755 -W ${worksrcpath}/lib pvm pvmd pvmgetarch aimk \
		${pvm_droot}/lib
	system "cd ${destroot}${prefix}/bin && ln -sf ${pvm_root}/lib/pvm && \
		ln -sf ${pvm_root}/lib/pvmd && ln -sf ${pvm_root}/lib/aimk"
	xinstall -m 644 -W ${worksrcpath}/lib/${pvm_arch}/ libfpvm3.a libgpvm3.a \
		libpvm3.a libpvmtrc.a ${destroot}${prefix}/lib
	xinstall -m 644 ${worksrcpath}/conf/${pvm_arch}.def ${pvm_droot}/conf
	xinstall -m 644 -W ${worksrcpath}/include fpvm3.h fpvm3_watcom.h pvm3.h \
		pvmproto.h pvmtev.h ${destroot}${prefix}/include
	file delete ${destroot}${prefix}/share/man/man1 \
		${destroot}${prefix}/share/man/man3
	file copy ${worksrcpath}/man/man1 ${destroot}${prefix}/share/man/man1
	file copy ${worksrcpath}/man/man3 ${destroot}${prefix}/share/man/man3
}
