# $Id: Portfile,v 1.5 2005/05/09 08:17:49 mww Exp $

PortSystem 1.0

name			grace
version			5.1.18
categories		x11 math print
platforms		darwin
maintainers		mww@opendarwin.org
description		WYSIWYG tool to make two-dimensional plots of numerical data
long_description	${description}

homepage		http://plasma-gate.weizmann.ac.il/Grace/
set sub			grace/src/grace5
master_sites	ftp://gd.tuwien.ac.at/visual/${sub} \
				ftp://linux.mathematik.tu-darmstadt.de/pub/linux/mirrors/misc/${sub} \
				ftp://ftp.fu-berlin.de/unix/graphics/${sub} \
				ftp://freedom7.swmed.edu/pub/mirrors/${sub} \
				ftp://ftp.u-aizu.ac.jp/pub/SciEng/math/${sub} \
				http://gd.tuwien.ac.at/visual/${sub} \
				http://ftp.chg.ru/pub/math/${sub}
checksums		md5 9f27cc76563d6fa1746333044a7c2a94

depends_lib		lib:libX11.6:XFree86 \
				port:openmotif \
				port:libpng \
				port:pdflib \
				port:jpeg \
				port:zlib

configure.pre_args	--prefix=${prefix}/lib
configure.env	CFLAGS=-I${prefix}/include \
				LDFLAGS=-L${prefix}/lib

post-destroot {
	xinstall -m 755 -d ${destroot}${prefix}/share/doc
	cd ${destroot}${prefix}
	file delete bin
	file rename lib/grace/bin bin
	file rename lib/grace/doc share/doc/${name}
	file rename lib/grace/examples share/doc/${name}/examples
	file rename lib/grace/include/grace_np.h include/grace_np.h
	file rename lib/grace/lib/libgrace_np.a lib/libgrace_np.a
	system "cd ${destroot}${prefix}/share && mv doc/grace/*.1 man/man1/"
}
