aboutsummaryrefslogtreecommitdiff
path: root/mail/p3scan
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2006-11-01 01:36:24 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2006-11-01 01:36:24 +0000
commit1db0b7c2bddd2e606f3b9b72b9aa1d914aff4faa (patch)
tree39f406be74090fb2f3eada97b41069a9f04d521f /mail/p3scan
parent16127d75e58a33a035279ab066042a2eb54332d1 (diff)
downloadports-1db0b7c2bddd2e606f3b9b72b9aa1d914aff4faa.tar.gz
ports-1db0b7c2bddd2e606f3b9b72b9aa1d914aff4faa.zip
Notes
Diffstat (limited to 'mail/p3scan')
-rw-r--r--mail/p3scan/Makefile11
-rw-r--r--mail/p3scan/files/p3scan.sh26
-rw-r--r--mail/p3scan/files/p3scan.sh.in37
-rw-r--r--mail/p3scan/files/patch-p3scan.c15
-rw-r--r--mail/p3scan/pkg-plist4
5 files changed, 58 insertions, 35 deletions
diff --git a/mail/p3scan/Makefile b/mail/p3scan/Makefile
index 00bb2c7bbd99..aca10b17a1bb 100644
--- a/mail/p3scan/Makefile
+++ b/mail/p3scan/Makefile
@@ -7,6 +7,7 @@
PORTNAME= p3scan
PORTVERSION= 2.3.2
+PORTREVISION= 1
CATEGORIES= mail net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@@ -16,20 +17,24 @@ COMMENT= A transparent POP3-Proxy with virus-scanning capabilities
LIB_DEPENDS= pcre.0:${PORTSDIR}/devel/pcre
+PLIST_FILES= etc/p3scan/p3scan.conf.sample etc/p3scan/p3scan.mail.sample \
+ etc/rc.d/p3scan.sh sbin/p3scan
+
USE_GMAKE= yes
USE_GETOPT_LONG=yes
MAKE_ENV= _LDFLAGS="${LDFLAGS} -L${LOCALBASE}/lib" GMAKE=${GMAKE}
SCRIPTS_ENV= PKG_PREFIX=${PREFIX} NONEXISTENT=${NONEXISTENT} PASSWD=/etc/passwd
-SUB_FILES= pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
OPTIONS= UVSCAN "Use UVSCAN" off
PORTDOCS= AUTHORS CHANGELOG LICENSE NEWS README
-
MAN8= p3scan.8 p3scan_readme.8
MANCOMPRESSED= yes
+USE_RC_SUBR= p3scan.sh
+SUB_FILES= p3scan.sh pkg-message
+
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_UVSCAN)
@@ -47,7 +52,7 @@ do-install:
${INSTALL_PROGRAM} ${WRKSRC}/p3scan ${PREFIX}/sbin/
${INSTALL_DATA} ${WRKSRC}/p3scan.conf ${PREFIX}/etc/p3scan/p3scan.conf.sample
${INSTALL_DATA} ${WRKSRC}/p3scan-en.mail ${PREFIX}/etc/p3scan/p3scan.mail.sample
- ${INSTALL_SCRIPT} ${FILESDIR}/p3scan.sh ${PREFIX}/etc/rc.d/
+ ${INSTALL_SCRIPT} ${WRKDIR}/p3scan.sh ${PREFIX}/etc/rc.d/
.for f in ${MAN8}
${INSTALL_MAN} ${WRKSRC}/${f}.gz ${MAN8PREFIX}/man/man8/
.endfor
diff --git a/mail/p3scan/files/p3scan.sh b/mail/p3scan/files/p3scan.sh
deleted file mode 100644
index 8beec962b730..000000000000
--- a/mail/p3scan/files/p3scan.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
- echo "$0: Cannot determine the PREFIX" >&2
- exit 1
-fi
-
-
-case "$1" in
- start)
- echo -n "P3Scan "
- ${PREFIX}/sbin/p3scan || exit 1
- ;;
- stop)
- echo -n "Shutting down P3Scan"
- kill `cat /var/run/p3scan/p3scan.pid 2>/dev/null` &>/dev/null || exit 1
- ;;
- reload|restart)
- $0 stop && sleep 1 && $0 start || exit 1
- ;;
- *)
- echo "Usage: $0 {start|stop|reload|restart}"
- exit 1
-esac
-
-exit 0
diff --git a/mail/p3scan/files/p3scan.sh.in b/mail/p3scan/files/p3scan.sh.in
new file mode 100644
index 000000000000..62b6263c7aad
--- /dev/null
+++ b/mail/p3scan/files/p3scan.sh.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+# PROVIDE: p3scan
+# REQUIRE: DAEMON
+#
+# Add the following lines to /etc/rc.conf to enable p3scan:
+# p3scan_enable="YES"
+#
+# Optional:
+# p3scan_config="%%PREFIX%%/etc/p3scan/p3scan.conf
+#
+
+. %%RC_SUBR%%
+
+name=p3scan
+rcvar=`set_rcvar`
+
+required_files=%%PREFIX%%/etc/p3scan/p3scan.conf
+
+# set defaults
+
+p3scan_enable=${p3scan_enable:-"NO"}
+p3scan_config=${p3scan_config:-"%%PREFIX%%/local/etc/p3scan/p3scan.conf"}
+
+load_rc_config $name
+run_rc_command "$1"
+
+start_cmd="p3scan_start"
+
+p3scan_start()
+{
+ %%PREFIX%%/sbin/p3scan -f ${p3scan_config}
+}
+
+run_rc_command "$1"
diff --git a/mail/p3scan/files/patch-p3scan.c b/mail/p3scan/files/patch-p3scan.c
index 392071524e69..9831f7f7c268 100644
--- a/mail/p3scan/files/patch-p3scan.c
+++ b/mail/p3scan/files/patch-p3scan.c
@@ -1,5 +1,5 @@
---- p3scan.c.orig Mon Dec 12 18:00:00 2005
-+++ p3scan.c Mon May 1 00:45:41 2006
+--- p3scan.c.orig Tue Dec 13 02:00:00 2005
++++ p3scan.c Wed Nov 1 11:44:03 2006
@@ -41,36 +41,37 @@
TODO: Wanted: white-list support
TODO: Wanted: no iptables support
@@ -52,6 +52,17 @@
#include "p3scan.h"
#include "getline_ssl.h"
+@@ -182,8 +183,8 @@
+ do_log(LOG_NOTICE, "ERR: Exiting now...\n");
+ fprintf(stderr, "%s\n", puffer);
+ if (strlen(NONULL(config->emergency))){
+- snprintf(puffer,4096,"echo '%s' | %s -s 'P3Scan Terminating!' %s", config->emergency, config->mail, config->emergcon);
+- do_log(LOG_DEBUG,"echo '%s' | %s -s 'P3Scan Terminating!' %s", config->emergency, config->mail, config->emergcon);
++ snprintf(puffer,4096,"echo \"%s\" | %s -s 'P3Scan Terminating' %s", config->emergency, config->mail, config->emergcon);
++ do_log(LOG_DEBUG,"echo \"%s\" | %s -s 'P3Scan Terminating' %s", config->emergency, config->mail, config->emergcon);
+ if (system(puffer)) fprintf(stderr,"ERR: Calling do_log!");
+ }
+ /* Tell main p3scan to abort */
@@ -1640,8 +1641,9 @@
}
} else {
diff --git a/mail/p3scan/pkg-plist b/mail/p3scan/pkg-plist
deleted file mode 100644
index 69de6bdd7bc9..000000000000
--- a/mail/p3scan/pkg-plist
+++ /dev/null
@@ -1,4 +0,0 @@
-etc/p3scan.conf.sample
-etc/p3scan.mail.sample
-etc/rc.d/p3scan.sh
-sbin/p3scan