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

#####################################################################
# WARNING: Parts of this Portfile are generated by files/dep-gen.sh #
#####################################################################

name                collectd
version             5.12.0
revision            1
categories          sysutils net
license             GPL-2
maintainers         {cal @neverpanic} \
                    {raimue @raimue} \
                    openmaintainer
description         flexible daemon periodically collecting system statistics data
long_description    \
    collectd is a daemon which collects system performance statistics \
    periodically and provides mechanisms to store the values in a variety of \
    ways, for example in RRD files.

homepage            http://collectd.org/
master_sites        http://collectd.org/files/
use_bzip2 yes

checksums           rmd160  9f21d334bbf6a791d3553c16cc533532056cd87f \
                    sha256  5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6 \
                    size    1902756

depends_build       port:pkgconfig

livecheck.type  regex
livecheck.regex ${name}-(\\d+(\\.\\d+)+)\\.tar

use_autoreconf yes
autoreconf.args --install --verbose --force

configure.args \
    --disable-silent-rules \
    --disable-werror

post-destroot {
    fs-traverse f ${destroot}${prefix}/lib/perl5 {
        if {[file isfile $f] && [file tail $f] eq "perllocal.pod"} {
            file delete $f
        }
        if {[file isfile $f] && [file tail $f] eq ".packlist"} {
            reinplace -n "s|${destroot}||p" $f
        }
    }
}

startupitem.create     yes
startupitem.executable ${prefix}/sbin/collectd -f

#######################################################
# WARNING: This list is generated by files/dep-gen.sh #
#          Take care when editing manually!           #
#######################################################

# enable all matches and targets, disable all other plugins
configure.args-append \
    --enable-match_empty_counter \
    --enable-match_hashed \
    --enable-match_regex \
    --enable-match_timediff \
    --enable-match_value \
    --enable-target_notification \
    --enable-target_replace \
    --enable-target_scale \
    --enable-target_set \
    --enable-target_v5upgrade \
    --disable-aggregation \
    --disable-amqp \
    --disable-apache \
    --disable-apcups \
    --disable-apple_sensors \
    --disable-aquaero \
    --disable-ascent \
    --disable-barometer \
    --disable-battery \
    --disable-bind \
    --disable-ceph \
    --disable-cgroups \
    --disable-chrony \
    --disable-conntrack \
    --disable-contextswitch \
    --disable-cpu \
    --disable-cpufreq \
    --disable-cpusleep \
    --disable-csv \
    --disable-curl \
    --disable-curl_json \
    --disable-curl_xml \
    --disable-dbi \
    --disable-df \
    --disable-disk \
    --disable-dns \
    --disable-dpdkevents \
    --disable-dpdkstat \
    --disable-drbd \
    --disable-email \
    --disable-entropy \
    --disable-ethstat \
    --disable-exec \
    --disable-fhcount \
    --disable-filecount \
    --disable-fscache \
    --disable-gmond \
    --disable-gps \
    --disable-grpc \
    --disable-hddtemp \
    --disable-hugepages \
    --disable-intel_pmu \
    --disable-intel_rdt \
    --disable-interface \
    --disable-ipc \
    --disable-ipmi \
    --disable-iptables \
    --disable-ipvs \
    --disable-irq \
    --disable-java \
    --disable-load \
    --disable-log_logstash \
    --disable-logfile \
    --disable-lpar \
    --disable-lua \
    --disable-lvm \
    --disable-madwifi \
    --disable-mbmon \
    --disable-mcelog \
    --disable-md \
    --disable-memcachec \
    --disable-memcached \
    --disable-memory \
    --disable-mic \
    --disable-modbus \
    --disable-mqtt \
    --disable-multimeter \
    --disable-mysql \
    --disable-netapp \
    --disable-netlink \
    --disable-network \
    --disable-nfs \
    --disable-nginx \
    --disable-notify_desktop \
    --disable-notify_email \
    --disable-notify_nagios \
    --disable-ntpd \
    --disable-numa \
    --disable-nut \
    --disable-olsrd \
    --disable-onewire \
    --disable-openldap \
    --disable-openvpn \
    --disable-oracle \
    --disable-ovs_events \
    --disable-ovs_stats \
    --disable-perl \
    --disable-pf \
    --disable-pinba \
    --disable-ping \
    --disable-postgresql \
    --disable-powerdns \
    --disable-processes \
    --disable-protocols \
    --disable-python \
    --disable-redis \
    --disable-routeros \
    --disable-rrdcached \
    --disable-rrdtool \
    --disable-sensors \
    --disable-serial \
    --disable-sigrok \
    --disable-smart \
    --disable-snmp \
    --disable-snmp_agent \
    --disable-statsd \
    --disable-swap \
    --disable-synproxy \
    --disable-syslog \
    --disable-table \
    --disable-tail \
    --disable-tail_csv \
    --disable-tape \
    --disable-tcpconns \
    --disable-teamspeak2 \
    --disable-ted \
    --disable-thermal \
    --disable-threshold \
    --disable-tokyotyrant \
    --disable-turbostat \
    --disable-unixsock \
    --disable-uptime \
    --disable-users \
    --disable-uuid \
    --disable-varnish \
    --disable-virt \
    --disable-vmem \
    --disable-vserver \
    --disable-wireless \
    --disable-write_graphite \
    --disable-write_http \
    --disable-write_kafka \
    --disable-write_log \
    --disable-write_mongodb \
    --disable-write_prometheus \
    --disable-write_redis \
    --disable-write_riemann \
    --disable-write_sensu \
    --disable-write_tsdb \
    --disable-xencpu \
    --disable-xmms \
    --disable-zfs_arc \
    --disable-zone \
    --disable-zookeeper

