diff options
author | fhajny <fhajny@pkgsrc.org> | 2014-02-17 11:21:54 +0000 |
---|---|---|
committer | fhajny <fhajny@pkgsrc.org> | 2014-02-17 11:21:54 +0000 |
commit | 818cbbe781da5729a589180e3c16bb532a321891 (patch) | |
tree | ffe2346509020ae9229eb26802e9c11f844054c9 /sysutils | |
parent | 67696a4372cb632ca4103fc28441561adde87d30 (diff) | |
download | pkgsrc-818cbbe781da5729a589180e3c16bb532a321891.tar.gz |
Import collectd-5.4.1 as sysutils/collectd (+ plugins), based on wip/collectd5.
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.
Diffstat (limited to 'sysutils')
37 files changed, 707 insertions, 0 deletions
diff --git a/sysutils/collectd-amqp/DESCR b/sysutils/collectd-amqp/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-amqp/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-amqp/Makefile b/sysutils/collectd-amqp/Makefile new file mode 100644 index 00000000000..4b8916e9039 --- /dev/null +++ b/sysutils/collectd-amqp/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= amqp + +COMMENT= Statistics collection daemon - amqp plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-librabbitmq=${BUILDLINK_PREFIX.rabbitmq-c} + +.include "../../net/rabbitmq-c/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-curl/DESCR b/sysutils/collectd-curl/DESCR new file mode 100644 index 00000000000..d9f5fdb060c --- /dev/null +++ b/sysutils/collectd-curl/DESCR @@ -0,0 +1,2 @@ +CURL-based plugins for collectd (curl, curl_json, curl_xml, +apache, bind, nginx, write_http). diff --git a/sysutils/collectd-curl/Makefile b/sysutils/collectd-curl/Makefile new file mode 100644 index 00000000000..f428ab437c8 --- /dev/null +++ b/sysutils/collectd-curl/Makefile @@ -0,0 +1,18 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= curl +COLLECTD_PLUGINS= curl curl_json curl_xml apache bind nginx write_http + +COMMENT= Statistics collection daemon - curl-based plugins + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libcurl=${BUILDLINK_PREFIX.curl} +CONFIGURE_ARGS+= --with-libyajl=${BUILDLINK_PREFIX.yajl} +CONFIGURE_ARGS+= --with-libxml2=${BUILDLINK_PREFIX.libxml2} + +.include "../../devel/yajl/buildlink3.mk" +.include "../../textproc/libxml2/buildlink3.mk" +.include "../../www/curl/buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-dbi/DESCR b/sysutils/collectd-dbi/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-dbi/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-dbi/Makefile b/sysutils/collectd-dbi/Makefile new file mode 100644 index 00000000000..b8c648fb4c4 --- /dev/null +++ b/sysutils/collectd-dbi/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= dbi + +COMMENT= Statistics collection daemon - dbi plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libdbi=${BUILDLINK_PREFIX.libdbi} + +.include "../../databases/libdbi/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-dns/DESCR b/sysutils/collectd-dns/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-dns/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-dns/Makefile b/sysutils/collectd-dns/Makefile new file mode 100644 index 00000000000..f3d93a455ed --- /dev/null +++ b/sysutils/collectd-dns/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= dns + +COMMENT= Statistics collection daemon - dns plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libpcap=${BUILDLINK_PREFIX.libpcap} + +.include "../../net/libpcap/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-memcached/DESCR b/sysutils/collectd-memcached/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-memcached/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-memcached/Makefile b/sysutils/collectd-memcached/Makefile new file mode 100644 index 00000000000..c17a5f118e9 --- /dev/null +++ b/sysutils/collectd-memcached/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= memcached +COLLECTD_PLUGINS= memcachec memcached + +COMMENT= Statistics collection daemon - memcached plugins + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libmemcached=${BUILDLINK_PREFIX.libmemcached} + +.include "../../devel/libmemcached/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-mysql/DESCR b/sysutils/collectd-mysql/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-mysql/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-mysql/Makefile b/sysutils/collectd-mysql/Makefile new file mode 100644 index 00000000000..6a6ad42f8c8 --- /dev/null +++ b/sysutils/collectd-mysql/Makefile @@ -0,0 +1,14 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= mysql + +PKGNAME= ${DISTNAME:S/collectd/collectd-${COLLECTD_PACKAGE}${MYSQL_VERSION}/} +COMMENT= Statistics collection daemon - mysql plugin + +.include "../../sysutils/collectd/Makefile.common" + + +CONFIGURE_ARGS+= --with-libmysql=${BUILDLINK_PREFIX.mysql-client} + +.include "../../mk/mysql.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-network/DESCR b/sysutils/collectd-network/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-network/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-network/Makefile b/sysutils/collectd-network/Makefile new file mode 100644 index 00000000000..62611e3f4c1 --- /dev/null +++ b/sysutils/collectd-network/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= network + +COMMENT= Statistics collection daemon - network plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libgcrypt=${BUILDLINK_PREFIX.libgcrypt} + +.include "../../security/libgcrypt/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-notify-email/DESCR b/sysutils/collectd-notify-email/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-notify-email/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-notify-email/Makefile b/sysutils/collectd-notify-email/Makefile new file mode 100644 index 00000000000..d2102a5e07f --- /dev/null +++ b/sysutils/collectd-notify-email/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= notify-email + +COMMENT= Statistics collection daemon - notify_email plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libesmtp=${BUILDLINK_PREFIX.libesmtp} + +.include "../../mail/libesmtp/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-postgresql/DESCR b/sysutils/collectd-postgresql/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-postgresql/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-postgresql/Makefile b/sysutils/collectd-postgresql/Makefile new file mode 100644 index 00000000000..eb06ca331c8 --- /dev/null +++ b/sysutils/collectd-postgresql/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= postgresql + +PKGNAME= ${DISTNAME:S/collectd/collectd-${COLLECTD_PACKAGE}${PGSQL_VERSION}/} +COMMENT= Statistics collection daemon - postgresql plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libpq=${PGSQL_PREFIX} + +.include "../../mk/pgsql.buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-rrdtool/DESCR b/sysutils/collectd-rrdtool/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-rrdtool/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-rrdtool/Makefile b/sysutils/collectd-rrdtool/Makefile new file mode 100644 index 00000000000..fd106f05ba2 --- /dev/null +++ b/sysutils/collectd-rrdtool/Makefile @@ -0,0 +1,13 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= rrdtool +COLLECTD_PLUGINS= rrdtool rrdcached + +COMMENT= Statistics collection daemon - rrdtool plugins + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-librrd=${BUILDLINK_PREFIX.rrdtool} + +.include "../../databases/rrdtool/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd-snmp/DESCR b/sysutils/collectd-snmp/DESCR new file mode 100644 index 00000000000..cbe65e7c90d --- /dev/null +++ b/sysutils/collectd-snmp/DESCR @@ -0,0 +1 @@ +rrdtool plugin for collectd diff --git a/sysutils/collectd-snmp/Makefile b/sysutils/collectd-snmp/Makefile new file mode 100644 index 00000000000..bafcb032ea9 --- /dev/null +++ b/sysutils/collectd-snmp/Makefile @@ -0,0 +1,12 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +COLLECTD_PACKAGE= snmp + +COMMENT= Statistics collection daemon - snmp plugin + +.include "../../sysutils/collectd/Makefile.common" + +CONFIGURE_ARGS+= --with-libnetsnmp=${BUILDLINK_PREFIX.net-snmp}/bin/net-snmp-config + +.include "../../net/net-snmp/buildlink3.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd/DESCR b/sysutils/collectd/DESCR new file mode 100644 index 00000000000..2fea5731169 --- /dev/null +++ b/sysutils/collectd/DESCR @@ -0,0 +1,3 @@ +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. diff --git a/sysutils/collectd/Makefile b/sysutils/collectd/Makefile new file mode 100644 index 00000000000..140f1cfd951 --- /dev/null +++ b/sysutils/collectd/Makefile @@ -0,0 +1,40 @@ +# $NetBSD: Makefile,v 1.1 2014/02/17 11:21:54 fhajny Exp $ +# + +.include "../../sysutils/collectd/Makefile.common" + +COMMENT= Statistics collection daemon base + +RCD_SCRIPTS= collectd + +.include "../../mk/bsd.prefs.mk" + +# Simple plugins that have no dependencies +DEFAULT_PLUGINS+= aggregation apcups csv email exec filecount \ + hddtemp logfile match_empty_counter match_hashed\ + match_regex match_timediff match_value mbmon \ + ntpd olsrd openvpn powerdns statsd table tail \ + tail_csv target_notification target_replace \ + target_scale target_set target_v5upgrade \ + teamspeak2 threshold unixsock uuid write_graphite + +.for option in ${DEFAULT_PLUGINS} +CONFIGURE_ARGS+= --enable-${option} +.endfor + +.include "options.mk" + +CONF_FILES+= share/examples/collectd/collectd.conf \ + ${PKG_SYSCONFDIR}/collectd.conf + +OWN_DIRS+= ${VARBASE}/db/collectd + +COLLECTD_USER?= collectd +COLLECTD_GROUP?= ${COLLECTD_USER} +PKG_USERS_VARS+= COLLECTD_USER +PKG_GROUPS_VARS+= COLLECTD_GROUP +PKG_GROUPS= ${COLLECTD_GROUP} +PKG_USERS= ${COLLECTD_USER}:${COLLECTD_GROUP} +PKG_GECOS.${COLLECTD_USER}= collectd unprivileged user + +.include "../../mk/bsd.pkg.mk" diff --git a/sysutils/collectd/Makefile.common b/sysutils/collectd/Makefile.common new file mode 100644 index 00000000000..e0a1ae60b09 --- /dev/null +++ b/sysutils/collectd/Makefile.common @@ -0,0 +1,72 @@ +# $NetBSD: Makefile.common,v 1.1 2014/02/17 11:21:54 fhajny Exp $ +# +# used by sysutils/collectd/Makefile +# used by sysutils/collectd-amqp/Makefile +# used by sysutils/collectd-curl/Makefile +# used by sysutils/collectd-dbi/Makefile +# used by sysutils/collectd-dns/Makefile +# used by sysutils/collectd-memcached/Makefile +# used by sysutils/collectd-mysql/Makefile +# used by sysutils/collectd-network/Makefile +# used by sysutils/collectd-notify-email/Makefile +# used by sysutils/collectd-postgresql/Makefile +# used by sysutils/collectd-rrdtool/Makefile +# used by sysutils/collectd-snmp/Makefile + +DISTNAME= collectd-5.4.1 +MASTER_SITES= http://collectd.org/files/ +CATEGORIES= sysutils + +MAINTAINER= filip@joyent.com +HOMEPAGE= http://collectd.org/ +LICENSE= gnu-gpl-v2 + +GNU_CONFIGURE= yes +USE_LIBTOOL= yes +USE_TOOLS+= pkg-config +USE_LANGUAGES= c c++ + +DISTINFO_FILE= ${.CURDIR}/../../sysutils/collectd/distinfo +PATCHDIR= ${.CURDIR}/../../sysutils/collectd/patches + +.if !empty(COLLECTD_PACKAGE) +PKGNAME?= ${DISTNAME:S/collectd/collectd-${COLLECTD_PACKAGE}/} + +DEPENDS+= ${DISTNAME}:../../sysutils/collectd + +COLLECTD_PLUGINS?= ${COLLECTD_PACKAGE:S/-/_/} + +BUILD_DIRS= src +BUILD_TARGET= ${COLLECTD_PLUGINS:S/$/.la/} +INSTALL_DIRS= src +INSTALL_TARGET= install-pkglibLTLIBRARIES +. for plugin in ${COLLECTD_PLUGINS} +CONFIGURE_ARGS+= --enable-${plugin} +GENERATE_PLIST+= ${ECHO} "lib/collectd/${plugin}.la"; +. endfor +.endif + +.include "../../mk/bsd.prefs.mk" + +BUILD_DEFS+= VARBASE + +# Disable all libs support by default +DISABLED_LIBS= aquaero5 credis curl dbi esmtp ganglia gcrypt \ + iptc lvm2app memcached mnl modbus mongoc mysql \ + netsnmp notify oping owcapi pcap perl pq \ + rabbitmq routeros rrd sensors sigrok statgrab \ + tokyotyrant upsclient varnish xml2 xmms yajl +CONFIGURE_ARGS+= --with-java=no --with-mic=no --with-oracle=no \ + --with-perl-bindings=no --with-python=no \ + --disable-all-plugins +.for lib in ${DISABLED_LIBS} +CONFIGURE_ARGS+= --with-lib${lib}=no +.endfor +CONFIGURE_ARGS+= --localstatedir=${VARBASE} +CONFIGURE_ARGS+= --with-ltdl-lib=${BUILDLINK_PREFIX.libltdl}/lib +CONFIGURE_ARGS+= --with-ltdl-include=${BUILDLINK_PREFIX.libltdl}/include + +CPPFLAGS.SunOS+= -D__EXTENSIONS__ -DSOLARIS2=11 + +.include "../../devel/libltdl/buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" diff --git a/sysutils/collectd/PLIST b/sysutils/collectd/PLIST new file mode 100644 index 00000000000..ef0ed566c73 --- /dev/null +++ b/sysutils/collectd/PLIST @@ -0,0 +1,83 @@ +@comment $NetBSD: PLIST,v 1.1 2014/02/17 11:21:54 fhajny Exp $ +bin/collectd-nagios +bin/collectd-tg +bin/collectdctl +include/collectd/client.h +include/collectd/lcc_features.h +include/collectd/network.h +include/collectd/network_buffer.h +lib/collectd/aggregation.la +lib/collectd/apcups.la +${PLIST.apple-sensors}lib/collectd/apple_sensors.la +${PLIST.battery}lib/collectd/battery.la +${PLIST.contextswitch}lib/collectd/contextswitch.la +${PLIST.cpu}lib/collectd/cpu.la +lib/collectd/csv.la +${PLIST.df}lib/collectd/df.la +${PLIST.disk}lib/collectd/disk.la +lib/collectd/email.la +lib/collectd/exec.la +lib/collectd/filecount.la +lib/collectd/hddtemp.la +${PLIST.interface}lib/collectd/interface.la +${PLIST.load}lib/collectd/load.la +lib/collectd/logfile.la +lib/collectd/match_empty_counter.la +lib/collectd/match_hashed.la +lib/collectd/match_regex.la +lib/collectd/match_timediff.la +lib/collectd/match_value.la +lib/collectd/mbmon.la +${PLIST.memory}lib/collectd/memory.la +${PLIST.nfs}lib/collectd/nfs.la +lib/collectd/ntpd.la +lib/collectd/olsrd.la +lib/collectd/openvpn.la +${PLIST.perl}lib/collectd/perl.la +${PLIST.pf}lib/collectd/pf.la +lib/collectd/powerdns.la +${PLIST.processes}lib/collectd/processes.la +${PLIST.python}lib/collectd/python.la +lib/collectd/statsd.la +${PLIST.swap}lib/collectd/swap.la +${PLIST.syslog}lib/collectd/syslog.la +lib/collectd/table.la +lib/collectd/tail.la +lib/collectd/tail_csv.la +lib/collectd/target_notification.la +lib/collectd/target_replace.la +lib/collectd/target_scale.la +lib/collectd/target_set.la +lib/collectd/target_v5upgrade.la +lib/collectd/teamspeak2.la +${PLIST.tcpconns}lib/collectd/tcpconns.la +lib/collectd/threshold.la +lib/collectd/unixsock.la +${PLIST.uptime}lib/collectd/uptime.la +${PLIST.users}lib/collectd/users.la +lib/collectd/uuid.la +lib/collectd/write_graphite.la +${PLIST.zfs-arc}lib/collectd/zfs_arc.la +lib/libcollectdclient.la +lib/pkgconfig/libcollectdclient.pc +man/man1/collectd-nagios.1 +man/man1/collectd-tg.1 +man/man1/collectd.1 +man/man1/collectdctl.1 +man/man1/collectdmon.1 +man/man5/collectd-email.5 +man/man5/collectd-exec.5 +man/man5/collectd-java.5 +man/man5/collectd-perl.5 +man/man5/collectd-python.5 +man/man5/collectd-snmp.5 +man/man5/collectd-threshold.5 +man/man5/collectd-unixsock.5 +man/man5/collectd.conf.5 +man/man5/types.db.5 +sbin/collectd +sbin/collectdmon +share/collectd/postgresql_default.conf +share/collectd/types.db +share/examples/collectd/collectd.conf +share/examples/rc.d/collectd diff --git a/sysutils/collectd/distinfo b/sysutils/collectd/distinfo new file mode 100644 index 00000000000..2fbaccb9cb5 --- /dev/null +++ b/sysutils/collectd/distinfo @@ -0,0 +1,13 @@ +$NetBSD: distinfo,v 1.1 2014/02/17 11:21:54 fhajny Exp $ + +SHA1 (collectd-5.4.1.tar.gz) = faaccac4daf48449bcefc9d6f9236f98a5dd5b4b +RMD160 (collectd-5.4.1.tar.gz) = a98ff2d845238d4792f732aa7518effdc95e24f9 +Size (collectd-5.4.1.tar.gz) = 1894132 bytes +SHA1 (patch-Makefile.in) = 197307399312fa26c71ca168b92bbe41d31d556d +SHA1 (patch-configure) = 34bb022fbe3b3b072a6ea5d86de0711a37ebfa0f +SHA1 (patch-src_Makefile.in) = 3d227fa1c483944f44b11e49cabb6390ab3b8338 +SHA1 (patch-src_collectd.c) = 31106ca27dd4911c40285fece48f76a1c36e2407 +SHA1 (patch-src_collectd.conf.in) = 97400dbc16a31a440750beed0bc16927afdcb570 +SHA1 (patch-src_df.c) = 19cca888b183a90759b359702e4d65c8afa6e58d +SHA1 (patch-src_libcollectclient_network__buffer.c) = e07d403d299613fa0885a0e7285849eb85510253 +SHA1 (patch-src_network.c) = 03ed5169903bb579470e77228400dec077ff16cb diff --git a/sysutils/collectd/files/collectd.sh b/sysutils/collectd/files/collectd.sh new file mode 100644 index 00000000000..5c7b3b48627 --- /dev/null +++ b/sysutils/collectd/files/collectd.sh @@ -0,0 +1,26 @@ +#!@RCD_SCRIPTS_SHELL@ +# +# $NetBSD: collectd.sh,v 1.1 2014/02/17 11:21:55 fhajny Exp $ +# +# PROVIDE: collectd +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# You will need to set some variables in /etc/rc.conf to start collectd: +# +# collectd=YES +# + +if [ -f /etc/rc.subr ] +then + . /etc/rc.subr +fi + +name="collectd" +rcvar=${name} +command=@PREFIX@/sbin/collectd +pidfile="@VARBASE@/run/collectd.pid" +required_files=@PKG_SYSCONFDIR@/collectd.conf + +load_rc_config ${name} +run_rc_command "$1" diff --git a/sysutils/collectd/options.mk b/sysutils/collectd/options.mk new file mode 100644 index 00000000000..0f181f67497 --- /dev/null +++ b/sysutils/collectd/options.mk @@ -0,0 +1,54 @@ +# $NetBSD: options.mk,v 1.1 2014/02/17 11:21:54 fhajny Exp $ + +PKG_OPTIONS_VAR= PKG_OPTIONS.collectd +PKG_SUPPORTED_OPTIONS= cpu df interface load memory perl python syslog uptime +PKG_SUGGESTED_OPTIONS+= cpu df interface load memory syslog uptime + +.if ${OPSYS} == "NetBSD" +PKG_SUPPORTED_OPTIONS+= contextswitch pf tcpconns users +PKG_SUGGESTED_OPTIONS+= contextswitch pf tcpconns users +.endif + +.if ${OPSYS} == "FreeBSD" +PKG_SUPPORTED_OPTIONS+= contextswitch pf processes swap tcpconns zfs-arc +PKG_SUGGESTED_OPTIONS+= contextswitch pf processes swap tcpconns zfs-arc +.endif + +.if ${OPSYS} == "Darwin" +PKG_SUPPORTED_OPTIONS+= apple-sensors battery contextswitch disk processes swap \ + tcpconns users +PKG_SUGGESTED_OPTIONS+= apple-sensors battery contextswitch disk processes swap \ + tcpconns users +.endif + +.if ${OPSYS} == "SunOS" +PKG_SUPPORTED_OPTIONS+= disk nfs swap users zfs-arc +PKG_SUGGESTED_OPTIONS+= disk nfs swap users zfs-arc +.endif + +.include "../../mk/bsd.options.mk" + +PLIST_VARS+= apple-sensors battery contextswitch cpu df disk \ + interface load memory nfs perl pf processes python swap \ + syslog tcpconns uptime users zfs-arc + +.for option in ${PLIST_VARS} +. if !empty(PKG_OPTIONS:M${option}) +CONFIGURE_ARGS+= --enable-${option:S/-/_/} +PLIST.${option}= yes +. endif +.endfor + +.if !empty(PKG_OPTIONS:Mperl) +USE_TOOLS+= perl +PERL5_CONFIGURE= no +PERL5_PACKLIST+= auto/Collectd/.packlist +CONFIGURE_ARGS+= --with-libperl=${BUILDLINK_PREFIX.perl} +CONFIGURE_ARGS+= --with-perl-bindings=${MAKE_PARAMS:Q} +. include "../../lang/perl5/module.mk" +.endif + +.if !empty(PKG_OPTIONS:Mpython) +CONFIGURE_ARGS+= --with-python=${PYTHONBIN} +. include "../../lang/python/application.mk" +.endif diff --git a/sysutils/collectd/patches/patch-Makefile.in b/sysutils/collectd/patches/patch-Makefile.in new file mode 100644 index 00000000000..911a9aa890c --- /dev/null +++ b/sysutils/collectd/patches/patch-Makefile.in @@ -0,0 +1,14 @@ +$NetBSD: patch-Makefile.in,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Use a reasonable db dir. +--- Makefile.in.orig 2014-01-26 08:09:57.577219038 +0000 ++++ Makefile.in +@@ -882,7 +882,7 @@ uninstall-am: + + install-exec-hook: + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/run +- $(mkinstalldirs) $(DESTDIR)$(localstatedir)/lib/$(PACKAGE_NAME) ++ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/db/$(PACKAGE_NAME) + $(mkinstalldirs) $(DESTDIR)$(localstatedir)/log + + maintainer-clean-local: diff --git a/sysutils/collectd/patches/patch-configure b/sysutils/collectd/patches/patch-configure new file mode 100644 index 00000000000..ab085689a0d --- /dev/null +++ b/sysutils/collectd/patches/patch-configure @@ -0,0 +1,29 @@ +$NetBSD: patch-configure,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Remove m4 cruft. +--- configure.orig 2014-01-26 08:10:00.249270750 +0000 ++++ configure +@@ -18338,19 +18338,19 @@ $as_echo_n "checking if have htonll defi + have_htonll="no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-[ ++ + #include <sys/types.h> + #include <netinet/in.h> + #if HAVE_INTTYPES_H + # include <inttypes.h> + #endif +-] ++ + int + main () + { +-[ ++ + return htonll(0); +-] ++ + + ; + return 0; diff --git a/sysutils/collectd/patches/patch-src_Makefile.in b/sysutils/collectd/patches/patch-src_Makefile.in new file mode 100644 index 00000000000..b82d90e8564 --- /dev/null +++ b/sysutils/collectd/patches/patch-src_Makefile.in @@ -0,0 +1,48 @@ +$NetBSD: patch-src_Makefile.in,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Use a reasonable db dir. +Install config file into examples. +--- src/Makefile.in.orig 2014-01-26 08:09:56.685201776 +0000 ++++ src/Makefile.in +@@ -2230,6 +2230,7 @@ srcdir = @srcdir@ + subdirs = @subdirs@ + sys_symbol_underscore = @sys_symbol_underscore@ + sysconfdir = @sysconfdir@ ++egdir = @exec_prefix@/share/examples/@PACKAGE@ + target_alias = @target_alias@ + top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ +@@ -2239,7 +2240,7 @@ SUBDIRS = libcollectdclient $(am__append + AM_CPPFLAGS = -DPREFIX='"${prefix}"' \ + -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"' \ + -DLOCALSTATEDIR='"${localstatedir}"' \ +- -DPKGLOCALSTATEDIR='"${localstatedir}/lib/${PACKAGE_NAME}"' \ ++ -DPKGLOCALSTATEDIR='"${localstatedir}/db/${PACKAGE_NAME}"' \ + $(am__append_2) -DPLUGINDIR='"${pkglibdir}"' \ + -DPKGDATADIR='"${pkgdatadir}"' + collectd_SOURCES = collectd.c collectd.h \ +@@ -4856,13 +4857,8 @@ uninstall-man: uninstall-man1 uninstall- + @HAVE_PROTOC_C_TRUE@ protoc-c -I$(srcdir) --c_out . $(srcdir)/riemann.proto + + install-exec-hook: +- $(mkinstalldirs) $(DESTDIR)$(sysconfdir) +- if test -e $(DESTDIR)$(sysconfdir)/collectd.conf; \ +- then \ +- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf.pkg-orig; \ +- else \ +- $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(sysconfdir)/collectd.conf; \ +- fi; \ ++ $(mkinstalldirs) $(DESTDIR)$(egdir) ++ $(INSTALL) -m 0640 collectd.conf $(DESTDIR)$(egdir)/collectd.conf; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(INSTALL) -m 0644 $(srcdir)/types.db $(DESTDIR)$(pkgdatadir)/types.db; + $(INSTALL) -m 0644 $(srcdir)/postgresql_default.conf \ +@@ -4870,7 +4866,7 @@ install-exec-hook: + + uninstall-hook: + rm -f $(DESTDIR)$(pkgdatadir)/types.db; +- rm -f $(DESTDIR)$(sysconfdir)/collectd.conf ++ rm -f $(DESTDIR)$(egdir)/collectd.conf + rm -f $(DESTDIR)$(pkgdatadir)/postgresql_default.conf; + + # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/sysutils/collectd/patches/patch-src_collectd.c b/sysutils/collectd/patches/patch-src_collectd.c new file mode 100644 index 00000000000..9bd9829e545 --- /dev/null +++ b/sysutils/collectd/patches/patch-src_collectd.c @@ -0,0 +1,14 @@ +$NetBSD: patch-src_collectd.c,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +sg_init() expects an arg. +--- src/collectd.c.orig 2014-01-26 08:09:14.840391576 +0000 ++++ src/collectd.c +@@ -288,7 +288,7 @@ static int do_init (void) + #endif + + #if HAVE_LIBSTATGRAB +- if (sg_init ()) ++ if (sg_init (0)) + { + ERROR ("sg_init: %s", sg_str_error (sg_get_error ())); + return (-1); diff --git a/sysutils/collectd/patches/patch-src_collectd.conf.in b/sysutils/collectd/patches/patch-src_collectd.conf.in new file mode 100644 index 00000000000..c76ec07cf23 --- /dev/null +++ b/sysutils/collectd/patches/patch-src_collectd.conf.in @@ -0,0 +1,94 @@ +$NetBSD: patch-src_collectd.conf.in,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Fix default dirs. +--- src/collectd.conf.in.orig 2014-01-26 08:09:23.516559631 +0000 ++++ src/collectd.conf.in +@@ -12,7 +12,7 @@ + + #Hostname "localhost" + #FQDNLookup true +-#BaseDir "@localstatedir@/lib/@PACKAGE_NAME@" ++#BaseDir "@localstatedir@/db/@PACKAGE_NAME@" + #PIDFile "@localstatedir@/run/@PACKAGE_NAME@.pid" + #PluginDir "@libdir@/@PACKAGE_NAME@" + #TypesDB "@prefix@/share/@PACKAGE_NAME@/types.db" +@@ -278,7 +278,7 @@ + #</Plugin> + + #<Plugin csv> +-# DataDir "@localstatedir@/lib/@PACKAGE_NAME@/csv" ++# DataDir "@localstatedir@/db/@PACKAGE_NAME@/csv" + # StoreRates false + #</Plugin> + +@@ -566,7 +566,7 @@ + # + # <Database db_name2> + # Host "localhost" +-# Socket "/var/run/mysql/mysqld.sock" ++# Socket "@localstatedir@/run/mysql/mysqld.sock" + # SlaveStats true + # SlaveNotifications true + # </Database> +@@ -827,14 +827,14 @@ + # <Server "server_name"> + # Collect "latency" + # Collect "udp-answers" "udp-queries" +-# Socket "/var/run/pdns.controlsocket" ++# Socket "@localstatedir@/run/pdns.controlsocket" + # </Server> + # <Recursor "recursor_name"> + # Collect "questions" + # Collect "cache-hits" "cache-misses" +-# Socket "/var/run/pdns_recursor.controlsocket" ++# Socket "@localstatedir@/run/pdns_recursor.controlsocket" + # </Recursor> +-# LocalSocket "/opt/collectd/var/run/collectd-powerdns" ++# LocalSocket "@localstatedir@/run/collectd-powerdns" + #</Plugin> + + #<Plugin processes> +@@ -882,14 +882,14 @@ + + #<Plugin rrdcached> + # DaemonAddress "unix:/tmp/rrdcached.sock" +-# DataDir "@localstatedir@/lib/@PACKAGE_NAME@/rrd" ++# DataDir "@localstatedir@/db/@PACKAGE_NAME@/rrd" + # CreateFiles true + # CreateFilesAsync false + # CollectStatistics true + #</Plugin> + + #<Plugin rrdtool> +-# DataDir "@localstatedir@/lib/@PACKAGE_NAME@/rrd" ++# DataDir "@localstatedir@/db/@PACKAGE_NAME@/rrd" + # CreateFilesAsync false + # CacheTimeout 120 + # CacheFlush 900 +@@ -994,7 +994,7 @@ + #</Plugin> + + #<Plugin "tail"> +-# <File "/var/log/exim4/mainlog"> ++# <File "@localstatedir@/log/exim4/mainlog"> + # Instance "exim" + # <Match> + # Regex "S=([1-9][0-9]*)" +@@ -1031,7 +1031,7 @@ + # Type "kpackets_wire_per_sec.realtime" + # ValueFrom 4 + # </Metric> +-# <File "/var/log/snort/snort.stats"> ++# <File "@localstatedir@/log/snort/snort.stats"> + # Instance "snort-eth0" + # Interval 600 + # Collect "dropped" "mbps" "alerts" "kpps" +@@ -1068,7 +1068,7 @@ + #</Plugin> + + #<Plugin unixsock> +-# SocketFile "@prefix@/var/run/@PACKAGE_NAME@-unixsock" ++# SocketFile "@localstatedir@/run/@PACKAGE_NAME@-unixsock" + # SocketGroup "collectd" + # SocketPerms "0660" + # DeleteSocket false diff --git a/sysutils/collectd/patches/patch-src_df.c b/sysutils/collectd/patches/patch-src_df.c new file mode 100644 index 00000000000..353454c15ba --- /dev/null +++ b/sysutils/collectd/patches/patch-src_df.c @@ -0,0 +1,16 @@ +$NetBSD: patch-src_df.c,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +NetBSD doesn't have float_t. +--- src/df.c.orig 2014-01-26 08:09:14.856391886 +0000 ++++ src/df.c +@@ -28,6 +28,10 @@ + #include "utils_mount.h" + #include "utils_ignorelist.h" + ++#if defined(__NetBSD__) ++typedef float float_t; ++#endif ++ + #if HAVE_STATVFS + # if HAVE_SYS_STATVFS_H + # include <sys/statvfs.h> diff --git a/sysutils/collectd/patches/patch-src_libcollectclient_network__buffer.c b/sysutils/collectd/patches/patch-src_libcollectclient_network__buffer.c new file mode 100644 index 00000000000..b8194f2cb6a --- /dev/null +++ b/sysutils/collectd/patches/patch-src_libcollectclient_network__buffer.c @@ -0,0 +1,23 @@ +$NetBSD: patch-src_libcollectclient_network__buffer.c,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Need the workaround on at least SunOS too. +--- src/libcollectdclient/network_buffer.c.orig 2014-01-26 08:09:14.868392118 +0000 ++++ src/libcollectdclient/network_buffer.c +@@ -37,7 +37,7 @@ + + #if HAVE_LIBGCRYPT + # include <pthread.h> +-# if defined __APPLE__ ++# if defined(__APPLE__) || defined(__sun) + /* default xcode compiler throws warnings even when deprecated functionality + * is not used. -Werror breaks the build because of erroneous warnings. + * http://stackoverflow.com/questions/10556299/compiler-warnings-with-libgcrypt-v1-5-0/12830209#12830209 +@@ -50,7 +50,7 @@ + */ + # define GCRYPT_NO_DEPRECATED + # include <gcrypt.h> +-# if defined __APPLE__ ++# if defined(__APPLE__) || defined(__sun) + /* Re enable deprecation warnings */ + # pragma GCC diagnostic warning "-Wdeprecated-declarations" + # endif diff --git a/sysutils/collectd/patches/patch-src_network.c b/sysutils/collectd/patches/patch-src_network.c new file mode 100644 index 00000000000..96151cfec55 --- /dev/null +++ b/sysutils/collectd/patches/patch-src_network.c @@ -0,0 +1,23 @@ +$NetBSD: patch-src_network.c,v 1.1 2014/02/17 11:21:55 fhajny Exp $ + +Need the workaround on at least SunOS too. +--- src/network.c.orig 2014-01-26 08:09:23.532559941 +0000 ++++ src/network.c +@@ -59,7 +59,7 @@ + + #if HAVE_LIBGCRYPT + # include <pthread.h> +-# if defined __APPLE__ ++# if defined(__APPLE__) || defined(__sun) + /* default xcode compiler throws warnings even when deprecated functionality + * is not used. -Werror breaks the build because of erroneous warnings. + * http://stackoverflow.com/questions/10556299/compiler-warnings-with-libgcrypt-v1-5-0/12830209#12830209 +@@ -72,7 +72,7 @@ + */ + # define GCRYPT_NO_DEPRECATED + # include <gcrypt.h> +-# if defined __APPLE__ ++# if defined(__APPLE__) || defined(__sun) + /* Re enable deprecation warnings */ + # pragma GCC diagnostic warning "-Wdeprecated-declarations" + # endif |