# $Id: Portfile 58520 2009-09-30 06:28:37Z blb@macports.org $

PortSystem        1.0

name              grok
version           20090928
categories        sysutils
maintainers       org.geekdaily:jim openmaintainer
platforms         darwin

description       Easily parse logs and other files.

long_description  Grok is simple software that allows you to easily parse logs \
                  and other files. You teach grok how to parse data through the \
                  config file. Grok is a system for reacting to events - those events \
                  being log entries.

homepage          http://www.semicomplete.com/projects/grok/

master_sites      http://semicomplete.googlecode.com/files/
checksums         md5 629465d284de11c37a644cab970be432 \
                  sha1 bfc8db7be17f1bb52f2b930dfe284a0db8595b35 \
                  rmd160 8b9f6f27e85700f7f227bd3a6f5b9925de82e8e9

patchfiles        patch-Makefile.diff
post-patch {
   reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/Makefile
}

depends_build     port:bison \
                  port:flex \
                  port:gperf \
                  port:gmake

depends_run       port:libevent \
                  port:pcre \
                  port:db46

use_configure     no

build.type        gnu
build.args        CFLAGS="`pcre-config --cflags` -I${prefix}/include/db46" LDFLAGS="`pcre-config --libs` -L${prefix}/lib/db46 -levent -ldb -rdynamic"

test.run          yes

destroot.args     PREFIX=${destroot}${prefix} INSTALL_USER=${install.user} INSTALL_GROUP=${install.group}

### TODO: pre-build testing for these dependencies
# Build dependencies:
#   bison        >= 2.3
#   flex         >= 2.5.35
#   gperf        >= 3.0
#   GNU make     >= 3.81 
# 
# Run dependencies:
#   libevent     >= 1.3 (older versions may work)
#   libpcre      >= 7.6
#   Berkeley DB  >= 4.5
# 
# Test suite dependencies:
#   CUnit        >= 2.1