variant aggregation description {Aggregation plugin} {
    configure.args-replace  --disable-aggregation \
                            --enable-aggregation
}

variant amqp description {AMQP output plugin} {
    configure.args-replace  --disable-amqp \
                            --enable-amqp

    depends_lib-delete port:rabbitmq-c
    depends_lib-append port:rabbitmq-c
}

variant apache description {Apache httpd statistics} {
    configure.args-replace  --disable-apache \
                            --enable-apache

    depends_lib-delete port:curl
    depends_lib-append port:curl
}

variant apcups description {Statistics of UPSes by APC} {
    configure.args-replace  --disable-apcups \
                            --enable-apcups
}

variant apple_sensors description {Apple hardware sensors} {
    configure.args-replace  --disable-apple_sensors \
                            --enable-apple_sensors
}

variant ascent description {AscentEmu player statistics} {
    configure.args-replace  --disable-ascent \
                            --enable-ascent

    depends_lib-delete port:curl port:libxml2
    depends_lib-append port:curl port:libxml2
}

variant barometer description {Barometer sensor on I2C} {
    configure.args-replace  --disable-barometer \
                            --enable-barometer
}

variant battery description {Battery statistics} {
    configure.args-replace  --disable-battery \
                            --enable-battery
}

variant bind description {ISC Bind nameserver statistics} {
    configure.args-replace  --disable-bind \
                            --enable-bind

    depends_lib-delete port:curl port:libxml2
    depends_lib-append port:curl port:libxml2
}

variant ceph description {Ceph daemon statistics} {
    configure.args-replace  --disable-ceph \
                            --enable-ceph

    depends_lib-delete port:yajl
    depends_lib-append port:yajl
}

variant chrony description {Chrony statistics} {
    configure.args-replace  --disable-chrony \
                            --enable-chrony
}

variant contextswitch description {context switch statistics} {
    configure.args-replace  --disable-contextswitch \
                            --enable-contextswitch
}

variant cpu description {CPU usage statistics} {
    configure.args-replace  --disable-cpu \
                            --enable-cpu
}

variant cpusleep description {CPU sleep statistics} {
    configure.args-replace  --disable-cpusleep \
                            --enable-cpusleep
}

variant csv description {CSV output plugin} {
    configure.args-replace  --disable-csv \
                            --enable-csv
}

variant curl description {CURL generic web statistics} {
    configure.args-replace  --disable-curl \
                            --enable-curl

    depends_lib-delete port:curl
    depends_lib-append port:curl
}

variant curl_json description {CouchDB statistics} {
    configure.args-replace  --disable-curl_json \
                            --enable-curl_json

    depends_lib-delete port:curl port:yajl
    depends_lib-append port:curl port:yajl
}

