diff options
author | pgollucci <pgollucci@FreeBSD.org> | 2010-01-14 12:27:35 +0800 |
---|---|---|
committer | pgollucci <pgollucci@FreeBSD.org> | 2010-01-14 12:27:35 +0800 |
commit | 2a3827975ea64a131ddeb1ea8b4c66919beb0572 (patch) | |
tree | c3180382817d2f82495cb4651b87ba0d24b9087b | |
parent | 9975bb4a77b3e0f0b25e73f26fcea0361fbc32c9 (diff) | |
download | freebsd-ports-gnome-2a3827975ea64a131ddeb1ea8b4c66919beb0572.tar.gz freebsd-ports-gnome-2a3827975ea64a131ddeb1ea8b4c66919beb0572.tar.zst freebsd-ports-gnome-2a3827975ea64a131ddeb1ea8b4c66919beb0572.zip |
SpamAssassin statistic collecting server
WWW: http://search.cpan.org/dist/sastatd/
PR: ports/142780
Submitted by: Oleg A. Mamontov <oleg at mamontov.net>
-rw-r--r-- | mail/Makefile | 1 | ||||
-rw-r--r-- | mail/sastatd/Makefile | 48 | ||||
-rw-r--r-- | mail/sastatd/distinfo | 3 | ||||
-rw-r--r-- | mail/sastatd/files/pkg-deinstall.in | 23 | ||||
-rw-r--r-- | mail/sastatd/files/pkg-install.in | 39 | ||||
-rw-r--r-- | mail/sastatd/files/sastatd.in | 35 | ||||
-rw-r--r-- | mail/sastatd/pkg-descr | 3 | ||||
-rw-r--r-- | mail/sastatd/pkg-plist | 4 |
8 files changed, 156 insertions, 0 deletions
diff --git a/mail/Makefile b/mail/Makefile index 4c41df010465..0aa8d31e5d45 100644 --- a/mail/Makefile +++ b/mail/Makefile @@ -592,6 +592,7 @@ SUBDIR += rubygem-mailfactory SUBDIR += rubygem-tmail SUBDIR += sa-utils + SUBDIR += sastatd SUBDIR += sccmilter SUBDIR += scmail SUBDIR += sendmail diff --git a/mail/sastatd/Makefile b/mail/sastatd/Makefile new file mode 100644 index 000000000000..e648d819765f --- /dev/null +++ b/mail/sastatd/Makefile @@ -0,0 +1,48 @@ +# New ports collection makefile for: sastatd +# Date created: 2010-01-12 +# Whom: Oleg A. Mamontov <oleg@mamontov.net> +# +# $FreeBSD$ +# + +PORTNAME= sastatd +PORTVERSION= 0.03 +CATEGORIES= mail perl5 +MASTER_SITES= CPAN +MASTER_SITE_SUBDIR= ../by-authors/id/L/LO/LONERR + +MAINTAINER= oleg@mamontov.net +COMMENT= SpamAssassin statistic collecting server + +BUILD_DEPENDS= p5-JSON-Any>=0:${PORTSDIR}/converters/p5-JSON-Any \ + p5-Log-Dispatch>=2.26:${PORTSDIR}/devel/p5-Log-Dispatch \ + p5-Pid-File-Flock>=0:${PORTSDIR}/devel/p5-Pid-File-Flock \ + p5-POE>=0:${PORTSDIR}/devel/p5-POE \ + p5-Sys-Syslog>=0.16:${PORTSDIR}/sysutils/p5-Sys-Syslog \ + +RUN_DEPENDS= ${BUILD_DEPENDS} + +PERL_CONFIGURE= yes + +SASTATD_DBDIR?= /var/db/sastatd +SASTATD_RUNDIR?= /var/run/sastatd +SASTATD_USER?= sastatd + +USE_RC_SUBR= sastatd + +SUB_LIST+= SASTATD_DBDIR=${SASTATD_DBDIR} \ + SASTATD_RUNDIR=${SASTATD_RUNDIR} \ + SASTATD_USER=${SASTATD_USER} \ + CHMOD="${CHMOD}" CHOWN="${CHOWN}" MKDIR="${MKDIR}" PW="${PW}" + +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall + +SUB_FILES+= pkg-install pkg-deinstall + +MAN1= sastatd.1 + +post-install: + @${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL + +.include <bsd.port.mk> diff --git a/mail/sastatd/distinfo b/mail/sastatd/distinfo new file mode 100644 index 000000000000..b33d37c986fd --- /dev/null +++ b/mail/sastatd/distinfo @@ -0,0 +1,3 @@ +MD5 (sastatd-0.03.tar.gz) = 6b441d70da38d399a397882e07b85b48 +SHA256 (sastatd-0.03.tar.gz) = 68ec569810f44f7170c42a509654c501f5607647243d4c54998788a9f30b7239 +SIZE (sastatd-0.03.tar.gz) = 5730 diff --git a/mail/sastatd/files/pkg-deinstall.in b/mail/sastatd/files/pkg-deinstall.in new file mode 100644 index 000000000000..e00e1b9e6e9e --- /dev/null +++ b/mail/sastatd/files/pkg-deinstall.in @@ -0,0 +1,23 @@ +#!/bin/sh +# $FreeBSD$ + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +SASTATD_USER=%%SASTATD_USER%% +SASTATD_DBDIR=%%SASTATD_DBDIR%% +SASTATD_RUNDIR=%%SASTATD_RUNDIR%% + +cat <<EOM +------------------------------------------------------------------------ + NOTE! + +If you are permanently removing sastatd, you may want also: + + 1. Delete user: 'pw userdel ${SASTATD_USER} + 2. Delete directories: 'rmdir ${SASTATD_DBDIR} ${SASTATD_RUNDIR} + +------------------------------------------------------------------------ +EOM + diff --git a/mail/sastatd/files/pkg-install.in b/mail/sastatd/files/pkg-install.in new file mode 100644 index 000000000000..cb1da5cf903c --- /dev/null +++ b/mail/sastatd/files/pkg-install.in @@ -0,0 +1,39 @@ +#!/bin/sh +# $FreeBSD$ + +if [ "$2" != "POST-INSTALL" ]; then + exit 0 +fi + +SASTATD_USER="%%SASTATD_USER%%" +SASTATD_DBDIR="%%SASTATD_DBDIR%%" +SASTATD_RUNDIR="%%SASTATD_RUNDIR%%" + +CHOWN="%%CHOWN%%" +MKDIR="%%MKDIR%%" +PW="%%PW%%" + +${PW} user show ${SASTATD_USER} >/dev/null 2>&1 && + echo "===> Using existing user ${SASTATD_USER}" || { + ${PW} useradd ${SASTATD_USER} && + echo "===> Created user ${SASTATD_USER}" || { + echo "*** Failed to create user ${SASTATD_USER}" + exit 1 + } + } + +for DIR in ${SASTATD_DBDIR} ${SASTATD_RUNDIR}; do + test -d ${DIR} || { + ${MKDIR} -p ${DIR} && + echo "===> Created directory ${DIR}" || { + echo "*** Failed to create directory ${DIR}" + exit 1 + }; + } + ${CHOWN} -R ${SASTATD_USER} ${DIR} && + echo "===> Changed ownership of ${DIR}" || { + echo "*** Failed to changed ownership of ${DIR}" + exit 1 + } +done + diff --git a/mail/sastatd/files/sastatd.in b/mail/sastatd/files/sastatd.in new file mode 100644 index 000000000000..3cd4886461d6 --- /dev/null +++ b/mail/sastatd/files/sastatd.in @@ -0,0 +1,35 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: sastatd +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf to enable : +# +# sastatd_enable="YES" +# sastatd_spamd_log="/var/log/spamd.log" +# + +. "%%RC_SUBR%%" + + +name="sastatd" +rcvar=`set_rcvar` + +load_rc_config "$name" +: ${sastatd_enable="NO"} +: ${sastatd_database="%%SASTATD_DBDIR%%/sastatd.db"} +: ${sastatd_setuid="%%SASTATD_USER%%"} +: ${sastatd_pidfile="%%SASTATD_RUNDIR%%/sastatd.pid"} +: ${sastatd_flags="-d ${sastatd_database} -p ${sastatd_pidfile} -u ${sastatd_setuid}"} +: ${sastatd_spamd_log="/var/log/spamd.log"} + +command="%%PREFIX%%/bin/sastatd" +command_args="${sastatd_flags} ${sastatd_spamd_log}" +pidfile="${sastatd_pidfile}" + +run_rc_command "$1" + diff --git a/mail/sastatd/pkg-descr b/mail/sastatd/pkg-descr new file mode 100644 index 000000000000..461b4094ee82 --- /dev/null +++ b/mail/sastatd/pkg-descr @@ -0,0 +1,3 @@ +SpamAssassin statistic collecting server + +WWW: http://search.cpan.org/dist/sastatd/ diff --git a/mail/sastatd/pkg-plist b/mail/sastatd/pkg-plist new file mode 100644 index 000000000000..f5e343996580 --- /dev/null +++ b/mail/sastatd/pkg-plist @@ -0,0 +1,4 @@ +@comment $FreeBSD$ +bin/sastatd +%%SITE_PERL%%/%%PERL_ARCH%%/auto/sastatd/.packlist +@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/sastatd |