diff options
author | Dirk Meyer <dinoex@FreeBSD.org> | 2003-09-30 03:39:11 +0000 |
---|---|---|
committer | Dirk Meyer <dinoex@FreeBSD.org> | 2003-09-30 03:39:11 +0000 |
commit | e7b221ad8a8f4210b9d37890a7f6a29cb4972bc1 (patch) | |
tree | a80999954e7ea1360d87a61c97a8e933416bd83f /security | |
parent | 42c8a9290085ca35bc8d6b6514fad168756e4563 (diff) | |
download | ports-e7b221ad8a8f4210b9d37890a7f6a29cb4972bc1.tar.gz ports-e7b221ad8a8f4210b9d37890a7f6a29cb4972bc1.zip |
Notes
Diffstat (limited to 'security')
-rw-r--r-- | security/clamav-devel/Makefile | 50 | ||||
-rw-r--r-- | security/clamav-devel/distinfo | 2 | ||||
-rw-r--r-- | security/clamav-devel/files/patch-ltmain.sh | 23 | ||||
-rw-r--r-- | security/clamav-devel/pkg-install | 16 | ||||
-rw-r--r-- | security/clamav-devel/pkg-plist | 13 |
5 files changed, 84 insertions, 20 deletions
diff --git a/security/clamav-devel/Makefile b/security/clamav-devel/Makefile index a65d9894ee47..7458473f6a12 100644 --- a/security/clamav-devel/Makefile +++ b/security/clamav-devel/Makefile @@ -6,7 +6,7 @@ # PORTNAME= clamav -PORTVERSION= 20030926 +PORTVERSION= 20030928 CATEGORIES= security MASTER_SITES= http://clamav.sourceforge.net/snapshot/ PKGNAMESUFFIX= -devel @@ -32,20 +32,32 @@ INSTALLS_SHLIB= yes CONFIGURE_ARGS= --prefix=${PREFIX} \ --disable-clamav --enable-bigstack CFLAGS+= -I${LOCALBASE}/include +LDFLAGS+= ${PTHREAD_LIBS} CONFIGURE_ENV+= LDFLAGS="${LDFLAGS}" MAN1= clamscan.1 freshclam.1 sigtool.1 clamdscan.1 clamav-milter.1 MAN5= clamav.conf.5 MAN8= clamd.8 -CLAMAVUSER?= clamav -SPOOLDIR?= /var/clamd -PLIST_SUB+= SPOOLDIR="${SPOOLDIR}" -PLIST_SUB+= CLAMAVUSER="${CLAMAVUSER}" +CLAMAVUSER?= clamav +CLAMAVGROUP?= clamav + +PLIST_SUB+= CLAMAVUSER="${CLAMAVUSER}" +PLIST_SUB+= CLAMAVGROUP="${CLAMAVGROUP}" + +SED_SCRIPT= -e 's|%%PREFIX%%|${PREFIX}|g' \ + -e 's|%%DATADIR%%|${DATADIR}|g' + +SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \ + -e 's|^\#?(LogFile) .*$$|\1 /var/log/clamav/clamd.log|' \ + -e 's|^\#?(PidFile) .*$$|\1 /var/run/clamav/clamd.pid|' \ + -e 's|^\#?(LocalSocket) .*$$|\1 /var/run/clamav/clamd|' \ + -e 's|^\#?(User) .*$$|\1 ${CLAMAVUSER}|' \ + -e 's|^\#?(ScanMail)$$|\1|' .include <bsd.port.pre.mk> -.if ${OSVERSION} < 510001 +.if ${OSVERSION} < 501001 # compiles only with optimizer CFLAGS+= -O LDFLAGS+= -lcipher @@ -59,9 +71,9 @@ PLIST_SUB+= CLAMAV-MILTER:="@comment " .endif post-extract: - @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/clamav-milter.sh \ + @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \ > ${WRKSRC}/clamav-milter.sh - @${SED} -e "s=%%PREFIX%%=${PREFIX}=" ${FILESDIR}/clamav-clamd.sh \ + @${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \ > ${WRKSRC}/clamav-clamd.sh post-patch: @@ -69,9 +81,27 @@ post-patch: @${REINPLACE_CMD} -e 's|/usr/lib/sendmail|/usr/sbin/sendmail|g' \ ${WRKSRC}/clamav-milter/clamav-milter.c +pre-configure: + @${REINPLACE_CMD} -e 's|clamav.conf|&.default|' \ + ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} \ + ${CONFIGURE_WRKSRC}/etc/Makefile.in +.ifdef USE_LIBTOOL_VER + @${REINPLACE_CMD} -e '/^LIBTOOL=/s|\$$(top_builddir)/libtool|${LIBTOOL}|' \ + ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} +.endif + +post-build: + @${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \ + >${BUILD_WRKSRC}/etc/clamav.conf.default + +pre-install: + ${SETENV} PKG_PREFIX=${PREFIX} \ + ${SH} ${PKGINSTALL} ${PREFIX} + post-install: - ${SETENV} PKG_PREFIX=${PREFIX} \ - ${SH} ${PKGINSTALL} ${PREFIX} + @[ -f ${PREFIX}/etc/clamav.conf ] || \ + ${CP} ${PREFIX}/etc/clamav.conf.default ${PREFIX}/etc/clamav.conf + @${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DATADIR} ${INSTALL_SCRIPT} ${WRKSRC}/clamav-clamd.sh \ ${LOCALBASE}/etc/rc.d/clamav-clamd.sh.sample .if defined(WITH_MILTER) diff --git a/security/clamav-devel/distinfo b/security/clamav-devel/distinfo index 62671f7a61d2..2c6d0e5655d9 100644 --- a/security/clamav-devel/distinfo +++ b/security/clamav-devel/distinfo @@ -1 +1 @@ -MD5 (clamav-devel-20030926.tar.gz) = 7b8f32e8dc373c51e1cb1a2bda07bdad +MD5 (clamav-devel-20030928.tar.gz) = 72bb345563a2e31ac70e9f90b2954cac diff --git a/security/clamav-devel/files/patch-ltmain.sh b/security/clamav-devel/files/patch-ltmain.sh new file mode 100644 index 000000000000..74d32db0b279 --- /dev/null +++ b/security/clamav-devel/files/patch-ltmain.sh @@ -0,0 +1,23 @@ +--- ltmain.sh.orig Sat Sep 27 05:20:20 2003 ++++ ltmain.sh Sat Sep 27 05:24:02 2003 +@@ -4259,10 +4259,16 @@ + fi + + # Install the pseudo-library for information purposes. +- name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` +- instname="$dir/$name"i +- $show "$install_prog $instname $destdir/$name" +- $run eval "$install_prog $instname $destdir/$name" || exit $? ++ case $host in ++ *-*-freebsd*) ++ # Do not install the useless pseudo-library ++ ;; ++ *) ++ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` ++ instname="$dir/$name"i ++ $show "$install_prog $instname $destdir/$name" ++ $run eval "$install_prog $instname $destdir/$name" || exit $? ++ esac + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" diff --git a/security/clamav-devel/pkg-install b/security/clamav-devel/pkg-install index 65410625a42b..72596f16fc59 100644 --- a/security/clamav-devel/pkg-install +++ b/security/clamav-devel/pkg-install @@ -4,11 +4,12 @@ if [ -z "${CLAMAVUSER}" ]; then CLAMAVUSER=clamav fi -if [ -z "${SPOOLDIR}" ]; then - SPOOLDIR=/var/clamd +if [ -z "${CLAMAVGROUP}" ]; then + CLAMAVGROUP=clamav fi -CLAMAVGROUP=${CLAMAVUSER} +CLAMRUN=/var/run/clamav +CLAMLOG=/var/log/clamav echo "===> Adding user \"${CLAMAVUSER}\" if necessary." if ! pw groupshow "${CLAMAVGROUP}" 2>/dev/null 1>&2; then @@ -22,7 +23,7 @@ fi if ! pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then if pw useradd ${CLAMAVUSER} -g ${CLAMAVGROUP} -h - \ - -s "/usr/sbin/nologin" -d "${SPOOLDIR}" \ + -s "/usr/sbin/nologin" -d "/nonexistent" \ -c "Clam Antivirus"; \ then echo "===> Added user \"${CLAMAVUSER}\"." @@ -33,7 +34,10 @@ if ! pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then fi echo "===> Setting permissions..." -mkdir ${SPOOLDIR} -chown -R ${CLAMAVUSER}:${CLAMAVGROUP} ${PKG_PREFIX}/share/clamav ${SPOOLDIR} +mkdir -p "${CLAMRUN}" +chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMRUN}" + +mkdir -p "${CLAMLOG}" +chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMLOG}" exit 0 diff --git a/security/clamav-devel/pkg-plist b/security/clamav-devel/pkg-plist index 3362f1c67a67..efc624f94139 100644 --- a/security/clamav-devel/pkg-plist +++ b/security/clamav-devel/pkg-plist @@ -10,10 +10,17 @@ sbin/clamd include/clamav.h lib/libclamav.so.1 lib/libclamav.so -lib/libclamav.la lib/libclamav.a -share/clamav/mirrors.txt -@dirrm share/clamav +@unexec if cmp -s %D/etc/clamav.conf %D/etc/clamav.conf.default; then rm -f %D/etc/clamav.conf; fi +etc/clamav.conf.default +@exec [ -f %B/clamav.conf ] || cp %B/%f %B/clamav.conf +@owner %%CLAMAVUSER%% +@group %%CLAMAVGROUP%% +%%DATADIR%%/mirrors.txt +@exec chown %%CLAMAVUSER%%:%%CLAMAVGROUP%% %B +@dirrm %%DATADIR%% +@unexec rmdir /var/run/clamav 2>/dev/null || true +@unexec rmdir /var/log/clamav 2>/dev/null || true @unexec echo "" @unexec echo "=========================================================" @unexec echo " If you want to deinstall this package permanently then" |