# $Id: Portfile 89934 2012-02-15 23:29:23Z ryandesign@macports.org $
PortSystem 1.0

name                lua-luafilesystem
version             1.5.0
revision            2
license             MIT
categories          devel
platforms           darwin
maintainers         and.damore openmaintainer
description         File System Library for the Lua Programming Language
long_description    LuaFileSystem is a Lua library developed to complement the set of functions \
                    related to file systems offered by the standard Lua distribution.

homepage            http://keplerproject.github.com/luafilesystem/
master_sites        http://github.com/downloads/keplerproject/luafilesystem

checksums           md5     3cf4882bbce956e7a0b010f148f194a3 \
                    sha1    1ee2ca3b5dbc3cf7c21c7168a0873b2983b7e241 \
                    rmd160  db1e597046d47ab12df202e7c65fb3b815c9f922

distname            luafilesystem-${version}
depends_lib         port:lua
patchfiles          patch-config.diff

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

use_configure       no

variant universal {}

build.args          CC="${configure.cc}"
build.target        lib
build.env-append    CFLAGS=" ${configure.cflags}  [get_canonical_archflags cc]" \
                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]"

post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/share/examples/${name}
    
    xinstall -m 644 ${worksrcpath}/README ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/doc/us/*] ${destroot}${prefix}/share/doc/${name}
    eval xinstall -m 644 [glob ${worksrcpath}/tests/*] ${destroot}${prefix}/share/examples/${name}
}

