diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2005-02-18 10:02:09 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2005-02-18 10:02:09 +0000 |
commit | 0393afba2a91721ea70f5b24892f4a0540136715 (patch) | |
tree | 1cacf0496cecc6abe9dfa323b7c00759f381e5e0 /security/amavis-stats | |
parent | 0d69660198f8b1ff1e3c8a8833ffa62adad0965a (diff) | |
download | ports-0393afba2a91721ea70f5b24892f4a0540136715.tar.gz ports-0393afba2a91721ea70f5b24892f4a0540136715.zip |
Notes
Diffstat (limited to 'security/amavis-stats')
-rw-r--r-- | security/amavis-stats/Makefile | 68 | ||||
-rw-r--r-- | security/amavis-stats/distinfo | 2 | ||||
-rw-r--r-- | security/amavis-stats/files/DEINSTALL.in | 16 | ||||
-rw-r--r-- | security/amavis-stats/files/INSTALL.in | 37 | ||||
-rw-r--r-- | security/amavis-stats/files/patch-amavis-stats | 13 | ||||
-rw-r--r-- | security/amavis-stats/files/patch-amavis-stats.php | 11 | ||||
-rw-r--r-- | security/amavis-stats/files/pkg-message.in | 14 | ||||
-rw-r--r-- | security/amavis-stats/pkg-descr | 10 | ||||
-rw-r--r-- | security/amavis-stats/pkg-plist | 6 |
9 files changed, 177 insertions, 0 deletions
diff --git a/security/amavis-stats/Makefile b/security/amavis-stats/Makefile new file mode 100644 index 000000000000..b1e27e32287e --- /dev/null +++ b/security/amavis-stats/Makefile @@ -0,0 +1,68 @@ +# New ports collection makefile for: amavis-stats +# Date created: 12 July 2004 +# Whom: Mantas Kaulakys <stone@tainet.lt> +# +# $FreeBSD$ +# + +PORTNAME= amavis-stats +PORTVERSION= 0.1.12 +CATEGORIES= security +MASTER_SITES= http://rekudos.net/download/ + +MAINTAINER= stone@tainet.lt +COMMENT= A simple AMaViS statistics generator based on rrdtool + +RUN_DEPENDS= ${SITE_PERL}/mach/RRDs.pm:${PORTSDIR}/net/rrdtool + +USE_PERL5_RUN= yes +USE_PHP= yes + +MAN1= amavis-stats.1 + +NO_BUILD= yes + +PORTDOCS= README + +WEBOWN?= www +WEBGRP?= www + +AMAVISUSER?= amavis +AMAVISGROUP?= amavis + +PKGINSTALL= ${WRKDIR}/INSTALL +PKGDEINSTALL= ${WRKDIR}/DEINSTALL +PKGMESSAGE= ${WRKDIR}/pkg-message + +SUB_FILES= INSTALL DEINSTALL pkg-message +SUB_LIST+= AMAVISUSER=${AMAVISUSER} AMAVISGROUP=${AMAVISGROUP} + +.include <bsd.port.pre.mk> + +.if ${PERL_LEVEL} < 500601 +IGNORE= "Need at least perl 5.6.1 to build" +.endif + +pre-install: apply-slist + @${SH} ${PKGINSTALL} ${DISTNAME} PRE-INSTALL + +do-install: + ${INSTALL_SCRIPT} ${WRKSRC}/amavis-stats ${PREFIX}/sbin + ${INSTALL_MAN} ${WRKSRC}/amavis-stats.1 ${MAN1PREFIX}/man/man1 + ${MKDIR} ${PREFIX}/www/amavis-stats + ${MKDIR} ${PREFIX}/www/amavis-stats/img + ${TOUCH} ${PREFIX}/www/amavis-stats/img/.keep + ${INSTALL_DATA} ${WRKSRC}/amavis-stats.php ${PREFIX}/www/amavis-stats + cd ${PREFIX}/www/amavis-stats && ${LN} -s amavis-stats.php index.php + ${CHOWN} -R ${AMAVISUSER}:${AMAVISGROUP} ${PREFIX}/www/amavis-stats + ${CHOWN} ${WEBOWN}:${WEBGRP} ${PREFIX}/www/amavis-stats/img + +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + ${INSTALL_DATA} ${WRKSRC}/${PORTDOCS} ${DOCSDIR} +.endif + +post-install: + @${CAT} ${PKGMESSAGE} + +.include <bsd.port.post.mk> diff --git a/security/amavis-stats/distinfo b/security/amavis-stats/distinfo new file mode 100644 index 000000000000..771dc2feedd4 --- /dev/null +++ b/security/amavis-stats/distinfo @@ -0,0 +1,2 @@ +MD5 (amavis-stats-0.1.12.tar.gz) = b85063b3bb8ecdb03d1b7aebf0c0a6cd +SIZE (amavis-stats-0.1.12.tar.gz) = 60626 diff --git a/security/amavis-stats/files/DEINSTALL.in b/security/amavis-stats/files/DEINSTALL.in new file mode 100644 index 000000000000..e36d3bff9222 --- /dev/null +++ b/security/amavis-stats/files/DEINSTALL.in @@ -0,0 +1,16 @@ +#!/bin/sh + +USER=%%AMAVISUSER%% +GROUP=%%AMAVISGROUP%% + +if [ "$2" = "POST-DEINSTALL" ]; then + + if /usr/sbin/pw group show "${GROUP}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${GROUP}\" group." + fi + + if /usr/sbin/pw user show "${USER}" 2>&1 >/dev/null; then + echo "You should manually remove the \"${USER}\" user." + fi + +fi diff --git a/security/amavis-stats/files/INSTALL.in b/security/amavis-stats/files/INSTALL.in new file mode 100644 index 000000000000..b94fe76d2802 --- /dev/null +++ b/security/amavis-stats/files/INSTALL.in @@ -0,0 +1,37 @@ +#!/bin/sh + +USER=%%AMAVISUSER%% +GROUP=%%AMAVISGROUP%% + +if [ "$2" = "PRE-INSTALL" ]; then + + if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then + echo "You already have a group \"${GROUP}\", so I will use it." + else + if /usr/sbin/pw groupadd ${GROUP} -g 113 -h - + then + echo "Added group \"${GROUP}\"." + else + echo "Adding group \"${GROUP}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + + if /usr/sbin/pw user show "${USER}" 2>/dev/null; then + echo "You already have a user \"${USER}\", so I will use it." + else + if /usr/sbin/pw useradd ${USER} -u 113 -g ${GROUP} -h - \ + -d /nonexistent \ + -s /sbin/nologin \ + -c "Amavis-stats Account" + then + echo "Added user \"${USER}\"." + else + echo "Adding user \"${USER}\" failed..." + echo "Please create it, and try again." + exit 1 + fi + fi + +fi diff --git a/security/amavis-stats/files/patch-amavis-stats b/security/amavis-stats/files/patch-amavis-stats new file mode 100644 index 000000000000..57bd5436bdaa --- /dev/null +++ b/security/amavis-stats/files/patch-amavis-stats @@ -0,0 +1,13 @@ +--- amavis-stats.orig Sat Mar 27 17:25:27 2004 ++++ amavis-stats Sun Jun 6 01:15:27 2004 +@@ -83,8 +83,8 @@ + $version = "0.1.12"; # this value is auto-updated by packing system + $pkg = "amavis-stats"; + $locale = "C"; +-$lockfile = "/var/lock/$pkg"; +-$statedir = "/var/lib/$pkg"; ++$lockfile = "/var/tmp/$pkg"; ++$statedir = "/usr/local/www/$pkg"; + $statefile = "$statedir/$pkg.state"; # last read position of the logfile + $namesfile = "$statedir/$pkg.names"; # stores the virus name to id mappings + $countfile = "$statedir/$pkg.count"; # per virus totals diff --git a/security/amavis-stats/files/patch-amavis-stats.php b/security/amavis-stats/files/patch-amavis-stats.php new file mode 100644 index 000000000000..52386d7b543f --- /dev/null +++ b/security/amavis-stats/files/patch-amavis-stats.php @@ -0,0 +1,11 @@ +--- amavis-stats.php.orig Sat Mar 27 17:25:27 2004 ++++ amavis-stats.php Sun Jun 6 01:21:35 2004 +@@ -286,7 +286,7 @@ + function asLoadStats () { + global $as_libdir, $virus, $pid, $psid, $iid, $bid,$nid,$nsid, $lastupdate, $maxi; + +- $as_libdir = "/var/lib/amavis-stats"; ++ $as_libdir = "/usr/local/www/amavis-stats"; + $as_statefile = $as_libdir . "/amavis-stats.state"; + $as_namefile = $as_libdir . "/amavis-stats.names"; + $as_seenfile = $as_libdir . "/amavis-stats.seen"; diff --git a/security/amavis-stats/files/pkg-message.in b/security/amavis-stats/files/pkg-message.in new file mode 100644 index 000000000000..c811b585b018 --- /dev/null +++ b/security/amavis-stats/files/pkg-message.in @@ -0,0 +1,14 @@ +----- + +To view the statistics via you browser you must: +create a symlink, like: +cd /usr/local/www/data ; ln -s amavis-stats ../amavis-stats + +or modify your Apache httpd.conf including this line: +Alias /amavis-stats %%PREFIX%%/www/amavis-stats + +To update the statistics every 5 minutes, you also +can setup cronjob for amavis-stats by putting this line to /etc/crontab +*/5 * * * * amavis %%PREFIX%%/sbin/amavis-stats /var/log/maillog 2>&1 > /dev/null + +----- diff --git a/security/amavis-stats/pkg-descr b/security/amavis-stats/pkg-descr new file mode 100644 index 000000000000..17b481da4cee --- /dev/null +++ b/security/amavis-stats/pkg-descr @@ -0,0 +1,10 @@ +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/ + +- Mantas Kaulakys +stone@tainet.lt diff --git a/security/amavis-stats/pkg-plist b/security/amavis-stats/pkg-plist new file mode 100644 index 000000000000..0db17f88a6c5 --- /dev/null +++ b/security/amavis-stats/pkg-plist @@ -0,0 +1,6 @@ +sbin/amavis-stats +www/amavis-stats/index.php +www/amavis-stats/amavis-stats.php +www/amavis-stats/img/.keep +@dirrm www/amavis-stats/img +@dirrm www/amavis-stats |