variant curl_xml description {CURL generic xml statistics} {
    configure.args-replace  --disable-curl_xml \
                            --enable-curl_xml

    depends_lib-delete port:curl port:libxml2
    depends_lib-append port:curl port:libxml2
}

variant dbi description {General database statistics} {
    configure.args-replace  --disable-dbi \
                            --enable-dbi

    depends_lib-delete port:libdbi
    depends_lib-append port:libdbi
}

variant df description {Filesystem usage statistics} {
    configure.args-replace  --disable-df \
                            --enable-df
}

variant disk description {Disk usage statistics} {
    configure.args-replace  --disable-disk \
                            --enable-disk
}

variant dns description {DNS traffic analysis} {
    configure.args-replace  --disable-dns \
                            --enable-dns

    depends_lib-delete port:libpcap
    depends_lib-append port:libpcap
}

variant email description {EMail statistics} {
    configure.args-replace  --disable-email \
                            --enable-email
}

variant ethstat description {Stats from NIC driver} {
    configure.args-replace  --disable-ethstat \
                            --enable-ethstat
}

variant exec description {Execution of external programs} {
    configure.args-replace  --disable-exec \
                            --enable-exec
}

variant filecount description {Count files in directories} {
    configure.args-replace  --disable-filecount \
                            --enable-filecount
}

variant gmond description {Ganglia plugin} {
    configure.args-replace  --disable-gmond \
                            --enable-gmond

    depends_lib-delete port:ganglia
    depends_lib-append port:ganglia
}

variant gps description {GPS plugin} {
    configure.args-replace  --disable-gps \
                            --enable-gps
}

variant grpc description {gRPC plugin} {
    configure.args-replace  --disable-grpc \
                            --enable-grpc
}

variant hddtemp description {Query hddtempd} {
    configure.args-replace  --disable-hddtemp \
                            --enable-hddtemp
}

variant interface description {Interface traffic statistics} {
    configure.args-replace  --disable-interface \
                            --enable-interface
}

variant java description {Embed the Java Virtual Machine} {
    configure.args-replace  --disable-java \
                            --enable-java

    pre-configure {
        ui_warn "Compiling with Java will probably fail; if you want to make it work, read `Configuring with libjvm' in README in the upstream git"
    }
}

variant load description {System load} {
    configure.args-replace  --disable-load \
                            --enable-load
}

variant log_logstash description {Logstash json_event compatible logging} {
    configure.args-replace  --disable-log_logstash \
                            --enable-log_logstash

    depends_lib-delete port:yajl
    depends_lib-append port:yajl
}

variant logfile description {File logging plugin} {
    configure.args-replace  --disable-logfile \
                            --enable-logfile
}

variant lpar description {AIX logical partitions statistics} {
    configure.args-replace  --disable-lpar \
                            --enable-lpar
}

variant lua description {Lua plugin} {
    PortGroup lua 1.0

    configure.args-replace  --disable-lua \
                            --enable-lua
}

variant mbmon description {Query mbmond} {
    configure.args-replace  --disable-mbmon \
                            --enable-mbmon
}

variant memcachec description {memcachec statistics} {
    configure.args-replace  --disable-memcachec \
                            --enable-memcachec

    depends_lib-delete port:libmemcached
    depends_lib-append port:libmemcached
}

variant memcached description {memcached statistics} {
    configure.args-replace  --disable-memcached \
                            --enable-memcached

    depends_lib-delete port:libmemcached
    depends_lib-append port:libmemcached
}

variant memory description {Memory usage} {
    configure.args-replace  --disable-memory \
                            --enable-memory
}

variant multimeter description {Read multimeter values} {
    configure.args-replace  --disable-multimeter \
                            --enable-multimeter
}

variant mysql description {MySQL statistics} {
    configure.args-replace  --disable-mysql \
                            --enable-mysql

    depends_lib-delete path:lib/mysql5/mysql/libmysqlclient.dylib:mysql5
    depends_lib-append path:lib/mysql5/mysql/libmysqlclient.dylib:mysql5
}

