# $Id: Portfile,v 1.6 2004/09/11 13:04:55 pguyot Exp $

PortSystem			1.0
name				jam
version				2.5
# The version didn't change, but the binary did because it was upgraded from rc3 to 2.5.
revision			1
categories			devel
maintainers			pguyot@kallisys.net
description			a software build tool like make
long_description	Jam is a software build tool (like make) from Perforce. \
					It is very powerful tool and it is used for various \
					projects. It is particularly adapted for C/C++ \
					development, multiplatform projects or builds spread on \
					several processors. MacOS X developer tools actually \
					include a customized version of it.
homepage			http://www.perforce.com/jam/jam.html
distfiles			${name}-${version}.tar
# avoid md5 mismatches.
dist_subdir			${name}/${version}
master_sites		ftp://ftp.perforce.com/pub/jam/ \
					"http://public.perforce.com:8080/@md=d&cd=//public/jam/&ra=s&c=lAF@//public/jam/"
checksums			md5 c7eb7719d8523c0f819116479492d367
# Untested but should probably work on FreeBSD/Linux.
platform			darwin freebsd linux

# This is a .tar file.
extract.cmd			tar -xf 
extract.pre_args	
extract.post_args	

# Enables optimization & Matt Armstrong memory leak patch.
patchfiles			patch-Makefile.diff \
					patch-variable.c.diff

# Jam doesn't have a configure script
use_configure		no

# Installation.
destroot {
	file mkdir ${destroot}${prefix}/share/doc/${name}
	system "install -m 755 ${worksrcpath}/bin.*/jam ${destroot}${prefix}/bin/"
	system "install -m 755 ${worksrcpath}/bin.*/mkjambase ${destroot}${prefix}/bin/"
	xinstall -d -m 755 ${destroot}/${prefix}/share/doc/${name}/
	xinstall -m 644 ${worksrcpath}/Jambase.html ${destroot}/${prefix}/share/doc/${name}/
	xinstall -m 644 ${worksrcpath}/Jamfile.html ${destroot}/${prefix}/share/doc/${name}/
}

# Metrowerks compiler.
variant mw {
	patchfiles			patch-Makefile-mw.diff \
						patch-variable.c.diff
}

# Debug (no optimization + debug)
variant debug {
	patchfiles			patch-Makefile-debug.diff \
						patch-variable.c.diff

	destroot {
		file mkdir ${destroot}${prefix}/share/doc/${name}
		system "install -m 755 ${worksrcpath}/bin.*/g/jam ${destroot}${prefix}/bin/"
		system "install -m 755 ${worksrcpath}/bin.*/g/mkjambase ${destroot}${prefix}/bin/"
		xinstall -d -m 755 ${destroot}/${prefix}/share/doc/${name}/
		xinstall -m 644 ${worksrcpath}/Jambase.html ${destroot}/${prefix}/share/doc/${name}/
		xinstall -m 644 ${worksrcpath}/Jamfile.html ${destroot}/${prefix}/share/doc/${name}/
	}
}
