From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Jul 11 23:20:16 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7041F16A4D0 for ; Sun, 11 Jul 2004 23:20:16 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58F5A43D39 for ; Sun, 11 Jul 2004 23:20:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i6BNKGnu009921 for ; Sun, 11 Jul 2004 23:20:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6BNKGMD009920; Sun, 11 Jul 2004 23:20:16 GMT (envelope-from gnats) Resent-Date: Sun, 11 Jul 2004 23:20:16 GMT Resent-Message-Id: <200407112320.i6BNKGMD009920@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Mantas Kaulakys Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8738416A4D2 for ; Sun, 11 Jul 2004 23:13:21 +0000 (GMT) Received: from gigas.tainet.lt (55109.mokslas.lt [193.219.55.109]) by mx1.FreeBSD.org (Postfix) with ESMTP id BF4A843D39 for ; Sun, 11 Jul 2004 23:13:18 +0000 (GMT) (envelope-from stone@tainet.lt) Received: from localhost (localhost [127.0.0.1]) by gigas.tainet.lt (Postfix) with ESMTP id D214612 for ; Mon, 12 Jul 2004 02:13:16 +0300 (EEST) Received: from gigas.tainet.lt ([127.0.0.1]) by localhost (gigas.tainet.lt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 39274-06 for ; Mon, 12 Jul 2004 02:13:10 +0300 (EEST) Received: by gigas.tainet.lt (Postfix, from userid 1000) id E29313EA; Mon, 12 Jul 2004 02:13:09 +0300 (EEST) Message-Id: <20040711231309.E29313EA@gigas.tainet.lt> Date: Mon, 12 Jul 2004 02:13:09 +0300 (EEST) From: Mantas Kaulakys To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/68934: New port: security/amavis-stats A simple AMaViS statistics generator based on rrdtool X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Mantas Kaulakys List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jul 2004 23:20:16 -0000 >Number: 68934 >Category: ports >Synopsis: New port: security/amavis-stats A simple AMaViS statistics generator based on rrdtool >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Jul 11 23:20:16 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Mantas Kaulakys >Release: FreeBSD 5.2.1-RELEASE-p7 i386 >Organization: >Environment: System: FreeBSD gigas.tainet.lt 5.2.1-RELEASE-p7 FreeBSD 5.2.1-RELEASE-p7 #14: Thu May 20 18:41:33 EEST 2004 stone@gigas.tainet.lt:/usr/obj/usr/src/sys/GIGAS i386 >Description: amavis-stats is a simple AMaViS statistics generator based on rrdtool. It produces graphs of clean emails, spam emails and infected emails broken down by virus, from amavis log entries. RRD files are created and updated by a perl script run from cron. Graphs are generated by a php script and viewed with a web browser. WWW: http://rekudos.net/amavis-stats/ >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # /usr/ports/security/amavis-stats # /usr/ports/security/amavis-stats/distinfo # /usr/ports/security/amavis-stats/Makefile # /usr/ports/security/amavis-stats/aa.sh # /usr/ports/security/amavis-stats/pkg-descr # /usr/ports/security/amavis-stats/pkg-plist # /usr/ports/security/amavis-stats/files # /usr/ports/security/amavis-stats/files/patch-amavis-stats # /usr/ports/security/amavis-stats/files/patch-amavis-stats.php # /usr/ports/security/amavis-stats/files/DEINSTALL.tmpl # /usr/ports/security/amavis-stats/files/INSTALL.tmpl # /usr/ports/security/amavis-stats/pkg-message # echo c - /usr/ports/security/amavis-stats mkdir -p /usr/ports/security/amavis-stats > /dev/null 2>&1 echo x - /usr/ports/security/amavis-stats/distinfo sed 's/^X//' >/usr/ports/security/amavis-stats/distinfo << 'END-of-/usr/ports/security/amavis-stats/distinfo' XMD5 (amavis-stats-0.1.12.tar.gz) = b85063b3bb8ecdb03d1b7aebf0c0a6cd XSIZE (amavis-stats-0.1.12.tar.gz) = 60626 END-of-/usr/ports/security/amavis-stats/distinfo echo x - /usr/ports/security/amavis-stats/Makefile sed 's/^X//' >/usr/ports/security/amavis-stats/Makefile << 'END-of-/usr/ports/security/amavis-stats/Makefile' X# New ports collection makefile for: amavis-stats X# Date created: 12 July 2004 X# Whom: Mantas Kaulakys X# X# $FreeBSD$ X# X XPORTNAME= amavis-stats XPORTVERSION= 0.1.12 XCATEGORIES= security XMASTER_SITES= http://rekudos.net/download/ X XMAINTAINER= stone@tainet.lt XCOMMENT= A simple AMaViS statistics generator based on rrdtool X XRUN_DEPENDS= ${SITE_PERL}/mach/RRDs.pm:${PORTSDIR}/net/rrdtool X XUSE_PERL5_RUN= yes XUSE_PHP= yes XWANT_PHP_WEB= yes X XMAN1= amavis-stats.1 X XNO_BUILD= yes X XPORTDOCS= README X XWEBOWN?= www XWEBGRP?= www X XAMAVISUSER?= amavis XAMAVISGROUP?= amavis X XPKGINSTALL= ${WRKDIR}/INSTALL XPKGDEINSTALL= ${WRKDIR}/DEINSTALL X XSED_SCRIPT= -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \ X -e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' X X.include X X.if ${PERL_LEVEL} < 500601 XIGNORE="Need at least perl 5.6.1 to build" X.endif X Xpre-install: X for f in INSTALL; do \ X ${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl > ${WRKDIR}/$${f}; \ X done X @${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL X Xdo-install: X $(INSTALL) -m 755 ${WRKSRC}/amavis-stats ${LOCALBASE}/sbin X ${INSTALL_MAN} ${WRKSRC}/amavis-stats.1 ${MAN1PREFIX}/man/man1 X ${MKDIR} ${LOCALBASE}/www/amavis-stats X ${MKDIR} ${LOCALBASE}/www/amavis-stats/img X ${INSTALL} -m 644 ${WRKSRC}/amavis-stats.php ${LOCALBASE}/www/amavis-stats X cd ${LOCALBASE}/www/amavis-stats && ${LN} -s amavis-stats.php index.php X ${CHOWN} -R ${AMAVISUSER}:${AMAVISGROUP} ${LOCALBASE}/www/amavis-stats X ${CHOWN} ${WEBOWN}:${WEBGRP} ${LOCALBASE}/www/amavis-stats/img X X.if !defined(NOPORTDOCS) X ${MKDIR} ${DOCSDIR} X ${INSTALL_MAN} ${WRKSRC}/${PORTDOCS} ${DOCSDIR} X.endif X Xpost-install: X @${CAT} ${PKGMESSAGE} X Xpost-deinstall: X for f in DEINSTALL; do \ X ${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl > ${WRKDIR}/$${f}; \ X done X @${SH} ${PKGDEINSTALL} ${DISTNAME} POST-DEINSTALL X X.include END-of-/usr/ports/security/amavis-stats/Makefile echo x - /usr/ports/security/amavis-stats/aa.sh sed 's/^X//' >/usr/ports/security/amavis-stats/aa.sh << 'END-of-/usr/ports/security/amavis-stats/aa.sh' X# This is a shell archive. Save it in a file, remove anything before X# this line, and then unpack it by entering "sh file". Note, it may X# create directories; files and directories will be owned by you and X# have default permissions. X# X# This archive contains: X# X# /usr/ports/security/amavis-stats X# /usr/ports/security/amavis-stats/distinfo X# /usr/ports/security/amavis-stats/Makefile X# /usr/ports/security/amavis-stats/aa.sh X# /usr/ports/security/amavis-stats/pkg-descr X# /usr/ports/security/amavis-stats/pkg-plist X# /usr/ports/security/amavis-stats/files X# /usr/ports/security/amavis-stats/files/patch-amavis-stats X# /usr/ports/security/amavis-stats/files/patch-amavis-stats.php X# /usr/ports/security/amavis-stats/files/DEINSTALL.tmpl X# /usr/ports/security/amavis-stats/files/INSTALL.tmpl X# /usr/ports/security/amavis-stats/pkg-message X# Xecho c - /usr/ports/security/amavis-stats Xmkdir -p /usr/ports/security/amavis-stats > /dev/null 2>&1 Xecho x - /usr/ports/security/amavis-stats/distinfo Xsed 's/^X//' >/usr/ports/security/amavis-stats/distinfo << 'END-of-/usr/ports/security/amavis-stats/distinfo' XXMD5 (amavis-stats-0.1.12.tar.gz) = b85063b3bb8ecdb03d1b7aebf0c0a6cd XXSIZE (amavis-stats-0.1.12.tar.gz) = 60626 XEND-of-/usr/ports/security/amavis-stats/distinfo Xecho x - /usr/ports/security/amavis-stats/Makefile Xsed 's/^X//' >/usr/ports/security/amavis-stats/Makefile << 'END-of-/usr/ports/security/amavis-stats/Makefile' XX# New ports collection makefile for: amavis-stats XX# Date created: 12 July 2004 XX# Whom: Mantas Kaulakys XX# XX# $FreeBSD$ XX# XX XXPORTNAME= amavis-stats XXPORTVERSION= 0.1.12 XXCATEGORIES= security XXMASTER_SITES= http://rekudos.net/download/ XX XXMAINTAINER= stone@tainet.lt XXCOMMENT= A simple AMaViS statistics generator based on rrdtool XX XXRUN_DEPENDS= ${SITE_PERL}/mach/RRDs.pm:${PORTSDIR}/net/rrdtool XX XXUSE_PERL5_RUN= yes XXUSE_PHP= yes XXWANT_PHP_WEB= yes XX XXMAN1= amavis-stats.1 XX XXNO_BUILD= yes XX XXPORTDOCS= README XX XXWEBOWN?= www XXWEBGRP?= www XX XXAMAVISUSER?= amavis XXAMAVISGROUP?= amavis XX XXPKGINSTALL= ${WRKDIR}/INSTALL XXPKGDEINSTALL= ${WRKDIR}/DEINSTALL XX XXSED_SCRIPT= -e 's,%%AMAVISUSER%%,${AMAVISUSER},g' \ XX -e 's,%%AMAVISGROUP%%,${AMAVISGROUP},g' XX XX.include XX XX.if ${PERL_LEVEL} < 500601 XXIGNORE="Need at least perl 5.6.1 to build" XX.endif XX XXpre-install: XX for f in INSTALL; do \ XX ${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl > ${WRKDIR}/$${f}; \ XX done XX @${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL XX XXdo-install: XX $(INSTALL) -m 755 ${WRKSRC}/amavis-stats ${LOCALBASE}/sbin XX ${INSTALL_MAN} ${WRKSRC}/amavis-stats.1 ${MAN1PREFIX}/man/man1 XX ${MKDIR} ${LOCALBASE}/www/amavis-stats XX ${MKDIR} ${LOCALBASE}/www/amavis-stats/img XX ${INSTALL} -m 644 ${WRKSRC}/amavis-stats.php ${LOCALBASE}/www/amavis-stats XX cd ${LOCALBASE}/www/amavis-stats && ${LN} -s amavis-stats.php index.php XX ${CHOWN} -R ${AMAVISUSER}:${AMAVISGROUP} ${LOCALBASE}/www/amavis-stats XX ${CHOWN} ${WEBOWN}:${WEBGRP} ${LOCALBASE}/www/amavis-stats/img XX XX.if !defined(NOPORTDOCS) XX ${MKDIR} ${DOCSDIR} XX ${INSTALL_MAN} ${WRKSRC}/${PORTDOCS} ${DOCSDIR} XX.endif XX XXpost-install: XX @${CAT} ${PKGMESSAGE} XX XXpost-deinstall: XX for f in DEINSTALL; do \ XX ${SED} ${SED_SCRIPT} < ${FILESDIR}/$${f}.tmpl > ${WRKDIR}/$${f}; \ XX done XX @${SH} ${PKGDEINSTALL} ${DISTNAME} POST-DEINSTALL XX XX.include XEND-of-/usr/ports/security/amavis-stats/Makefile Xecho x - /usr/ports/security/amavis-stats/aa.sh Xsed 's/^X//' >/usr/ports/security/amavis-stats/aa.sh << 'END-of-/usr/ports/security/amavis-stats/aa.sh' END-of-/usr/ports/security/amavis-stats/aa.sh echo x - /usr/ports/security/amavis-stats/pkg-descr sed 's/^X//' >/usr/ports/security/amavis-stats/pkg-descr << 'END-of-/usr/ports/security/amavis-stats/pkg-descr' Xamavis-stats is a simple AMaViS statistics generator based on rrdtool. XIt produces graphs of clean emails, spam emails and infected emails Xbroken down by virus, from amavis log entries. RRD files are created Xand updated by a perl script run from cron. Graphs are generated by Xa php script and viewed with a web browser. X XWWW: http://rekudos.net/amavis-stats/ X X- Mantas Kaulakys Xstone@tainet.lt END-of-/usr/ports/security/amavis-stats/pkg-descr echo x - /usr/ports/security/amavis-stats/pkg-plist sed 's/^X//' >/usr/ports/security/amavis-stats/pkg-plist << 'END-of-/usr/ports/security/amavis-stats/pkg-plist' Xsbin/amavis-stats Xwww/amavis-stats/index.php Xwww/amavis-stats/amavis-stats.php X@dirrm www/amavis-stats/img X@dirrm www/amavis-stats END-of-/usr/ports/security/amavis-stats/pkg-plist echo c - /usr/ports/security/amavis-stats/files mkdir -p /usr/ports/security/amavis-stats/files > /dev/null 2>&1 echo x - /usr/ports/security/amavis-stats/files/patch-amavis-stats sed 's/^X//' >/usr/ports/security/amavis-stats/files/patch-amavis-stats << 'END-of-/usr/ports/security/amavis-stats/files/patch-amavis-stats' X--- amavis-stats.orig Sat Mar 27 17:25:27 2004 X+++ amavis-stats Sun Jun 6 01:15:27 2004 X@@ -83,8 +83,8 @@ X $version = "0.1.12"; # this value is auto-updated by packing system X $pkg = "amavis-stats"; X $locale = "C"; X-$lockfile = "/var/lock/$pkg"; X-$statedir = "/var/lib/$pkg"; X+$lockfile = "/var/tmp/$pkg"; X+$statedir = "/usr/local/www/$pkg"; X $statefile = "$statedir/$pkg.state"; # last read position of the logfile X $namesfile = "$statedir/$pkg.names"; # stores the virus name to id mappings X $countfile = "$statedir/$pkg.count"; # per virus totals END-of-/usr/ports/security/amavis-stats/files/patch-amavis-stats echo x - /usr/ports/security/amavis-stats/files/patch-amavis-stats.php sed 's/^X//' >/usr/ports/security/amavis-stats/files/patch-amavis-stats.php << 'END-of-/usr/ports/security/amavis-stats/files/patch-amavis-stats.php' X--- amavis-stats.php.orig Sat Mar 27 17:25:27 2004 X+++ amavis-stats.php Sun Jun 6 01:21:35 2004 X@@ -286,7 +286,7 @@ X function asLoadStats () { X global $as_libdir, $virus, $pid, $psid, $iid, $bid,$nid,$nsid, $lastupdate, $maxi; X X- $as_libdir = "/var/lib/amavis-stats"; X+ $as_libdir = "/usr/local/www/amavis-stats"; X $as_statefile = $as_libdir . "/amavis-stats.state"; X $as_namefile = $as_libdir . "/amavis-stats.names"; X $as_seenfile = $as_libdir . "/amavis-stats.seen"; END-of-/usr/ports/security/amavis-stats/files/patch-amavis-stats.php echo x - /usr/ports/security/amavis-stats/files/DEINSTALL.tmpl sed 's/^X//' >/usr/ports/security/amavis-stats/files/DEINSTALL.tmpl << 'END-of-/usr/ports/security/amavis-stats/files/DEINSTALL.tmpl' X#!/bin/sh X XUSER=%%AMAVISUSER%% XGROUP=%%AMAVISGROUP%% X Xif [ "$2" = "POST-DEINSTALL" ]; then X X if /usr/sbin/pw group show "${GROUP}" 2>&1 >/dev/null; then X echo "You should manually remove the \"${GROUP}\" group." X fi X X if /usr/sbin/pw user show "${USER}" 2>&1 >/dev/null; then X echo "You should manually remove the \"${USER}\" user." X fi X Xfi END-of-/usr/ports/security/amavis-stats/files/DEINSTALL.tmpl echo x - /usr/ports/security/amavis-stats/files/INSTALL.tmpl sed 's/^X//' >/usr/ports/security/amavis-stats/files/INSTALL.tmpl << 'END-of-/usr/ports/security/amavis-stats/files/INSTALL.tmpl' X#!/bin/sh X XUSER=%%AMAVISUSER%% XGROUP=%%AMAVISGROUP%% X Xif [ "$2" = "PRE-INSTALL" ]; then X X if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then X echo "You already have a group \"${GROUP}\", so I will use it." X else X if /usr/sbin/pw groupadd ${GROUP} -h - X then X echo "Added group \"${GROUP}\"." X else X echo "Adding group \"${GROUP}\" failed..." X echo "Please create it, and try again." X exit 1 X fi X fi X X if /usr/sbin/pw user show "${USER}" 2>/dev/null; then X echo "You already have a user \"${USER}\", so I will use it." X else X if /usr/sbin/pw useradd ${USER} -g ${GROUP} -h - \ X -d /nonexistent \ X -s /sbin/nologin \ X -c "Amavis-stats Account" X then X echo "Added user \"${USER}\"." X else X echo "Adding user \"${USER}\" failed..." X echo "Please create it, and try again." X exit 1 X fi X fi X Xfi END-of-/usr/ports/security/amavis-stats/files/INSTALL.tmpl echo x - /usr/ports/security/amavis-stats/pkg-message sed 's/^X//' >/usr/ports/security/amavis-stats/pkg-message << 'END-of-/usr/ports/security/amavis-stats/pkg-message' X X----- X XTo view the statistics via you browser you must: Xcreate a symlink, like: Xcd /usr/local/www/data ; ln -s amavis-stats ../amavis-stats X Xor modify your Apache httpd.conf including this line: XAlias /amavis-stats /usr/local/www/amavis-stats X XTo update the statistics every 5 minutes, you also Xcan setup cronjob for amavis-stats by putting this line to /etc/crontab X*/5 * * * * amavis /usr/local/sbin/amavis-stats /var/log/maillog 2>&1 > /dev/null X X----- X END-of-/usr/ports/security/amavis-stats/pkg-message exit >Release-Note: >Audit-Trail: >Unformatted: