aboutsummaryrefslogtreecommitdiffstats
path: root/mail/couriergraph
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2005-12-29 04:51:51 +0800
committeredwin <edwin@FreeBSD.org>2005-12-29 04:51:51 +0800
commit8b3c9abcbae8eb45789dfd044558477968c21d78 (patch)
treeadf5e1f11d7e234c15adfb1c22aa4c4b2d1a8849 /mail/couriergraph
parent8db15834c5b3c9fe81d230715f188f6a0832a697 (diff)
downloadfreebsd-ports-gnome-8b3c9abcbae8eb45789dfd044558477968c21d78.tar.gz
freebsd-ports-gnome-8b3c9abcbae8eb45789dfd044558477968c21d78.tar.zst
freebsd-ports-gnome-8b3c9abcbae8eb45789dfd044558477968c21d78.zip
[NEW PORT] mail/couriergraph: A RRDtool frontend for Courier statistics
Couriergraph is a very simple mail statistics RRDtool frontend for Postfix that produces daily, weekly, monthly and yearly graphs of Courier's POP3, IMAP, POP3s and IMAPs logins. WWW: http://www.stahl.bau.tu-bs.de/~hildeb/postfix/couriergraph/ PR: ports/85985 Submitted by: Xavier Beaudouin <kiwi@oav.net>
Diffstat (limited to 'mail/couriergraph')
-rw-r--r--mail/couriergraph/Makefile66
-rw-r--r--mail/couriergraph/distinfo3
-rw-r--r--mail/couriergraph/files/couriergraph.sh.in39
-rw-r--r--mail/couriergraph/files/patch-couriergraph.cgi15
-rw-r--r--mail/couriergraph/files/patch-couriergraph.pl40
-rw-r--r--mail/couriergraph/pkg-descr5
-rw-r--r--mail/couriergraph/pkg-message8
-rw-r--r--mail/couriergraph/pkg-plist4
8 files changed, 180 insertions, 0 deletions
diff --git a/mail/couriergraph/Makefile b/mail/couriergraph/Makefile
new file mode 100644
index 000000000000..d9c0ff82254e
--- /dev/null
+++ b/mail/couriergraph/Makefile
@@ -0,0 +1,66 @@
+# New ports collection makefile for: mailgraph
+# Date created: 11 September 2005
+# Whom: Xavier Beaudouin (kiwi@oav.net)
+#
+# $FreeBSD$
+#
+
+PORTNAME= couriergraph
+PORTVERSION= 20041207
+CATEGORIES= mail
+MASTER_SITES= http://www.stahl.bau.tu-bs.de/~hildeb/postfix/couriergraph/
+DISTNAME= ${PORTNAME}
+DIST_SUBDIR= ${PORTNAME}-${PORTVERSION}
+
+MAINTAINER= kiwi@oav.net
+COMMENT= A RRDtool frontend for Courier statistics
+
+RUN_DEPENDS= ${SITE_PERL}/RRDp.pm:${PORTSDIR}/net/rrdtool \
+ ${SITE_PERL}/File/Tail.pm:${PORTSDIR}/devel/p5-File-Tail
+
+NO_BUILD= yes
+
+DATADIR?= /var/db/couriergraph
+COURIERGRAPH_USER?= ${WWWOWN}
+COURIERGRAPH_GROUP?= ${WWWGRP}
+
+USE_REINPLACE= yes
+USE_RC_SUBR= yes
+RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} DATADIR=${DATADIR} \
+ COURIERGRAPH_USER=${COURIERGRAPH_USER} COURIERGRAPH_GROUP=${COURIERGRAPH_GROUP}
+
+STARTUP_FILE= ${PREFIX}/etc/rc.d/couriergraph.sh
+
+MSG_FILE= ${PKGDIR}/pkg-message
+PKGMESSAGE= ${WRKSRC}/pkg-message
+
+pre-everything::
+ @${ECHO_MSG}
+ @${ECHO_MSG} "You may set following options:"
+ @${ECHO_MSG}
+ @${ECHO_MSG} "DATADIR=/var/db/couriergraph Where do you put RRD databases?"
+ @${ECHO_MSG} "COURIERGRAPH_USER=www User to run couriergraph (Default: ${WWWOWN})"
+ @${ECHO_MSG} "COURIERGRAPH_GROUP=www Group to run couriergraph (Default: ${WWWGRP})"
+ @${ECHO_MSG}
+
+post-patch:
+ @${REINPLACE_CMD} -e "s,%%DATADIR%%,${DATADIR}," ${WRKSRC}/couriergraph.cgi
+ @${REINPLACE_CMD} -e "s,%%DATADIR%%,${DATADIR}," ${WRKSRC}/couriergraph.pl
+ @${SED} 's|%%DATADIR%%|${DATADIR}|g' ${MSG_FILE} > ${PKGMESSAGE}
+
+do-install:
+ ${MKDIR} ${PREFIX}/www/cgi-bin
+ ${MKDIR} ${DATADIR}
+ @${CHOWN} -R ${COURIERGRAPH_USER}:${COURIERGRAPH_GROUP} ${DATADIR}
+ @${INSTALL_SCRIPT} ${WRKSRC}/couriergraph.pl ${PREFIX}/sbin
+ @${INSTALL_SCRIPT} ${WRKSRC}/couriergraph.cgi ${PREFIX}/www/cgi-bin
+ @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
+ ${FILESDIR}/couriergraph.sh.in > ${STARTUP_FILE}
+ @${CHMOD} 755 ${STARTUP_FILE}
+
+post-install:
+ @${ECHO}
+ @${CAT} ${PKGMESSAGE}
+ @${ECHO}
+
+.include <bsd.port.mk>
diff --git a/mail/couriergraph/distinfo b/mail/couriergraph/distinfo
new file mode 100644
index 000000000000..d843b709f5ed
--- /dev/null
+++ b/mail/couriergraph/distinfo
@@ -0,0 +1,3 @@
+MD5 (couriergraph-20041207/couriergraph.tar.gz) = 19d63b9740c63aaf29b24141b37984df
+SHA256 (couriergraph-20041207/couriergraph.tar.gz) = b888361ae69db62da61e47c117f5910e430584473ac2f7bd968e3bc69daa7ba7
+SIZE (couriergraph-20041207/couriergraph.tar.gz) = 7657
diff --git a/mail/couriergraph/files/couriergraph.sh.in b/mail/couriergraph/files/couriergraph.sh.in
new file mode 100644
index 000000000000..f8a471153017
--- /dev/null
+++ b/mail/couriergraph/files/couriergraph.sh.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: couriergraph
+# REQUIRE: DAEMON
+# KEYWORD: FreeBSD
+#
+# Add the following line to /etc/rc.conf to enable mailgraph:
+#
+# couriergraph_enable="YES"
+#
+
+. %%RC_SUBR%%
+
+name=couriergraph
+rcvar=`set_rcvar`
+
+command=%%PREFIX%%/sbin/couriergraph.pl > /dev/null 2>&1
+command_interpreter=/usr/bin/perl
+stop_postcmd=stop_postcmd
+
+stop_postcmd()
+{
+ rm -f $pidfile
+}
+
+couriergraph_enable=${couriergraph_enable:-"NO"}
+couriergraph_pidfile=${couriergraph_pidfile:-"%%DATADIR%%/couriergraph.pid"}
+couriergraph_flags=${couriergraph_flags:-"--logfile /var/log/maillog --daemon-rrd=%%DATADIR%% --daemon --daemon-pid=${couriergraph_pidfile}"}
+couriergraph_user=${couriergraph_user:-"%%COURIERGRAPH_USER%%"}
+couriergraph_group=${couriergraph_group:-"%%COURIERGRAPH_GROUP%%"}
+couriergraph_chdir=${couriergraph_chdir:-"%%DATADIR%%"}
+
+load_rc_config $name
+
+pidfile=${couriergraph_pidfile}
+
+run_rc_command "$1"
diff --git a/mail/couriergraph/files/patch-couriergraph.cgi b/mail/couriergraph/files/patch-couriergraph.cgi
new file mode 100644
index 000000000000..d1ca7da8ab67
--- /dev/null
+++ b/mail/couriergraph/files/patch-couriergraph.cgi
@@ -0,0 +1,15 @@
+--- couriergraph.cgi.orig Thu Dec 29 07:42:00 2005
++++ couriergraph.cgi Thu Dec 29 07:44:42 2005
+@@ -18,9 +18,10 @@
+ my $points_per_sample = 3;
+ my $ypoints = 160;
+ my $ypoints_err = 96;
+-my $rrd = '/etc/postfix/couriergraph.rrd'; # path to where the RRD database is
+-my $rrd_virus = '/etc/postfix/mailgraph_virus.rrd'; # path to where the Virus RRD database is
++my $rrd = '%%DATADIR%%/etc/postfix/couriergraph.rrd'; # path to where the RRD database is
++my $rrd_virus = '%%DATADIR%%/etc/postfix/mailgraph_virus.rrd'; # path to where the Virus RRD database is
+ my $tmp_dir = '/tmp/couriergraph'; # temporary directory where to store the images
++my $rrdtool_1_0 = ($RRDs::VERSION < 1.199908);
+
+ my @graphs = (
+ { title => 'Day Graphs', seconds => 3600*24, },
diff --git a/mail/couriergraph/files/patch-couriergraph.pl b/mail/couriergraph/files/patch-couriergraph.pl
new file mode 100644
index 000000000000..3c5436b5f495
--- /dev/null
+++ b/mail/couriergraph/files/patch-couriergraph.pl
@@ -0,0 +1,40 @@
+--- couriergraph.pl.orig Thu Dec 29 07:47:47 2005
++++ couriergraph.pl Thu Dec 29 07:48:36 2005
+@@ -314,11 +314,11 @@
+
+ my $daemon_logfile = '/var/log/couriergraph.log';
+ my $daemon_pidfile = '/var/run/couriergraph.pid';
+-my $daemon_rrd_dir = '/var/log';
++my $daemon_rrd_dir = '%%DATADIR%%';
+
+ # global variables
+ my $logfile;
+-my $rrd = "/etc/postfix/couriergraph.rrd";
++my $rrd = "couriergraph.rrd";
+ my $year;
+ my $this_minute;
+ my %sum = ( imapd_ssl_login => 0, imapd_login => 0, pop3d_ssl_login => 0, pop3d_login => 0 );
+@@ -350,7 +350,7 @@
+ print " --host=HOST use only entries for HOST (regexp) in syslog\n";
+ print " -d, --daemon start in the background\n";
+ print " --daemon-pid=FILE write PID to FILE instead of /var/run/mailgraph.pid\n";
+- print " --daemon-rrd=DIR write RRDs to DIR instead of /var/log\n";
++ print " --daemon-rrd=DIR write RRDs to DIR instead of %%DATADIR%%\n";
+ print " --daemon-log=FILE write verbose-log to FILE instead of /var/log/mailgraph.log\n";
+ print " --rrd-name=NAME use NAME.rrd for the rrd files\n";
+
+@@ -473,12 +473,12 @@
+ my $prog = $sl->[2];
+ my $text = $sl->[4];
+
+- if ($prog eq 'courierpop3login') {
++ if ($prog eq 'pop3d') {
+ if($text =~ /LOGIN,/) {
+ event($time, 'pop3d_login');
+ }
+ }
+- elsif ($prog eq 'imaplogin') {
++ elsif ($prog eq 'imap') {
+ if($text =~ /LOGIN,/) {
+ event($time, 'imapd_login');
+ }
diff --git a/mail/couriergraph/pkg-descr b/mail/couriergraph/pkg-descr
new file mode 100644
index 000000000000..02f9f4eaf963
--- /dev/null
+++ b/mail/couriergraph/pkg-descr
@@ -0,0 +1,5 @@
+Couriergraph is a very simple mail statistics RRDtool frontend for Postfix
+that produces daily, weekly, monthly and yearly graphs of Courier's POP3,
+IMAP, POP3s and IMAPs logins.
+
+WWW: http://www.stahl.bau.tu-bs.de/~hildeb/postfix/couriergraph/
diff --git a/mail/couriergraph/pkg-message b/mail/couriergraph/pkg-message
new file mode 100644
index 000000000000..a1db11731f14
--- /dev/null
+++ b/mail/couriergraph/pkg-message
@@ -0,0 +1,8 @@
+Make sure this script should be invoked with privilege to read
+/var/log/maillog.
+
+
+*** WARNING ***
+
+The rrd database has been moved to %%DATADIR%%.
+If you have previous ones, please move them to %%DATADIR%%.
diff --git a/mail/couriergraph/pkg-plist b/mail/couriergraph/pkg-plist
new file mode 100644
index 000000000000..f84aa392679d
--- /dev/null
+++ b/mail/couriergraph/pkg-plist
@@ -0,0 +1,4 @@
+etc/rc.d/couriergraph.sh
+www/cgi-bin/couriergraph.cgi
+sbin/couriergraph.pl
+@unexec rmdir %D/www/cgi-bin 2>/dev/null || true