View | Details | Raw Unified | Return to bug 66562
Collapse All | Expand All

(-)mailgraph/Makefile (-9 / +17 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	mailgraph
8
PORTNAME=	mailgraph
9
PORTVERSION=	1.8
9
PORTVERSION=	1.8
10
PORTREVISION=	1
10
CATEGORIES=	mail
11
CATEGORIES=	mail
11
MASTER_SITES=	http://people.ee.ethz.ch/~dws/software/mailgraph/pub/ \
12
MASTER_SITES=	http://people.ee.ethz.ch/~dws/software/mailgraph/pub/ \
12
		http://people.ee.ethz.ch/~dws/software/mailgraph/pub/old/
13
		http://people.ee.ethz.ch/~dws/software/mailgraph/pub/old/
Lines 19-41 Link Here
19
20
20
NO_BUILD=	yes
21
NO_BUILD=	yes
21
22
22
STARTUP_SCRIPT=	mailgraph.sh.sample
23
DATADIR=	/var/db/mailgraph
24
25
USE_REINPLACE=	yes
26
USE_RC_SUBR=	yes
27
RC_SCRIPTS_SUB=	PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} DATADIR=${DATADIR}
28
STARTUP_FILE=	${PREFIX}/etc/rc.d/mailgraph.sh
29
23
30
24
post-patch:
31
post-patch:
25
	@${SED} -e "s,%%PREFIX%%,${PREFIX}," ${FILESDIR}/mailgraph.sh > ${WRKSRC}/${STARTUP_SCRIPT}
32
	@${REINPLACE_CMD} -e "s,%%DATADIR%%,${DATADIR}," ${WRKSRC}/mailgraph.cgi
26
33
27
do-install:
34
do-install:
28
	${MKDIR} ${PREFIX}/www/cgi-bin
35
	${MKDIR} ${PREFIX}/www/cgi-bin
29
.for FILE in mailgraph.cgi mailgraph.pl
36
	${MKDIR} ${DATADIR}
30
	@${INSTALL_SCRIPT} ${WRKSRC}/${FILE} ${PREFIX}/www/cgi-bin/
37
	@${CHOWN} www:www ${DATADIR}
31
.endfor
38
	@${INSTALL_SCRIPT} ${WRKSRC}/mailgraph.pl ${PREFIX}/sbin
32
	@${INSTALL_SCRIPT} ${WRKSRC}/${STARTUP_SCRIPT} ${PREFIX}/etc/rc.d/
39
	@${INSTALL_SCRIPT} ${WRKSRC}/mailgraph.cgi ${PREFIX}/www/cgi-bin
33
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL}
40
	@${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
34
	@${CHOWN} www:www ${PREFIX}/www/cgi-bin/
41
		${FILESDIR}/mailgraph.sh.tmpl > ${STARTUP_FILE}
42
	@${CHMOD} 755 ${STARTUP_FILE}
35
43
36
post-install:
44
post-install:
37
	@${ECHO}
45
	@${ECHO}
38
	@${CAT} ${PKGMESSAGE}
46
	@${CAT} ${PKGMESSAGE} | ${SED} -e "s,%%DATADIR%%,${DATADIR}," ${PKGMESSAGE}
39
	@${ECHO}
47
	@${ECHO}
40
48
41
.include <bsd.port.mk>
49
.include <bsd.port.mk>
(-)mailgraph/files/mailgraph.sh (-17 lines)
Lines 1-17 Link Here
1
#!/bin/sh
2
3
PREFIX=%%PREFIX%%
4
5
case "$1" in
6
start)
7
	/usr/bin/su www -c "cd ${PREFIX}/www/cgi-bin; ./mailgraph.pl -l /var/log/maillog" & > /dev/null 2>&1 && echo -n ' mailgraph'
8
	;;
9
stop)
10
	ps -U www | grep mailgraph | awk '{print $1}' | xargs kill && echo -n ' mailgraph'
11
	;;
12
*)
13
	echo "Usage: `basename $0` {start|stop}" >&2
14
	;;