variant network description {Network communication plugin} {
    configure.args-replace  --disable-network \
                            --enable-network

    # silence a deprecation warning
    configure.cflags-append -D_GCRYPT_IN_LIBGCRYPT=1

    depends_lib-delete port:libgcrypt
    depends_lib-append port:libgcrypt
}

variant nginx description {nginx statistics} {
    configure.args-replace  --disable-nginx \
                            --enable-nginx

    depends_lib-delete port:curl
    depends_lib-append port:curl
}

variant notify_desktop description {Desktop notifications} {
    configure.args-replace  --disable-notify_desktop \
                            --enable-notify_desktop

    depends_lib-delete port:libnotify
    depends_lib-append port:libnotify
}

variant notify_email description {Email notifier} {
    configure.args-replace  --disable-notify_email \
                            --enable-notify_email

    depends_lib-delete port:libesmtp
    depends_lib-append port:libesmtp
}

variant notify_nagios description {Nagios notification plugin} {
    configure.args-replace  --disable-notify_nagios \
                            --enable-notify_nagios

    depends_lib-delete port:nagios
    depends_lib-append port:nagios
}

variant ntpd description {NTPd statistics} {
    configure.args-replace  --disable-ntpd \
                            --enable-ntpd
}

variant numa description {NUMA virtual memory statistics} {
    configure.args-replace  --disable-numa \
                            --enable-numa
}

variant nut description {Network UPS tools statistics} {
    configure.args-replace  --disable-nut \
                            --enable-nut

    depends_lib-delete port:nut
    depends_lib-append port:nut
}

variant olsrd description {olsrd statistics} {
    configure.args-replace  --disable-olsrd \
                            --enable-olsrd
}

variant openldap description {OpenLDAP statistics} {
    configure.args-replace  --disable-openldap \
                            --enable-openldap
}

variant openvpn description {OpenVPN client statistics} {
    configure.args-replace  --disable-openvpn \
                            --enable-openvpn
}

variant perl description {Embed a Perl interpreter} {
    configure.args-replace  --disable-perl \
                            --enable-perl

    configure.args-append --with-perl=${prefix}/bin/perl5.26

    depends_lib-delete port:perl5.26
    depends_lib-append port:perl5.26
}

variant pf description {BSD packet filter (PF) statistics} {
    configure.args-replace  --disable-pf \
                            --enable-pf
}

variant pinba description {Pinba statistics} {
    configure.args-replace  --disable-pinba \
                            --enable-pinba

    depends_lib-delete port:protobuf-c
    depends_lib-append port:protobuf-c
}

variant ping description {Network latency statistics} {
    configure.args-replace  --disable-ping \
                            --enable-ping

    depends_lib-delete port:liboping
    depends_lib-append port:liboping
}

variant postgresql description {PostgreSQL database statistics} {
    configure.args-replace  --disable-postgresql \
                            --enable-postgresql

    configure.cflags-append -I${prefix}/include/postgresql96

    depends_lib-delete port:postgresql96
    depends_lib-append port:postgresql96
}

variant powerdns description {PowerDNS statistics} {
    configure.args-replace  --disable-powerdns \
                            --enable-powerdns
}

variant python description {Embed a Python interpreter} {
    configure.args-replace  --disable-python \
                            --enable-python

    configure.args-append --with-python=${prefix}/bin/python2.7

    depends_lib-delete port:python27
    depends_lib-append port:python27
}

variant rrdcached description {RRDTool output plugin} {
    configure.args-replace  --disable-rrdcached \
                            --enable-rrdcached

    depends_lib-delete port:rrdtool
    depends_lib-append port:rrdtool
}

variant rrdtool description {RRDTool output plugin} {
    configure.args-replace  --disable-rrdtool \
                            --enable-rrdtool

    depends_lib-delete port:rrdtool
    depends_lib-append port:rrdtool
}

variant smart description {SMART statistics} {
    configure.args-replace  --disable-smart \
                            --enable-smart
}

variant snmp description {SNMP querying plugin} {
    configure.args-replace  --disable-snmp \
                            --enable-snmp

    depends_lib-delete port:net-snmp
    depends_lib-append port:net-snmp
}

variant snmp_agent description {SNMP agent plugin} {
    configure.args-replace  --disable-snmp_agent \
                            --enable-snmp_agent

    depends_lib-delete port:net-snmp
    depends_lib-append port:net-snmp
}

