aboutsummaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2003-09-26 12:19:55 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2003-09-26 12:19:55 +0000
commit325901921e7210ae18ac51124423a470379396d1 (patch)
tree4d7aec686c77148ea8fcb5467a8e0ae27e6af58e /security
parent201bc6c998f9f49a14968e0055f88d16ff17434a (diff)
downloadports-325901921e7210ae18ac51124423a470379396d1.tar.gz
ports-325901921e7210ae18ac51124423a470379396d1.zip
Notes
Diffstat (limited to 'security')
-rw-r--r--security/clamav-devel/Makefile22
-rw-r--r--security/clamav-devel/files/clamav-clamd.sh18
-rw-r--r--security/clamav-devel/files/clamav-milter.sh28
-rw-r--r--security/clamav-devel/pkg-plist2
4 files changed, 68 insertions, 2 deletions
diff --git a/security/clamav-devel/Makefile b/security/clamav-devel/Makefile
index 9121e3eba865..4ebcd50138e3 100644
--- a/security/clamav-devel/Makefile
+++ b/security/clamav-devel/Makefile
@@ -7,6 +7,7 @@
PORTNAME= clamav
PORTVERSION= 20030829
+PORTREVISION= 1
CATEGORIES= security
MASTER_SITES= http://clamav.sourceforge.net/snapshot/
PKGNAMESUFFIX= -devel
@@ -22,6 +23,7 @@ RUN_DEPENDS= lha:${PORTSDIR}/archivers/lha \
arc:${PORTSDIR}/archivers/arc \
unzip:${PORTSDIR}/archivers/unzip
+USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
@@ -46,20 +48,36 @@ LDFLAGS+= -lcipher
.endif
.if defined(WITH_MILTER)
-USE_GCC= 3.2
CONFIGURE_ARGS+= --enable-milter
PLIST_SUB+= CLAMAV-MILTER:=""
.else
PLIST_SUB+= CLAMAV-MILTER:="@comment "
.endif
+post-extract:
+ @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/clamav-milter.sh \
+ > ${WRKSRC}/clamav-milter.sh
+ @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/clamav-clamd.sh \
+ > ${WRKSRC}/clamav-clamd.sh
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \
+ ${WRKSRC}/clamav-milter/clamav-milter.c
+
pre-install:
@${ECHO} "===> Creating custom user to run clamav..."
${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@${ECHO} "===> Setting permissions..."
- @${SETENV} PKG_PREFIX=${PREFIX} ${sh} \
+ @${SETENV} PKG_PREFIX=${PREFIX} \
${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL
+ ${INSTALL_SCRIPT} ${WRKSRC}/clamav-clamd.sh \
+ ${LOCALBASE}/etc/rc.d/clamav-clamd.sh.sample
+.if defined(WITH_MILTER)
+ ${INSTALL_SCRIPT} ${WRKSRC}/clamav-milter.sh \
+ ${LOCALBASE}/etc/rc.d/clamav-milter.sh.sample
+.endif
.include <bsd.port.post.mk>
diff --git a/security/clamav-devel/files/clamav-clamd.sh b/security/clamav-devel/files/clamav-clamd.sh
new file mode 100644
index 000000000000..e0ea51c02d01
--- /dev/null
+++ b/security/clamav-devel/files/clamav-clamd.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+PREFIX=%%PREFIX%%
+
+case "$1" in
+start)
+ # remove old socket
+ rm -f /tmp/clamd
+ [ -x ${PREFIX}/sbin/clamd ] && ${PREFIX}/sbin/clamd > /dev/null && echo -n ' clamd'
+ ;;
+stop)
+ killall 'clamd' && echo -n ' clamd'
+ ;;
+*)
+ echo "Usage: ${0##*/} { start | stop }" >&2
+ ;;
+esac
+
+exit 0
diff --git a/security/clamav-devel/files/clamav-milter.sh b/security/clamav-devel/files/clamav-milter.sh
new file mode 100644
index 000000000000..a60723250ab6
--- /dev/null
+++ b/security/clamav-devel/files/clamav-milter.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# runs clamd and clamav-milter
+#
+
+case "$1" in
+'start')
+ rm -f /tmp/clamd /var/run/clmilter.sock
+ %%PREFIX%%/sbin/clamd && echo -n " clamd"
+ %%PREFIX%%/sbin/clamav-milter \
+ --local \
+ --outgoing \
+ --max-children=50 \
+ /var/run/clmilter.sock &
+ echo -n " clamav-milter"
+ ;;
+'stop')
+ killall 'clamav-milter'
+ echo -n " clamav-milter"
+ killall 'clamd'
+ echo -n " clamad"
+ ;;
+*)
+ echo "Usage: ${0##*/} { start | stop }"
+ ;;
+esac
+
+exit 0
diff --git a/security/clamav-devel/pkg-plist b/security/clamav-devel/pkg-plist
index b35a4fe3f7b3..e4ee2923b973 100644
--- a/security/clamav-devel/pkg-plist
+++ b/security/clamav-devel/pkg-plist
@@ -3,6 +3,8 @@ bin/clamscan
bin/clamdscan
bin/freshclam
bin/sigtool
+etc/rc.d/clamav-clamd.sh.sample
+%%CLAMAV-MILTER:%%etc/rc.d/clamav-milter.sh.sample
%%CLAMAV-MILTER:%%sbin/clamav-milter
sbin/clamd
include/clamav.h