15
esac
16
17
exit 0
(-)mailgraph/files/mailgraph.sh.tmpl (+38 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
# PROVIDE: mailgraph
6
# REQUIRE: DAEMON
7
# KEYWORD: FreeBSD
8
#
9
# Add the following line to /etc/rc.conf to enable mailgraph:
10
#
11
# mailgraph_enable="YES"
12
#
13
14
. %%RC_SUBR%%
15
16
name=mailgraph
17
rcvar=`set_rcvar`
18
19
command=%%PREFIX%%/sbin/mailgraph.pl > /dev/null 2>&1
20
command_interpreter=perl
21
stop_postcmd=stop_postcmd
22
23
stop_postcmd()
24
{
25
    rm -f $pidfile
26
}
27
28
mailgraph_enable=${mailgraph_enable:-"NO"}
29
mailgraph_pidfile=${mailgraph_pidfile:-"%%DATADIR%%/mailgraph.pid"}
30
mailgraph_flags=${mailgraph_flags:-"--logfile /var/log/maillog --daemon-rrd=%%DATADIR%% --ignore-localhost --daemon --daemon-pid=${mailgraph_pidfile}"}
31
mailgraph_user=${mailgraph_user:-"www"}
32
mailgraph_chdir=${mailgraph_chdir:-"%%DATADIR%%"}
33
34
load_rc_config $name
35
36
pidfile=${mailgraph_pidfile}
37
38
run_rc_command "$1"
(-)mailgraph/files/patch-mailgraph.cgi (+13 lines)
Line 0 Link Here
1
--- mailgraph.cgi.orig	Sat Feb  7 21:48:52 2004
2
+++ mailgraph.cgi	Mon Apr 12 02:45:53 2004
3
@@ -15,8 +15,8 @@
4
 my $points_per_sample = 3;
5
 my $ypoints = 150;
6
 my $ypoints_err = 80;
7
-my $rrd = 'mailgraph.rrd'; # path to where the RRD database is
8
-my $rrd_virus = 'mailgraph_virus.rrd'; # path to where the Virus RRD database is
9
+my $rrd = '%%DATADIR%%/mailgraph.rrd'; # path to where the RRD database is
10
+my $rrd_virus = '%%DATADIR%%/mailgraph_virus.rrd'; # path to where the Virus RRD database is
11
 my $tmp_dir = '/tmp/mailgraph'; # temporary directory where to store the images
12
 
13
 my @graphs = (
(-)mailgraph/pkg-deinstall (-9 lines)
Lines 1-9 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/mailgraph/pkg-deinstall,v 1.1 2002/07/11 07:11:58 ijliao Exp $
4
#
5
6
PW="/usr/sbin/pw"
7
8
${PW} usermod www -d /nonexistent -s /sbin/nologin
9
(-)mailgraph/pkg-install (-9 lines)
Lines 1-9 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/mailgraph/pkg-install,v 1.1 2002/07/11 07:11:58 ijliao Exp $
4
#
5
6
PW="/usr/sbin/pw"
7
8
${PW} usermod www -d ${PREFIX}/www -s /bin/sh
9
(-)mailgraph/pkg-message (+6 lines)
Lines 1-2 Link Here
1
Make sure this script should be invoked with privilege to read
1
Make sure this script should be invoked with privilege to read
2
/var/log/maillog.
2
/var/log/maillog.
3
4
5
*** WARNING ***
6
7
The rrd database has been moved to %%DATADIR%%.
8
If you have previous ones, please move them to %%DATADIR%%.
(-)mailgraph/pkg-plist (-2 / +2 lines)
Lines 1-5 Link Here
1
etc/rc.d/mailgraph.sh.sample
1
etc/rc.d/mailgraph.sh
2
www/cgi-bin/mailgraph.cgi
2
www/cgi-bin/mailgraph.cgi
3
www/cgi-bin/mailgraph.pl
3
sbin/mailgraph.pl
4
@unexec rmdir %D/www/cgi-bin 2>/dev/null || true
4
@unexec rmdir %D/www/cgi-bin 2>/dev/null || true
5
@unexec rmdir %D/www 2>/dev/null || true
5
@unexec rmdir %D/www 2>/dev/null || true

Return to bug 66562