# $Id: Portfile 78498 2011-05-10 07:02:37Z ryandesign@macports.org $

PortSystem      1.0
PortGroup       php5extension 1.0

php5extension.setup peb 0.20b
license         BSD
categories      php devel
platforms       darwin
maintainers     nomaintainer
description     PHP-Erlang Bridge

long_description \
    peb (PHP-Erlang Bridge) is an open-source PHP extension to run PHP as an \
    Erlang cnode

homepage        http://code.google.com/p/mypeb/
master_sites    googlecode:mypeb

checksums       md5     5ccde4b9e8bcd0dc0a420e290941703a \
                sha1    c9c940b79d8b739af95a456a2ad90f93d8ef6982 \
                rmd160  169f7d6bfcb855c45c132db1091fad428f739a30

worksrcdir      peb_release

depends_build-append \
    port:erlang

# erlang is not universal, but that doesn't need to prevent peb from being universal
depends_skip_archcheck  erlang

pre-configure {
    set ei_dir [glob -directory ${prefix}/lib/erlang/lib/ erl_interface-*/]
    configure.cppflags-append -I${ei_dir}/include
    configure.ldflags-append -L${ei_dir}/lib
}

use_parallel_build yes

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} CREDITS EXPERIMENTAL LICENSE \
        ${destroot}${docdir}
    copy ${worksrcpath}/manual ${destroot}${docdir}/html
}
