aboutsummaryrefslogtreecommitdiff
path: root/security/clamsmtp
diff options
context:
space:
mode:
authorCheng-Lung Sung <clsung@FreeBSD.org>2006-02-17 02:45:40 +0000
committerCheng-Lung Sung <clsung@FreeBSD.org>2006-02-17 02:45:40 +0000
commitc8a5beb92847819a48ed3da15ed7b165be73daeb (patch)
treec834ed4bf50a200b672bfbbeb9c15d2305b57c01 /security/clamsmtp
parent4c1879162a61b69b0626ff490fd03e56901d1eec (diff)
downloadports-c8a5beb92847819a48ed3da15ed7b165be73daeb.tar.gz
ports-c8a5beb92847819a48ed3da15ed7b165be73daeb.zip
Notes
Diffstat (limited to 'security/clamsmtp')
-rw-r--r--security/clamsmtp/Makefile37
-rw-r--r--security/clamsmtp/files/clamsmtpd.sh.in23
-rw-r--r--security/clamsmtp/files/pkg-message.in (renamed from security/clamsmtp/pkg-message)0
-rw-r--r--security/clamsmtp/pkg-plist2
4 files changed, 44 insertions, 18 deletions
diff --git a/security/clamsmtp/Makefile b/security/clamsmtp/Makefile
index b9d2a192d3c7..4467286f7bbc 100644
--- a/security/clamsmtp/Makefile
+++ b/security/clamsmtp/Makefile
@@ -7,6 +7,7 @@
PORTNAME= clamsmtp
PORTVERSION= 1.6
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://memberwebs.com/nielsen/software/clamsmtp/
@@ -15,9 +16,9 @@ COMMENT= An ClamAV anti-virus SMTP Filter
GNU_CONFIGURE= yes
USE_GMAKE= yes
-USE_REINPLACE= yes
USE_RC_SUBR= clamsmtpd.sh
SUB_LIST= CLAMAV_PID_DIR=${CLAMAV_PID_DIR}
+SUB_FILES+= pkg-message
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -26,10 +27,31 @@ CLAMAV_PID_DIR?= /var/run/clamav
MAN5= clamsmtpd.conf.5
MAN8= clamsmtpd.8
-PORTDOCS= *
+PORTDOCS= README
-.if exists(${LOCALBASE}/sbin/clamd)
-RUN_DEPENDS+= ${LOCALBASE}/sbin/clamd:${PORTSDIR}/security/clamav
+OPTIONS= LOCAL_CLAMAV "RUN_DEPEND on security/clamav" on
+OPTIONS+= LOCAL_CLAMAV_DEVEL "RUN_DEPEND on security/clamav-devel" off
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITH_LOCAL_CLAMAV)
+RUN_DEPENDS+= clamav>=0:${PORTSDIR}/security/clamav
+.endif
+
+.if defined(WITH_LOCAL_CLAMAV_DEVEL)
+RUN_DEPENDS+= clamav-devel>=0:${PORTSDIR}/security/clamav-devel
+.endif
+
+.if defined(WITH_LOCAL_CLAMAV) || defined(WITH_LOCAL_CLAMAV_DEVEL)
+SUB_LIST+= CLAMD=clamd
+.else
+SUB_LIST+= CLAMD=
+.endif
+
+pre-extract:
+.if defined(WITH_LOCAL_CLAMAV) && defined(WITH_LOCAL_CLAMAV_DEVEL)
+ @${ECHO_CMD} "Please select only one clamav port"
+ exit 1
.endif
post-patch:
@@ -40,8 +62,9 @@ post-install:
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
- ${INSTALL_DATA} ${WRKSRC}/scripts/virus_action.sh ${DOCSDIR}
.endif
- @${SED} -e "s,%%PREFIX%%,${PREFIX},g" ${PKGMESSAGE}
+ @${MKDIR} ${EXAMPLESDIR}
+ ${INSTALL_SCRIPT} ${WRKSRC}/scripts/virus_action.sh ${EXAMPLESDIR}
+ @${CAT} ${PKGMESSAGE}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/security/clamsmtp/files/clamsmtpd.sh.in b/security/clamsmtp/files/clamsmtpd.sh.in
index 682b9dbb7ad5..05080f5f4f46 100644
--- a/security/clamsmtp/files/clamsmtpd.sh.in
+++ b/security/clamsmtp/files/clamsmtpd.sh.in
@@ -3,31 +3,32 @@
# $FreeBSD$
#
# PROVIDE: clamsmtpd
-# REQUIRE: DAEMON
+# REQUIRE: DAEMON %%CLAMD%%
# KEYWORD: FreeBSD
#
-# Add the fellowing line to /etc/rc.conf to enable clamsmtpd:
+# Add the fellowing line to /etc/rc.conf.local or /etc/rc.conf
+# to enable clamsmtpd:
#
# clamsmtpd_enable="YES"
#
+# Set clamsmtpd_debug to something other that 0 if you need
+#
. %%RC_SUBR%%
name="clamsmtpd"
-rcvar=`set_rcvar`
+rcvar=${name}_enable
command=%%PREFIX%%/sbin/${name}
+command_args="-f ${clamsmtpd_conf} -p ${clamsmtpd_pid} -d ${clamsmtpd_debug}"
+pidfile=${clamsmtpd_pid}
sig_stop=-KILL
load_rc_config ${name}
-clamsmtpd_enable=${clamsmtpd_enable-"NO"}
-clamsmtpd_conf=${clamsmtpd_conf-"%%PREFIX%%/etc/clamsmtpd.conf"}
-clamsmtpd_pid=${clamsmtpd_pid-"%%CLAMAV_PID_DIR%%/clamsmtpd.pid"}
-clamsmtpd_debug=${clamsmtpd_debug-"0"}
-
-command_args="-f ${clamsmtpd_conf} -p ${clamsmtpd_pid}"
-
-pidfile=${clamsmtpd_pid}
+: ${clamsmtpd_enable="NO"}
+: ${clamsmtpd_conf="%%PREFIX%%/etc/clamsmtpd.conf"}
+: ${clamsmtpd_pid="%%CLAMAV_PID_DIR%%/clamsmtpd.pid"}
+: ${clamsmtpd_debug="0"}
run_rc_command "$1"
diff --git a/security/clamsmtp/pkg-message b/security/clamsmtp/files/pkg-message.in
index 8f8d4562caad..8f8d4562caad 100644
--- a/security/clamsmtp/pkg-message
+++ b/security/clamsmtp/files/pkg-message.in
diff --git a/security/clamsmtp/pkg-plist b/security/clamsmtp/pkg-plist
index 9c6c9ac9e369..c5db92fe4619 100644
--- a/security/clamsmtp/pkg-plist
+++ b/security/clamsmtp/pkg-plist
@@ -2,3 +2,5 @@
@unexec [ ! -f %%CLAMAV_PID_DIR%%/clamsmtpd.pid ] || %%PREFIX%%/etc/rc.d/clamsmtpd.sh stop || true
sbin/clamsmtpd
etc/clamsmtpd.conf-sample
+%%EXAMPLESDIR%%/virus_action.sh
+@dirrm %%EXAMPLESDIR%%