aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2011-05-20 08:49:12 +0800
committerbrooks <brooks@FreeBSD.org>2011-05-20 08:49:12 +0800
commit75d2eee606eab248808bcfda15889cea1d6028fa (patch)
treeedab76b889b1e027975db684f6312f45513197e8
parent71ce50af53d481255862aba019531d8a899d09bf (diff)
downloadfreebsd-ports-gnome-75d2eee606eab248808bcfda15889cea1d6028fa.tar.gz
freebsd-ports-gnome-75d2eee606eab248808bcfda15889cea1d6028fa.tar.zst
freebsd-ports-gnome-75d2eee606eab248808bcfda15889cea1d6028fa.zip
Upgrade to ganglia 6.1.7.
Drop support for early version of 6.x in the rc script support.
-rw-r--r--sysutils/ganglia-monitor-core/Makefile51
-rw-r--r--sysutils/ganglia-monitor-core/distinfo4
-rw-r--r--sysutils/ganglia-monitor-core/files/ganglia.sh.in85
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c.in14
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmetad_server.c49
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmond_modules_conf.d_modpython.conf.in13
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-gmond_modules_python_Makefile.in16
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-lib_default__conf.h.in14
-rw-r--r--sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c94
-rw-r--r--sysutils/ganglia-monitor-core/pkg-plist6
10 files changed, 89 insertions, 257 deletions
diff --git a/sysutils/ganglia-monitor-core/Makefile b/sysutils/ganglia-monitor-core/Makefile
index e97dd30dbf44..42c717b14ec8 100644
--- a/sysutils/ganglia-monitor-core/Makefile
+++ b/sysutils/ganglia-monitor-core/Makefile
@@ -6,8 +6,7 @@
#
PORTNAME= monitor-core
-PORTVERSION= 3.1.1
-PORTREVISION= 7
+PORTVERSION= 3.1.7
CATEGORIES= sysutils net parallel
MASTER_SITES= SF/ganglia/ganglia%20monitoring%20core/${PORTVERSION}%20%28Wien%29
PKGNAMEPREFIX= ganglia-
@@ -31,9 +30,10 @@ USE_AUTOTOOLS= libtool
LIBTOOLFILES= configure libmetrics/configure
GNU_CONFIGURE= yes
-CONFIGURE_ENV= CFLAGS="${_CFLAGS}" LDFLAGS="${_LDFLAGS}"
-_CFLAGS= ${CFLAGS} -I${LOCALBASE}/include ${PTHREAD_CFLAGS}
-_LDFLAGS= ${LDFLAGS} -L${LOCALBASE}/lib
+CONFIGURE_ARGS= --enable-setuid=ganglia --enable-setgid=ganglia
+CONFIGURE_ENV= GANGLIA_ACK_SYSCONFDIR=1 LDFLAGS="${LDFLAGS}"
+CFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
SUB_FILES= pkg-install
@@ -55,17 +55,10 @@ GMOND_CONF= ${WRKDIR}/gmond.conf
.include <bsd.port.pre.mk>
-# The daemons should use seperate scripts, but prior to 6.1 they won't
-# run in the right order. In those cases we use the old monolythic
-# script.
-.if (${OSVERSION} >= 700007 || ( ${OSVERSION} < 700000 && ${OSVERSION} >= 600101))
USE_RC_SUBR= gmond.sh
.if defined (WITH_GMETAD)
USE_RC_SUBR+= gmetad.sh
.endif
-.else
-USE_RC_SUBR= ganglia.sh
-.endif
.if defined (WITH_GMETAD)
LIB_DEPENDS+= rrd:${PORTSDIR}/databases/rrdtool
@@ -88,30 +81,18 @@ MAN5= gmond.conf.5
CONF_DIR= ${PREFIX}/etc
FIX_CONF_FILES= README \
- ganglia.pod \
mans/gmetad.1 \
- mans/gmond.1 \
- gmetad/cmdline.c \
- gmetad/cmdline.h \
- gmond/g25_config.h \
- gmetric/cmdline.c \
- gmetric/cmdline.h \
- gmond/cmdline.c \
- gmond/cmdline.h
-FIX_DB_FILES= ganglia.pod \
- gmetad/conf.c \
- gmetad/gmetad.conf
-FIX_USER_FILES= ganglia.pod \
- gmetad/conf.c.in \
- gmetad/conf.c \
- gmetad/gmetad.conf \
- gmetad/gmetad.conf.in \
+ mans/gmond.1
+FIX_GMOND_CONF_DIR= \
+ gmond/modules/conf.d/modpython.conf.in \
+ gmond/modules/python/Makefile.in \
+ lib/default_conf.h.in
+# gmond.conf.5 and gmond.conf.html can be generated from conf.pod, but
+# doing so requires perl installed in the build stage.
+FIX_USER_FILES= gmetad/gmetad.conf.in \
gmond/conf.pod \
gmond/gmond.conf.5 \
- gmond/gmond.conf.html \
- gmond/g25_config.c \
- lib/libgmond.c \
- lib/default_conf.h.in
+ gmond/gmond.conf.html
MODULES= modcpu.so \
moddisk.so \
@@ -126,8 +107,8 @@ MODULES= modcpu.so \
post-patch:
${REINPLACE_CMD} -e "s|/etc/ganglia/\(gm[a-z]*d.conf\)|${PREFIX}/etc/\1|g" \
${FIX_CONF_FILES:S|^|${WRKSRC}/|}
- ${REINPLACE_CMD} -e "s|/var/lib/ganglia|/var/db/ganglia|g" \
- ${FIX_DB_FILES:S|^|${WRKSRC}/|}
+ ${REINPLACE_CMD} -e "s|%%GMONDCONFDIR%%|gmond.conf.d|g" \
+ ${FIX_GMOND_CONF_DIR:S|^|${WRKSRC}/|}
${REINPLACE_CMD} -e "s|nobody|ganglia|g" \
${FIX_USER_FILES:S|^|${WRKSRC}/|}
diff --git a/sysutils/ganglia-monitor-core/distinfo b/sysutils/ganglia-monitor-core/distinfo
index fa4937d6da16..87fc48a1a64c 100644
--- a/sysutils/ganglia-monitor-core/distinfo
+++ b/sysutils/ganglia-monitor-core/distinfo
@@ -1,2 +1,2 @@
-SHA256 (ganglia-3.1.1.tar.gz) = cc6955f0b086f40dc646e3d0d9f152854d1dcd19dea81b9bff16b38f3819f75c
-SIZE (ganglia-3.1.1.tar.gz) = 1152883
+SHA256 (ganglia-3.1.7.tar.gz) = bb1a4953d72e7dace76010a30d6d332e4ac0991d1371dbbcbcc7b048e0a7e4bf
+SIZE (ganglia-3.1.7.tar.gz) = 1278023
diff --git a/sysutils/ganglia-monitor-core/files/ganglia.sh.in b/sysutils/ganglia-monitor-core/files/ganglia.sh.in
deleted file mode 100644
index 724415f2b0c0..000000000000
--- a/sysutils/ganglia-monitor-core/files/ganglia.sh.in
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# $FreeBSD$
-
-# PROVIDE: ganglia
-# REQUIRE: DAEMON
-# KEYWORD: shutdown
-
-# XXX: This should really be two seperate scripts with rcorder
-# dependencies, but we can't do that at the moment and gmetad doesn't
-# work without a running gmond.
-
-gmond_enable="${gmond_enable-NO}"
-gmond_conf="%%PREFIX%%/etc/gmond.conf"
-
-gmetad_enable="${gmetad_enable-NO}"
-gmetad_conf="%%PREFIX%%/etc/gmetad.conf"
-gmetasnap_enable="${gmetasnap_enable-NO}"
-gmetasnap_rrddir="/var/db/ganglia/rrds"
-gmetasnap_snapdir="/var/db/ganglia/snaps"
-gmetasnap_snapname="snap"
-# gmetasnap_flags=
-gmetasnap_command="%%PREFIX%%/sbin/gmetasnap"
-
-### gmond ###
-
-. /etc/rc.subr
-
-name=gmond
-rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/${name}"
-
-load_rc_config ganglia
-
-load_rc_config $name
-command_args="-c ${gmond_conf}"
-required_files=${gmond_conf}
-
-run_rc_command $*
-
-### gmetad ###
-
-# Don't continue if we didn't run gmond
-if ! checkyesno ${rcvar}; then
- return 0
-fi
-
-name=gmetad
-rcvar=`set_rcvar`
-command="%%PREFIX%%/sbin/${name}"
-start_precmd="gmetad_prestart"
-stop_postcmd="gmetad_poststop"
-
-gmetad_prestart()
-{
- if [ ! -d ${gmetasnap_rrddir} ]; then
- mkdir -p ${gmetasnap_rrddir}
- fi
- chown ganglia:ganglia ${gmetasnap_rrddir}
- if checkyesno gmetasnap_enable; then
- if [ ! -d ${gmetasnap_snapdir} ]; then
- mkdir -p ${gmetasnap_snapdir}
- chown ganglia:ganglia ${gmetasnap_snapdir}
- fi
- if [ `ls ${gmetasnap_rrddir} | egrep -v ^.snap | wc -l` -eq 0 ]; then
- ${gmetasnap_command} -r ${gmetasnap_rrddir} \
- -s ${gmetasnap_snapdir} ${gmetasnap_flags} \
- restore ${gmetasnap_snapname}
- fi
- fi
-}
-
-gmetad_poststop()
-{
- if checkyesno gmetasnap_enable; then
- ${gmetasnap_command} -r ${gmetasnap_rrddir} \
- -s ${gmetasnap_snapdir} ${gmetasnap_flags} \
- save ${gmetasnap_snapname}
- fi
-}
-
-load_rc_config $name
-command_args="-c ${gmetad_conf}"
-required_files=${gmetad_conf}
-
-run_rc_command $*
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c.in b/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c.in
new file mode 100644
index 000000000000..9564fabb410d
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-gmetad_conf.c.in
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- gmetad/conf.c.in.orig
++++ gmetad/conf.c.in
+@@ -274,7 +274,7 @@
+ config->trusted_hosts = NULL;
+ config->debug_level = 0;
+ config->should_setuid = 1;
+- config->setuid_username = "nobody";
++ config->setuid_username = SETUID_USER;
+ config->rrd_rootdir = "@varstatedir@/ganglia/rrds";
+ config->scalable_mode = 1;
+ config->all_trusted = 0;
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmetad_server.c b/sysutils/ganglia-monitor-core/files/patch-gmetad_server.c
deleted file mode 100644
index e94e1c716c5e..000000000000
--- a/sysutils/ganglia-monitor-core/files/patch-gmetad_server.c
+++ /dev/null
@@ -1,49 +0,0 @@
-
-$FreeBSD$
-
---- gmetad/server.c.orig
-+++ gmetad/server.c
-@@ -370,14 +370,13 @@
-
- /* sacerdoti: This function does a tree walk while respecting the filter path.
- * Will return valid XML even if we have chosen a subtree. Since tree depth is
-- * bounded, this function guarantees O(1) search time. The recursive structure
-- * does not require any memory allocations.
-+ * bounded, this function guarantees O(1) search time.
- */
- static int
- process_path (client_t *client, char *path, datum_t *myroot, datum_t *key)
- {
- char *p, *q, *pathend;
-- char element[256];
-+ char *element;
- int rc, len;
- datum_t *found;
- datum_t findkey;
-@@ -419,6 +418,9 @@
- if (!q) q=pathend;
-
- len = q-p;
-+ element = malloc(len + 1);
-+ if ( element == NULL )
-+ return 1;
- strncpy(element, p, len);
- element[len] = '\0';
-
-@@ -440,6 +442,7 @@
- {
- rc = process_path(client, 0, myroot, NULL);
- }
-+ free(element);
- }
- if (rc) return 1;
-
-@@ -537,7 +540,7 @@
- socklen_t len;
- client_t client;
- char remote_ip[16];
-- char request[REQUESTLEN];
-+ char request[REQUESTLEN + 1];
- llist_entry *le;
- datum_t rootdatum;
-
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmond_modules_conf.d_modpython.conf.in b/sysutils/ganglia-monitor-core/files/patch-gmond_modules_conf.d_modpython.conf.in
new file mode 100644
index 000000000000..cf290d63ac92
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-gmond_modules_conf.d_modpython.conf.in
@@ -0,0 +1,13 @@
+
+$FreeBSD$
+
+--- gmond/modules/conf.d/modpython.conf.in.orig
++++ gmond/modules/conf.d/modpython.conf.in
+@@ -13,6 +13,6 @@
+ }
+ }
+
+-include ('@sysconfdir@/conf.d/*.pyconf')
++include ('@sysconfdir@/%%GMONDCONFDIR%%/*.pyconf')
+
+
diff --git a/sysutils/ganglia-monitor-core/files/patch-gmond_modules_python_Makefile.in b/sysutils/ganglia-monitor-core/files/patch-gmond_modules_python_Makefile.in
new file mode 100644
index 000000000000..a0cfb946357c
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-gmond_modules_python_Makefile.in
@@ -0,0 +1,16 @@
+
+$FreeBSD$
+
+--- gmond/modules/python/Makefile.in.orig
++++ gmond/modules/python/Makefile.in
+@@ -538,8 +538,8 @@
+ # Note that README is listed as a dependency to be generated, but it
+ # is not currently installed anywhere
+ install-exec-hook: ../conf.d/modpython.conf README
+- mkdir -p $(DESTDIR)$(sysconfdir)/conf.d && \
+- $(INSTALL_DATA) ../conf.d/modpython.conf $(DESTDIR)$(sysconfdir)/conf.d/modpython.conf
++ mkdir -p $(DESTDIR)$(sysconfdir)/%%GMONDCONFDIR%% && \
++ $(INSTALL_DATA) ../conf.d/modpython.conf $(DESTDIR)$(sysconfdir)/%%GMONDCONFDIR%%/modpython.conf
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff --git a/sysutils/ganglia-monitor-core/files/patch-lib_default__conf.h.in b/sysutils/ganglia-monitor-core/files/patch-lib_default__conf.h.in
new file mode 100644
index 000000000000..db94196198c1
--- /dev/null
+++ b/sysutils/ganglia-monitor-core/files/patch-lib_default__conf.h.in
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- lib/default_conf.h.in.orig
++++ lib/default_conf.h.in
+@@ -111,7 +111,7 @@
+ }\n\
+ }\n\
+ \n\
+-include ('" SYSCONFDIR "/conf.d/*.conf')\n\
++include ('" SYSCONFDIR "/%%GMONDCONFDIR%%/*.conf')\n\
+ \n\
+ /* The old internal 2.5.x metric array has been replaced by the following\n\
+ collection_group directives. What follows is the default behavior for\n\
diff --git a/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c b/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c
index 771b12e776bd..1c94d6f172c4 100644
--- a/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c
+++ b/sysutils/ganglia-monitor-core/files/patch-libmetrics_freebsd_metrics.c
@@ -3,22 +3,14 @@ $FreeBSD$
--- libmetrics/freebsd/metrics.c.orig
+++ libmetrics/freebsd/metrics.c
-@@ -106,7 +106,7 @@
- static size_t mibswap_size;
- static kvm_t *kd = NULL;
- static int pagesize;
--static int skipvfs;
-+static int skipvfs = 1;
-
- /* Function prototypes */
- static long percentages(int cnt, int *out, register long *new,
-@@ -170,6 +170,18 @@
+@@ -170,9 +170,21 @@
size_t len;
uint32_t freq = 0, tmpfreq;
uint64_t tscfreq;
+ unsigned int cpu_freq;
-+
-+ /*
+
+ /*
+- * If the system supports it, the cpufreq driver provides the best
+ * Try the portable sysctl (introduced on ia64).
+ */
+ cpu_freq = 0;
@@ -28,9 +20,12 @@ $FreeBSD$
+ freq = cpu_freq;
+ goto done;
+ }
-
- /*
- * If the system supports it, the cpufreq driver provides the best
++
++ /*
++ * If the system supports it, the cpufreq driver provides
+ * access to CPU frequency. Since we want a constant value, we're
+ * looking for the maximum frequency, not the current one. We
+ * don't know what order the driver will report values in so we
@@ -529,6 +541,17 @@
goto output;
@@ -49,72 +44,3 @@ $FreeBSD$
#ifdef KINFO_PROC_SIZE
state = kp->ki_stat;
#else
-@@ -881,7 +904,6 @@
-
- netvfslist = makenetvfslist();
- vfslist = makevfslist(netvfslist);
-- free(netvfslist);
-
- mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
- mntsize = regetmntinfo(&mntbuf, mntsize, vfslist);
-@@ -899,6 +921,8 @@
- *tot_avail += mntbuf[i].f_bavail / toru;
- }
- }
-+ free(vfslist);
-+ free(netvfslist);
-
- return most_full;
- }
-@@ -955,7 +979,7 @@
- return (NULL);
- if (fslist[0] == 'n' && fslist[1] == 'o') {
- fslist += 2;
-- skipvfs = 1;
-+ skipvfs = 0;
- }
- for (i = 0, nextcp = fslist; *nextcp; nextcp++)
- if (*nextcp == ',')
-@@ -1007,7 +1031,10 @@
- goto done;
- }
-
-- for (cnt = 0; cnt < maxvfsconf; xvfsp++) {
-+ cnt = 0;
-+ for (i = 0; i < maxvfsconf; i++, xvfsp++) {
-+ if (xvfsp->vfc_typenum == 0)
-+ continue;
- if (xvfsp->vfc_flags & VFCF_NONLOCAL)
- continue;
-
-@@ -1057,10 +1084,13 @@
- * Count up the string lengths, we need a extra byte to hold
- * the between entries ',' or the NUL at the end.
- */
-+ slen = 0;
- for (i = 0; i < cnt; i++)
-- slen = strlen(listptr[i]) + 1;
-- /* Add 2 for initial "no". */
-- slen += 2;
-+ slen += strlen(listptr[i]);
-+ /* for ',' */
-+ slen += cnt - 1;
-+ /* Add 3 for initial "no" and the NUL. */
-+ slen += 3;
-
- if ((str = malloc(slen)) == NULL) {
- warnx("malloc failed");
-@@ -1069,10 +1099,11 @@
-
- str[0] = 'n';
- str[1] = 'o';
-- for (i = 0, strptr = str + 2; i < cnt; i++, strptr++) {
-+ for (i = 0, strptr = str + 2; i < cnt; i++) {
-+ if (i > 0)
-+ *strptr++ = ',';
- strcpy(strptr, listptr[i]);
- strptr += strlen(listptr[i]);
-- *strptr = ',';
- }
- *strptr = '\0';
-
diff --git a/sysutils/ganglia-monitor-core/pkg-plist b/sysutils/ganglia-monitor-core/pkg-plist
index 574f81071d1d..ee2bc012b987 100644
--- a/sysutils/ganglia-monitor-core/pkg-plist
+++ b/sysutils/ganglia-monitor-core/pkg-plist
@@ -3,6 +3,7 @@ bin/ganglia-config
bin/gstat
bin/gmetric
@unexec if cmp -s %D/etc/gmond.conf %D/etc/gmond.conf.sample; then rm -f %D/etc/gmond.conf; fi
+etc/gmond.conf.d/modpython.conf
etc/gmond.conf.sample
%%GMETAD%%@unexec if cmp -s %D/etc/gmetad.conf %D/etc/gmetad.conf.sample; then rm -f %D/etc/gmetad.conf; fi
%%GMETAD%%etc/gmetad.conf.sample
@@ -13,8 +14,8 @@ include/gm_metric.h
include/gm_msg.h
include/gm_protocol.h
include/gm_value.h
-lib/libganglia-3.1.1.so
-lib/libganglia-3.1.1.so.0
+lib/libganglia-3.1.7.so
+lib/libganglia-3.1.7.so.0
lib/libganglia.a
lib/libganglia.la
lib/libganglia.so
@@ -30,6 +31,7 @@ lib/ganglia/modsys.so
%%GMETAD%%sbin/gmetad
%%GMETAD%%sbin/gmetasnap
sbin/gmond
+@dirrmtry etc/gmond.conf.d
@dirrm lib/ganglia
@dirrmtry var/db/ganglia/rrds
@dirrmtry var/db/ganglia