variant statsd description {StatsD plugin} {
    configure.args-replace  --disable-statsd \
                            --enable-statsd
}

variant swap description {Swap usage statistics} {
    configure.args-replace  --disable-swap \
                            --enable-swap
}

variant syslog description {Syslog logging plugin} {
    configure.args-replace  --disable-syslog \
                            --enable-syslog
}

variant table description {Parsing of tabular data} {
    configure.args-replace  --disable-table \
                            --enable-table
}

variant tail description {Parsing of logfiles} {
    configure.args-replace  --disable-tail \
                            --enable-tail
}

variant tail_csv description {Parsing of CSV files} {
    configure.args-replace  --disable-tail_csv \
                            --enable-tail_csv
}

variant tcpconns description {TCP connection statistics} {
    configure.args-replace  --disable-tcpconns \
                            --enable-tcpconns
}

variant teamspeak2 description {TeamSpeak2 server statistics} {
    configure.args-replace  --disable-teamspeak2 \
                            --enable-teamspeak2
}

variant ted description {Read The Energy Detective values} {
    configure.args-replace  --disable-ted \
                            --enable-ted
}

variant threshold description {Threshold checking plugin} {
    configure.args-replace  --disable-threshold \
                            --enable-threshold
}

variant tokyotyrant description {TokyoTyrant database statistics} {
    configure.args-replace  --disable-tokyotyrant \
                            --enable-tokyotyrant

    depends_lib-delete port:tokyotyrant
    depends_lib-append port:tokyotyrant
}

variant unixsock description {Unixsock communication plugin} {
    configure.args-replace  --disable-unixsock \
                            --enable-unixsock
}

variant uptime description {Uptime statistics} {
    configure.args-replace  --disable-uptime \
                            --enable-uptime
}

variant users description {User statistics} {
    configure.args-replace  --disable-users \
                            --enable-users
}

variant uuid description {UUID as hostname plugin} {
    configure.args-replace  --disable-uuid \
                            --enable-uuid
}

variant varnish description {Varnish cache statistics} {
    configure.args-replace  --disable-varnish \
                            --enable-varnish

    depends_lib-delete port:varnish
    depends_lib-append port:varnish
}

variant virt description {Virtual machine statistics} {
    configure.args-replace  --disable-virt \
                            --enable-virt

    depends_lib-delete port:libvirt port:libxml2
    depends_lib-append port:libvirt port:libxml2
}

variant write_graphite description {Graphite / Carbon output plugin} {
    configure.args-replace  --disable-write_graphite \
                            --enable-write_graphite
}

variant write_http description {HTTP output plugin} {
    configure.args-replace  --disable-write_http \
                            --enable-write_http

    depends_lib-delete port:curl
    depends_lib-append port:curl
}

variant write_log description {Log output plugin} {
    configure.args-replace  --disable-write_log \
                            --enable-write_log
}

variant write_sensu description {Sensu output plugin} {
    configure.args-replace  --disable-write_sensu \
                            --enable-write_sensu
}

variant write_tsdb description {TSDB output plugin} {
    configure.args-replace  --disable-write_tsdb \
                            --enable-write_tsdb
}

variant zookeeper description {Zookeeper statistics} {
    configure.args-replace  --disable-zookeeper \
                            --enable-zookeeper
}

default_variants \
    +aggregation \
    +apache \
    +apcups \
    +apple_sensors \
    +battery \
    +bind \
    +contextswitch \
    +cpu \
    +csv \
    +curl \
    +curl_xml \
    +df \
    +disk \
    +email \
    +exec \
    +filecount \
    +hddtemp \
    +interface \
    +load \
    +logfile \
    +mbmon \
    +memory \
    +multimeter \
    +network \
    +ntpd \
    +olsrd \
    +openvpn \
    +rrdcached \
    +rrdtool \
    +statsd \
    +swap \
    +syslog \
    +table \
    +tail \
    +tail_csv \
    +tcpconns \
    +teamspeak2 \
    +ted \
    +threshold \
    +unixsock \
    +uptime \
    +users \
    +uuid \
    +write_graphite \
    +write_http

