aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sysutils/monitorix/Makefile15
-rw-r--r--sysutils/monitorix/distinfo4
-rw-r--r--sysutils/monitorix/files/patch-monitorix88
-rw-r--r--sysutils/monitorix/pkg-plist1
4 files changed, 25 insertions, 83 deletions
diff --git a/sysutils/monitorix/Makefile b/sysutils/monitorix/Makefile
index 6f1a54d82d7d..d1346bf8e132 100644
--- a/sysutils/monitorix/Makefile
+++ b/sysutils/monitorix/Makefile
@@ -6,10 +6,11 @@
#
PORTNAME= monitorix
-PORTVERSION= 2.1.1
+PORTVERSION= 2.1.2
PORTREVISION?= 0
CATEGORIES= sysutils
MASTER_SITES= http://www.monitorix.org/ \
+ http://www.monitorix.org/old_versions/ \
http://www.bayofrum.net/dist/${PORTNAME}/
MAINTAINER= utisoft@gmail.com
@@ -33,8 +34,8 @@ MANCOMPRESSED= no
NO_BUILD= yes
USE_RC_SUBR= ${PORTNAME}
-CGIDIR?= ${PREFIX}/www/cgi-bin
-CGIPATH?= ${CGIDIR:C,^.*/,/,}
+CGIDIR?= www/cgi-bin
+CGIPATH?= cgi-bin
WWW_OWNER?= ${WWWOWN}
WWW_GROUP?= ${WWWGRP}
REPORT_LANG= ca de en it
@@ -43,7 +44,7 @@ WWWROOT= ${WWWDIR:S,/${PORTNAME}$,,}
SUB_FILES= pkg-message
SUB_LIST= PERL=${PERL}
-PLIST_SUB+= CGIDIR=${CGIDIR:C,^${PREFIX}/,,} \
+PLIST_SUB+= CGIDIR=${CGIDIR} \
WWW_OWNER=${WWW_OWNER} \
WWW_GROUP=${WWW_GROUP}
@@ -80,7 +81,7 @@ post-patch:
# in cgi-bin
.for f in monitorix.cgi monitorix.conf monitorix reports/send_reports
@${REINPLACE_CMD} -e "1s|^\(#!\).*|\1${PERL}|" \
- -e 's|"\(sysctl\)|"/sbin/\1|' \
+ -e 's|"\([^/]sysctl\)|"/sbin/\1|' \
${WRKSRC}/${f}
.endfor
# eth0 doesn't exist in FreeBSD! Also let's set our own paths.
@@ -102,8 +103,8 @@ do-install:
@for f in ${WWW_FILES}; do \
${INSTALL_DATA} ${WRKSRC}/$${f} ${WWWDIR}/; \
done
- @${MKDIR} ${CGIDIR}
- @${INSTALL_SCRIPT} ${WRKSRC}/monitorix.cgi ${CGIDIR}/
+ @${MKDIR} ${PREFIX}/${CGIDIR}
+ @${INSTALL_SCRIPT} ${WRKSRC}/monitorix.cgi ${PREFIX}/${CGIDIR}/
.for m in ${MAN5}
@${INSTALL_MAN} ${WRKSRC}/man/man5/$m ${MAN5PREFIX}/man/man5/
.endfor
diff --git a/sysutils/monitorix/distinfo b/sysutils/monitorix/distinfo
index 6b3b7ca518fa..61e5a2e5b1c9 100644
--- a/sysutils/monitorix/distinfo
+++ b/sysutils/monitorix/distinfo
@@ -1,2 +1,2 @@
-SHA256 (monitorix-2.1.1.tar.gz) = 2419593ae00d2a083e7f5258bfab840b48c87be799e8186a599c0a28f4508e33
-SIZE (monitorix-2.1.1.tar.gz) = 86289
+SHA256 (monitorix-2.1.2.tar.gz) = 7148c01426b0994332d1c4b2f31949ef7845736528aa79f16e4ee2c70e24ac03
+SIZE (monitorix-2.1.2.tar.gz) = 88540
diff --git a/sysutils/monitorix/files/patch-monitorix b/sysutils/monitorix/files/patch-monitorix
index 05eea4ad435c..cd2739bf9ae7 100644
--- a/sysutils/monitorix/files/patch-monitorix
+++ b/sysutils/monitorix/files/patch-monitorix
@@ -1,24 +1,6 @@
---- monitorix.orig 2011-03-09 16:59:52.000000000 +0000
-+++ monitorix 2011-03-27 15:57:13.322625798 +0100
-@@ -47,7 +47,7 @@
- use constant RELDATE => "09-Mar-2011";
-
- my $pid;
--my ($opt_config, $opt_debug, $opt_version);
-+my ($opt_config, $opt_pidfile, $opt_debug, $opt_version);
- my @graphs;
- my $root_disk;
- my $root_disk_p;
-@@ -138,7 +138,7 @@
-
- sub usage {
- print(STDERR << "EOF");
--usage: monitorix -c|--config <config_file> [-d|--debug] [-v|--version]
-+usage: monitorix -c|--config <config_file> [-p|--pidfile <pidfile>] [-d|--debug] [-v|--version]
-
- EOF
- exit(1);
-@@ -1609,10 +1609,8 @@
+--- monitorix.orig 2011-05-04 18:19:58.792045586 +0100
++++ monitorix 2011-05-04 18:46:51.729913889 +0100
+@@ -1654,10 +1654,8 @@
alarm $TIMEOUT;
open(IN, "df -P / |");
while(<IN>) {
@@ -27,70 +9,28 @@
- last;
- }
+ next if /Filesystem/;
-+ @tmp = split;
++ ($root_disk) = split;
}
close(IN);
alarm 0;
-@@ -1693,7 +1691,7 @@
+@@ -1734,9 +1732,8 @@
+ }
}
} elsif($os eq "FreeBSD") {
- $root_disk =~ s/.*\///; # removes /dev/
+- $root_disk =~ s/^.*dev\///; # remove the /dev/ prefix
+-# $root_disk =~ s/.*\///; # removes /dev/
- $root_disk =~ s/...$//; # removes part number
++ $root_disk =~ s/^.dev.//; # remove the /dev/ prefix
+ $root_disk =~ s/[sp][0-9][a-z]?$//; # removes part number
}
- our $fs_hist = 0;
-@@ -1710,10 +1708,8 @@
- alarm $TIMEOUT;
- open(IN, "df -P / |");
- while(<IN>) {
-- if(/dev/ && /\//) {
-- @tmp = split(' ', $_);
-- last;
-- }
-+ next if /Filesystem/;
-+ @tmp = split;
- }
- close(IN);
- alarm 0;
-@@ -3661,6 +3657,7 @@
- # ----------------------------------------------------------------------------
- GetOptions(
- "config=s" => \$opt_config,
-+ "pidfile=s" => \$opt_pidfile,
- "debug" => \$opt_debug,
- "version" => \$opt_version,
- );
-@@ -3681,7 +3678,7 @@
+ # do exists in /proc/diskstats?
+@@ -3766,7 +3763,7 @@
}
# check configuration file syntax
--if(system("perl -wc $opt_config >/dev/null 2>&1")) {
-+if(!system("perl -wc $opt_config >/dev/null 2>&1")) {
- print("FATAL: configuration file '$opt_config' had compilation errors.\n");
+-if(system("perl -wc $opt_c >/dev/null 2>&1")) {
++if(!system("perl -wc $opt_c >/dev/null 2>&1")) {
+ print("FATAL: configuration file '$opt_c' had compilation errors.\n");
exit(1);
}
-@@ -3698,14 +3695,22 @@
- exit(1);
- }
-
--$0 = sprintf("%s %s%s%s",
-+$0 = sprintf("%s %s%s%s%s",
- $^V lt 5.6.2 ? monitorix : abs_path($0),
- $opt_config ? "-c $opt_config" : "",
-+ $opt_pidfile ? "-p $opt_pidfile" : "",
- $opt_debug ? " -d" : "",
- $opt_version ? " -v" : "");
- daemonize();
- logger("Starting Monitorix version " . VERSION . " (pid $pid).");
-
-+if($opt_pidfile = abs_path($opt_pidfile)) {
-+ open(PIDFILE, ">", $opt_pidfile)
-+ || die("could not open $opt_pidfile for writing.");
-+ print(PIDFILE "$pid");
-+ close(PIDFILE);
-+}
-+
- if($opt_debug) {
- logger("Entering in debug mode.");
- logger("Changed process name to '$0'.");
diff --git a/sysutils/monitorix/pkg-plist b/sysutils/monitorix/pkg-plist
index a3153d1b7367..bee30af68949 100644
--- a/sysutils/monitorix/pkg-plist
+++ b/sysutils/monitorix/pkg-plist
@@ -1,3 +1,4 @@
+@stopdaemon monitorix
@exec mkdir -p %D/%%WWWDIR%%/imgs
@exec chown %%WWW_OWNER%%:%%WWW_GROUP%% %D/%%WWWDIR%%/imgs
@unexec if cmp -s %D/etc/monitorix.conf %D/etc/monitorix.conf.sample; then rm -f %D/etc/monitorix.conf; fi