Portfile

# $Id: Portfile 22478 2007-03-02 05:16:40Z pipping@macports.org $

PortSystem 1.0
name triangle
version 1.6
categories science
maintainers nomaintainer@macports.org
description A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator
long_description Triangle generates exact Delaunay triangulations, \
constrained Delaunay triangulations, conforming Delaunay \
triangulations, Voronoi diagrams, and high-quality triangular \
meshes. The latter can be generated with no small or large \
angles, and are thus suitable for finite element analysis.

platforms darwin

homepage http://www.cs.cmu.edu/~quake/triangle.html
master_sites http://cm.bell-labs.com/netlib/voronoi/
distname ${name}.shar

worksrcdir ${name}

checksums sha1 b581366c09340f33c634eb2bb724881924fe87a3

extract.suffix .gz
extract.cmd gzip
extract.pre_args -dc
extract.post_args "| sh"

post-extract {
cd ${workpath}
file mkdir ${worksrcdir}
eval file rename [glob \[A-s\]* t*.?] ${worksrcdir}
reinplace "s/-DLINUX//" ${worksrcdir}/makefile
}

depends_lib lib:libX11.6:XFree86

use_configure no

destroot {
}

destroot.destdir BINDIR=${destroot}/${prefix}/bin

post-destroot {
xinstall -m 755 -d ${destroot}/${prefix}/share/doc/${name} \
${destroot}/${prefix}/bin
eval xinstall -m 644 -W ${worksrcpath} A.poly README ${destroot}/${prefix}/share/doc/${name}
xinstall -m 755 -W ${worksrcpath} triangle showme ${destroot}/${prefix}/bin
}