# $Id: Portfile 103024 2013-02-12 07:04:00Z mww@macports.org $

PortSystem 1.0

name                ragel
version             6.8
categories          lang
platforms           darwin
maintainers         mww
license             GPL-2
description         ragel is a state machine compiler
long_description    Ragel compiles finite state machines from regular \
                    languages into runnable C/C++ code. Ragel state \
                    machines can not only recognize byte sequences as \
                    regular expression machines do, but can also execute \
                    code at arbitrary points in the recognition of a \
                    regular language.

homepage            http://www.complang.org/ragel/
master_sites        ${homepage}
checksums           md5     1bb39745ac23da449019f9f2cb4b0d01 \
                    sha1    95cabbcd52bd25d76c588ddf11e1fd242d7cbcc7 \
                    rmd160  544ef9e770b1ba7d93a1a24d3a19350b82e3aedc

depends_build       port:bison

installs_libs       no

post-build    {
    system -W ${worksrcpath}/doc "${build.cmd} ragel.1"
}

test.run            yes
test.dir            ${worksrcpath}/test
test.target

destroot.destdir    prefix=${destroot}${prefix}
post-destroot {
    xinstall -m 644 ${worksrcpath}/doc/ragel.1 \
        ${destroot}${prefix}/share/man/man1
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} COPYING CREDITS ChangeLog README TODO \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     {ragel-(\d+(?:\.\d+)*).tar.gz}

