# $Id: Portfile 63216 2010-01-29 19:18:49Z and.damore@macports.org $
PortSystem          1.0
name                luarocks
version             2.0.1
categories          devel
platforms           darwin
maintainers         and.damore
description         Manager for rocks, lua extensions.
long_description    LuaRocks is a deployment and management system for Lua modules. LuaRocks \
                    allows you to install Lua modules as self-contained packages called \
                    \"rocks\", which also contain version dependency information. This \
                    information is used both at install time, so that when one rock is \
                    requested all rocks it depends on are installed as well, and at run \
                    time, so that when a module is required, the correct version is loaded. \
                    LuaRocks supports both local and remote repositories, and multiple local \
                    rocks trees.
homepage            http://www.luarocks.org/
master_sites        http://luarocks.org/releases/
depends_run         port:lua
universal_variant   no
checksums           md5     795a30b42894ef5cd2ad449c3bf9cff9 \
                    sha1    aa0870c18d1a04b5045e35b8dd12ff2e5f6b3574 \
                    rmd160  99182815d289f841600c0d9ac90456d6109982c2
configure.args      --with-lua=${prefix} \
                    --rocks-tree=${prefix}/var/luarocks

variant md5 conflicts openssl description { Use md5 as checker } {
    configure.args-append   --with-md5-checker=md5sum
}
    
variant openssl conflicts md5 description { Use openssl as checker } {
    configure.args-append   --with-md5-checker=openssl
    depends_run-append  port:openssl
}

if {![variant_isset md5]} {
    default_variants +openssl
}

variant wget conflicts curl description { Use wget as downloader } {
    configure.args-append   --with-downloader=wget
    depends_run-append  port:wget
}

variant curl conflicts wget description { Use curl as downloader } {
    configure.args-append   --with-downloader=curl
    depends_run-append  port:curl
}

if {![variant_isset wget]} {
    default_variants +curl
}
