# $Id: Portfile,v 1.4 2006/06/02 06:10:09 mww Exp $

PortSystem 1.0

name			libtommath
version			0.39
categories		math
platforms		darwin
maintainers		mww@opendarwin.org
description		Comprehensive, modular and portable mathematical routines
long_description	LibTomMath provides highly optimized and portable routines \
			for a vast majority of integer based number theoretic \
			applications (including public key cryptography).

homepage		http://libtommath.sourceforge.net/
master_sites	http://math.libtomcrypt.org/files/ freebsd
distname		ltm-${version}
checksums		sha1 496224e48c4823db3046cdc9fb98c778f8e95466
use_bzip2		yes
patchfiles		patch-makefile

worksrcdir		${name}-${version}

use_configure	no

build.args		LIBDIR=${prefix}/lib

destroot {
	xinstall -m 755 -d ${destroot}${prefix}/include/${name}
	xinstall -m 644 -W ${worksrcpath} tommath.h tommath_class.h \
		tommath_superclass.h ${destroot}${prefix}/include/${name}
	xinstall -m 644 -W ${worksrcpath} libtommath.a libtommath.${version}.dylib \
		${destroot}${prefix}/lib
	system "cd ${destroot}${prefix}/lib \
		&& ln -s libtommath.${version}.dylib libtommath.0.dylib \
		&& ln -s libtommath.${version}.dylib libtommath.dylib"
}

platform darwin 8 {
	build.args-append	CC=/usr/bin/gcc-4.0
}

