# $Id: Portfile,v 1.7 2005/11/27 13:21:12 gwright Exp $

PortSystem 1.0

name		simh
version		v35-1
categories	emulators
platforms	darwin
maintainers	darwinports@opendarwin.org
description	A highly portable, multi-system simulator.
long_description	\
		The Computer History Simulation Project is a loose	\
		Internet-based collective of people interested in	\
		restoring historically significant computer hardware	\
		and software systems by simulation. The goal of the	\
		project is to create highly portable system simulators	\
		and to publish them as freeware on the Internet,	\
		with freely available copies of significant or		\
		representative software.

homepage	http://simh.trailing-edge.com
master_sites	http://simh.trailing-edge.com/sources/
checksums	md5 ead371c802d6a7feba99031bf55895fe
use_zip		yes
distname	${name}${version}
worksrcdir	.
configure	{}

pre-build {
		file mkdir ${worksrcpath}/BIN
}

variant	network	{
		depends_lib	port:libpcap
		build.target	"USE_NETWORK=1 all"

		post-extract	{
				reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/makefile
		}
}

destroot {
		set binaries [ exec ls ${worksrcpath}/BIN ]
		foreach binary $binaries {
			system "install -c -m 755 ${worksrcpath}/BIN/${binary} ${destroot}${prefix}/bin/simh-${binary}"

		xinstall -d -m 755 ${destroot}${prefix}/share/simh/VAX
		xinstall -c -m 644 ${worksrcpath}/VAX/ka655.bin  ${destroot}${prefix}/share/simh/VAX
		xinstall -c -m 644 ${worksrcpath}/VAX/ka655x.bin ${destroot}${prefix}/share/simh/VAX
		}
}

