# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 97126 2012-08-27 22:28:15Z ryandesign@macports.org $

PortSystem      1.0
PortGroup       github 1.0

epoch           20111014
github.setup    mochi mochiweb 2.3.2 v
categories      erlang www
license         MIT
platforms       darwin
maintainers     nomaintainer
supported_archs noarch

description     MochiWeb is an Erlang library for building lightweight HTTP servers.

long_description \
    ${description}

depends_lib     port:erlang

checksums       rmd160  867b293145fd02fd138dbfa8d18b59a4579c9c00 \
                sha256  1376f867ccf178f27fa1a4d5a645a07fdf68861e0df3994a6e5a460bebc8adeb

use_configure no
build.target-append edoc

set libdir ${prefix}/lib/erlang/lib/${name}

destroot {
    xinstall -d ${destroot}${libdir}
    copy ${worksrcpath}/ebin ${destroot}${libdir}/ebin
    copy ${worksrcpath}/scripts ${destroot}${libdir}/scripts
    copy ${worksrcpath}/src ${destroot}${libdir}/src

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} CHANGES.md LICENSE README ${destroot}${docdir}
    copy ${worksrcpath}/doc ${destroot}${docdir}/html
    xinstall -m 644 ${filespath}/README.MacPorts ${destroot}${docdir}
    reinplace s:@PREFIX@:${prefix}: ${destroot}${docdir}/README.MacPorts
}

test.run yes
