# $Id: Portfile 59971 2009-10-28 06:56:05Z pguyot@kallisys.net $

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			nomaintainer
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. Mac OS 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 \
					sha1 421c1b308c3c3dc4c95c0640078416af2195d841 \
					rmd160 34497c89ca4bbd1db049627e2dfcc1287138af24
platforms			darwin

# 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}/Jam.html ${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}/
	}
}

livecheck.type	md5
livecheck.url	ftp://ftp.perforce.com/pub/jam/
livecheck.md5	37e6a5b6516a680c7178b72021d3b706
