# -*- 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

PortSystem          1.0

name                libpreludedb
version             5.2.0
revision            1
categories          security
license             GPL-2+
maintainers         {ctreleaven @ctreleaven} openmaintainer
platforms           darwin

description         library for easy access to the Prelude database

long_description \
    Prelude is a Universal "Security Information Management" (SIM) system. \
    Prelude collects, normalizes, sorts, aggregates, correlates and \
    reports all security-related events independently of the product brand \
    or license giving rise to such events.  This port provides an abstract \
    method of accessing various database variants.

homepage            https://www.prelude-siem.org/
master_sites        ${homepage}pkg/src/${version}/

checksums           md5     732c3c67f1a7318d6e64831a2fa5abce \
                    sha1    5d1a37dba8e64fdddd46373da8424ac353443272 \
                    rmd160  bbd43dbc60a34b0dd7e433b12be2c2093c769a0e \
                    sha256  2077e079d8e23e8d39b31a862bcc79fa43b828942e031f6ee57358af4fd5bb0d \
                    size    1372810

depends_lib         port:libprelude

configure.args      --disable-silent-rules \
                    --without-mysql \
                    --without-sqlite3 \
                    --without-postgresql \
                    --without-python2 \
                    --without-python3

# fails to find C++ compiler??
configure.args-append \
                    --disable-easy-bindings
# --with-swig[=PATH]

test.run            yes
test.target         check

default_variants    +sqlite3 +python38

variant python38 description {python v3.8 bindings} {
        configure.args-delete   --without-python3
        configure.args-append   --with-python3=${prefix}/bin/python3.8
        depends_lib-append port:python38
}

variant sqlite3 description {sqlite3 database support} {
        configure.args-replace   --without-sqlite3 --with-sqlite3=${prefix}
        depends_lib-append port:sqlite3
}

#variant mysql5 description {mysql5 database support} {
#        configure.args-delete   --without-mysql
#        configure.args-append   --with-mysql
#        depends_lib-append path:bin/mysql_config5:mysql5
#}

#variant postgresql84 description {postgresql database support} {
#        configure.args-delete   --without-postgresql
#        configure.args-append   --with-postgresql
#        depends_lib-append port:postgresql84
#}

notes "
You many need to create update a database for Prelude events.  See the ${homepage} \
for configuration documentation. \n Scripts may be found in \n \
${prefix}/share/libpreludedb/classic/"

livecheck.url       ${homepage}projects/prelude/files