1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-13 07:34:50 +00:00

- bump PORTREVISION for plist change.

- Add WITH_LOCAL_CLAMAV[_DEVEL] to run-depend on security/clamav[-devel];
  default LOCAL_CLAMAV on to restore the way port behaved until last update.
  Depend on installed package rather that clamd to register depends correctly.

- If one of the clam options is on, make rc.d script to REQUIRE: clamd
  Actually use clamsmtp_debug var.
  Also make rc.d script to look more like the example in PH.

- Install example script in EXAMPLESDIR rather that DOCSDIR;

- Moved: pkg-message --> files/pkg-message.in
- Drop USE_REINPLACE while here.

PR:		93157
Submitted by:	Ion-Mihai Tetcu <itetcu AT people dot tecnik93 dot com>
This commit is contained in:
Cheng-Lung Sung 2006-02-17 02:45:40 +00:00
parent 4c1879162a
commit c8a5beb928
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=156203
4 changed files with 44 additions and 18 deletions

View File

@ -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>

View File

@ -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"

View File

@ -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%%