# $Id$

PortSystem 1.0

name                    lua-glut
version                 0.5
revision                0
categories              devel
platforms               darwin
maintainers             bfulgham
description             OpenGL and GLUT bindings for the Lua programming language.
long_description        ${description} 

homepage                http://lua-users.org/wiki/VarolKaptan
master_sites            http://lua-users.org/files/wiki_insecure/users/VarolKaptan/
distname                luaglut-${version}

depends_lib             port:lua

use_configure		no

checksums               md5 9b0ae78d829af770dab2b88c9190c90c \
                        sha1 3e1dc986d2ead5a96073451d2d78c8df2fbb4e4b \
			rmd160 4de4335353d1712bf22b1ed187ef8d35f3b869b3

patchfiles              patch-Makefile

build.type		gnu
build.cmd		make
build.args		
build.target		

post-patch {
	reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile
}

destroot {
	# Documentation and examples
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
	file copy ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
	xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/examples
        foreach f {glut_test1.lua glut_test2.lua lua.ppm} {
            file copy ${worksrcpath}/${f} ${destroot}${prefix}/share/doc/${name}/examples
        }

	# Binaries
	xinstall -m 755 -d ${destroot}${prefix}/lib/lua/5.1
	foreach lib [glob ${worksrcpath}/*.so] {
		xinstall -m 0644 ${lib} ${destroot}${prefix}/lib/lua/5.1
	}
}