# $Id: Portfile,v 1.2 2006/02/14 21:11:22 olegb Exp $

PortSystem 1.0

name			wings
version			0.98.32a
categories		graphics erlang
platforms		darwin
maintainers		bfulgham@mac.com
description		Erlang 3D Modeler
long_description	Wings 3D is a subdivision modeler inspired by \
				Nendo and Mirai from Izware.

homepage		http://www.wings3d.com/
master_sites		sourceforge
checksums		md5 9ac33a6ec298c251a7e6ebaaf28f6cd5

depends_build		port:esdl port:erlang

use_configure		no
use_bzip2		yes

build.target		
destroot.target			

set wingsdest	${destroot}${prefix}/lib/erlang/lib/wings-${version}

post-destroot		{
	cd ${worksrcpath}
	xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
	xinstall -m 0644 README AUTHORS license.terms ${destroot}${prefix}/share/doc/${name}

	xinstall -d -m 0755 ${destroot}${prefix}/bin
	xinstall -m 755 ${filespath}/wings.sh ${destroot}${prefix}/bin
	reinplace "s|__PREFIX__|${prefix}|g" ${destroot}${prefix}/bin/wings.sh
	system "cd ${destroot}${prefix}/bin && ln -s wings.sh wings"

	xinstall -d -m 0755 ${wingsdest}/patches

	file copy ${worksrcpath}/plugins ${wingsdest}
	file copy ${worksrcpath}/ebin ${wingsdest}
	file copy ${worksrcpath}/fonts ${wingsdest}
	file copy ${worksrcpath}/icons ${wingsdest}
}
