# $Id: Portfile 78632 2011-05-14 22:50:58Z ryandesign@macports.org $

PortSystem          1.0

name                luajit
version             2.0.0-beta6
categories          lang
platforms           darwin
maintainers         and.damore openmaintainer
description         a Just-In-Time Compiler for Lua
long_description    \
LuaJIT is a Just-In-Time Compiler for the Lua programming language.

homepage            http://luajit.org
master_sites        ${homepage}/download
distname            LuaJIT-${version}

checksums           md5     bfcbe2a11162cfa84d5a1693b442c8bf \
                    sha1    0412da515eb21fa5b537ce6b74f1743cb68c99f1 \
                    rmd160  0c8d7724831ecb3a9b728e2d1344cc5d9ba9007e

#depends_lib         port:readline

post-patch {
    reinplace "s|/usr/local|${prefix}|g" \
		${worksrcpath}/etc/luajit.pc \
		${worksrcpath}/Makefile \
		${worksrcpath}/src/luaconf.h \
		${worksrcpath}/src/Makefile 
}

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}/img
    xinstall -m 644  ${worksrcpath}/COPYRIGHT ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/doc/*.html] ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/doc/*.css] ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/doc/img/*] ${destroot}${prefix}/share/doc/${name}/img
}

use_parallel_build  no
use_configure       no

livecheck.type  regex
livecheck.url   ${master_sites}
livecheck.regex {lua-(\d+(?:\.\d+)*)}
