Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jul 2004 18:11:49 +0200 (CEST)
From:      Rob Evers <rob@debank.tv>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        eik@FreeBSD.org
Subject:   ports/68924: Update security/clamav-devel to 20040710 snapshot
Message-ID:  <20040711161149.3B21452ED@flappie.debank.tv>
Resent-Message-ID: <200407111620.i6BGKJCW064631@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         68924
>Category:       ports
>Synopsis:       Update security/clamav-devel to 20040710 snapshot
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jul 11 16:20:18 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Rob Evers
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD flappie.debank.tv 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Sun Feb 29 20:35:15 CET 2004 rob@flappie.debank.tv:/usr/obj/usr/src/sys/FLAPPIE i386


>Description:
Update security/clamav-devel to 20040710 snapshot
Change the default signature-database location to /var/db/clamav.
clamav-devel and clamav now use the same pkg-install and pkg-deinstall scripts.
changed documentation installed.
>How-To-Repeat:
>Fix:

New file: files/patch-etc::Makefile.in



--- clamav-devel.patch begins here ---
diff -ruN clamav-devel.orig/Makefile clamav-devel/Makefile
--- clamav-devel.orig/Makefile	Sun Jul 11 11:58:27 2004
+++ clamav-devel/Makefile	Sun Jul 11 17:08:55 2004
@@ -6,7 +6,7 @@
 #
 
 PORTNAME=	clamav
-PORTVERSION=	20040701
+PORTVERSION=	20040710
 CATEGORIES=	security
 MASTER_SITES=	http://clamav.sourceforge.net/snapshot/
 PKGNAMESUFFIX=	-devel
@@ -25,15 +25,19 @@
 
 OPTIONS=	MILTER "Compile the milter interface" off
 USE_REINPLACE=	yes
-USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
 USE_AUTOCONF_VER=259
-USE_LIBTOOL_VER=13
+USE_LIBTOOL_VER=15
 INSTALLS_SHLIB=	yes
 USE_RC_SUBR=	yes
 
-CONFIGURE_ARGS=	--with-dbdir=${DATADIR} \
+PKGINSTALL=	${WRKDIR}/pkg-install
+PKGDEINSTALL=	${WRKDIR}/pkg-deinstall
+
+PORTDOCS=	NEWS ChangeLog html
+
+CONFIGURE_ARGS=	--with-dbdir=${DBDIR} \
 		--disable-clamuko \
 		--disable-clamav \
 		--enable-bigstack \
@@ -53,10 +57,11 @@
 CLAMAVGROUP?=	clamav
 CLAMAV_CLAMD_SOCKET?=	/var/run/clamav/clamd
 CLAMAV_MILTER_SOCKET?=	/var/run/clamav/clmilter.sock
+DBDIR?=		/var/db/clamav
 DOCSDIR?=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
 
 SED_SCRIPT=	-e 's|%%PREFIX%%|${PREFIX}|g' \
-		-e 's|%%DATADIR%%|${DATADIR}|g' \
+		-e 's|%%DBDIR%%|${DBDIR}|g' \
 		-e 's|%%CLAMAVUSER%%|${CLAMAVUSER}|g' \
 		-e 's|%%CLAMAVGROUP%%|${CLAMAVGROUP}|g' \
 		-e 's|%%CLAMAV_CLAMD_SOCKET%%|${CLAMAV_CLAMD_SOCKET}|g' \
@@ -70,13 +75,14 @@
 		-e 's|^\#?(AllowSupplementaryGroups)$$|\1|' \
 		-e 's|^\#?(ScanMail)$$|\1|' \
 		-e 's|^\#?(Checks)$$|\#\1|' \
-		-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DATADIR}|' \
+		-e 's|^\#?(DatabaseDirectory) .*$$|\1 ${DBDIR}|' \
 		-e 's|^\#?(DatabaseOwner) .*$$|\1 ${CLAMAVUSER}|' \
 		-e 's|^\#?(UpdateLogFile) .*$$|\1 /var/log/clamav/freshclam.log|' \
 		-e 's|^\#?(FixStaleSocket)$$|\1|'
 
 PLIST_SUB+=	CLAMAVUSER=${CLAMAVUSER} \
-		CLAMAVGROUP=${CLAMAVGROUP}
+		CLAMAVGROUP=${CLAMAVGROUP} \
+		DBDIR=${DBDIR}
 
 RC_DIR=		${PREFIX}/etc/rc.d
 RC_SUFX=	.sh
@@ -110,50 +116,46 @@
 		${WRKSRC}/Makefile.in
 
 post-build:
-	@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf \
-		> ${BUILD_WRKSRC}/etc/clamav.conf.default
-	@${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
-		${BUILD_WRKSRC}/etc/clamav.conf
-	@${SED} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf \
-		> ${BUILD_WRKSRC}/etc/freshclam.conf.default
-	@${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
-		${BUILD_WRKSRC}/etc/freshclam.conf
+	@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/clamav.conf
+	@${REINPLACE_CMD} ${SED_CONF} ${BUILD_WRKSRC}/etc/freshclam.conf
+	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-install >${PKGINSTALL}
+	@${SED} ${SED_SCRIPT} ${PKGDIR}/pkg-deinstall >${PKGDEINSTALL}
 	@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-clamd.sh \
-		> ${WRKDIR}/clamav-clamd.sh
-	@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
-		> ${WRKDIR}/clamav-milter.sh
+		>${WRKDIR}/clamav-clamd.sh
 	@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-freshclam.sh \
-		> ${WRKDIR}/clamav-freshclam.sh
+		>${WRKDIR}/clamav-freshclam.sh
+.if defined(WITH_MILTER)
+	@${SED} ${SED_SCRIPT} ${FILESDIR}/clamav-milter.sh \
+		>${WRKDIR}/clamav-milter.sh
+.endif
 
 pre-install:
 	@${SETENV} PKG_PREFIX=${PREFIX} \
 		${SH} ${PKGINSTALL} ${PREFIX} PRE-INSTALL
-.if !defined(NOPORTDOCS)
-	@${MKDIR} ${DOCSDIR}
-	@${INSTALL_DATA} ${WRKSRC}/docs/*pdf ${DOCSDIR}
-.endif
 
 post-install:
-	@[ -f ${PREFIX}/etc/clamav.conf ] || \
-		${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
-			${PREFIX}/etc/clamav.conf
-	@[ -f ${PREFIX}/etc/clamav.conf.default ] || \
-		${CP} ${BUILD_WRKSRC}/etc/clamav.conf.default \
-			${PREFIX}/etc/clamav.conf.default
-	@[ -f ${PREFIX}/etc/freshclam.conf ] || \
-		${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
-			${PREFIX}/etc/freshclam.conf
-	@[ -f ${PREFIX}/etc/freshclam.conf.default ] || \
-		${CP} ${BUILD_WRKSRC}/etc/freshclam.conf.default \
-			${PREFIX}/etc/freshclam.conf.default
-	@${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DATADIR}
 	@${INSTALL_SCRIPT} ${WRKDIR}/clamav-clamd.sh \
 		${RC_DIR}/clamav-clamd${RC_SUFX}
 	@${INSTALL_SCRIPT} ${WRKDIR}/clamav-freshclam.sh \
 		${RC_DIR}/clamav-freshclam${RC_SUFX}
+	@${CHOWN} -R ${CLAMAVUSER}:${CLAMAVGROUP} ${DBDIR}
+.for c in clamav freshclam
+	@[ -f ${PREFIX}/etc/${c}.conf ] || \
+		${CP} ${PREFIX}/etc/${c}.conf.default ${PREFIX}/etc/${c}.conf
+.endfor
 .if defined(WITH_MILTER)
 	@${INSTALL_SCRIPT} ${WRKDIR}/clamav-milter.sh \
 		${RC_DIR}/clamav-milter${RC_SUFX}
 .endif
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+	@${INSTALL_DATA} ${INSTALL_WRKSRC}/NEWS ${INSTALL_WRKSRC}/ChangeLog \
+		${DOCSDIR}
+	@${MKDIR} ${DOCSDIR}/html
+	@${INSTALL_DATA} ${INSTALL_WRKSRC}/docs/html/*.* \
+		${DOCSDIR}/html
+.endif
+	@${SETENV} PKG_PREFIX=${PREFIX} \
+		${SH} ${PKGINSTALL} ${PREFIX} POST-INSTALL
 
 .include <bsd.port.post.mk>
diff -ruN clamav-devel.orig/distinfo clamav-devel/distinfo
--- clamav-devel.orig/distinfo	Sun Jul 11 11:58:27 2004
+++ clamav-devel/distinfo	Sun Jul 11 14:07:19 2004
@@ -1,2 +1,2 @@
-MD5 (clamav-devel-20040701.tar.gz) = ed79ebff018bbd9664e3de1e09946ac9
-SIZE (clamav-devel-20040701.tar.gz) = 1577535
+MD5 (clamav-devel-20040710.tar.gz) = e4d241db82d4ff7139f19fdf77edb6a9
+SIZE (clamav-devel-20040710.tar.gz) = 1585951
diff -ruN clamav-devel.orig/files/clamav-clamd.sh clamav-devel/files/clamav-clamd.sh
--- clamav-devel.orig/files/clamav-clamd.sh	Sun Jul 11 11:58:27 2004
+++ clamav-devel/files/clamav-clamd.sh	Sun Jul 11 12:37:42 2004
@@ -23,7 +23,7 @@
 
 command=%%PREFIX%%/sbin/clamd
 pidfile=/var/run/clamav/clamd.pid
-required_dirs=%%DATADIR%%
+required_dirs=%%DBDIR%%
 required_files=%%PREFIX%%/etc/clamav.conf
 
 stop_postcmd=stop_postcmd
diff -ruN clamav-devel.orig/files/clamav-freshclam.sh clamav-devel/files/clamav-freshclam.sh
--- clamav-devel.orig/files/clamav-freshclam.sh	Sun Jul 11 11:58:27 2004
+++ clamav-devel/files/clamav-freshclam.sh	Sun Jul 11 12:37:53 2004
@@ -22,7 +22,7 @@
 rcvar=`set_rcvar`
 
 command=%%PREFIX%%/bin/freshclam
-required_dirs=%%DATADIR%%
+required_dirs=%%DBDIR%%
 required_files=%%PREFIX%%/etc/freshclam.conf
 
 # set defaults
diff -ruN clamav-devel.orig/files/clamav-milter.sh clamav-devel/files/clamav-milter.sh
--- clamav-devel.orig/files/clamav-milter.sh	Sun Jul 11 11:58:27 2004
+++ clamav-devel/files/clamav-milter.sh	Sun Jul 11 12:38:06 2004
@@ -22,7 +22,7 @@
 rcvar=`set_rcvar`
 
 command=%%PREFIX%%/sbin/clamav-milter
-required_dirs=%%DATADIR%%
+required_dirs=%%DBDIR%%
 required_files=%%PREFIX%%/etc/clamav.conf
 
 start_precmd=start_precmd
diff -ruN clamav-devel.orig/files/patch-configure.in clamav-devel/files/patch-configure.in
--- clamav-devel.orig/files/patch-configure.in	Sun Jul 11 11:58:27 2004
+++ clamav-devel/files/patch-configure.in	Sun Jul 11 17:38:44 2004
@@ -10,9 +10,9 @@
 +-dnl Do not overwrite the current config file
 +-AM_CONDITIONAL(INSTALL_CLAMAV_CONF, test ! -r "$cfg_dir/clamav.conf")
 +-AM_CONDITIONAL(INSTALL_FRESHCLAM_CONF, test ! -r "$cfg_dir/freshclam.conf")
-++dnl Do not install config files
-++AM_CONDITIONAL(INSTALL_CLAMAV_CONF, test 0 = 1 )
-++AM_CONDITIONAL(INSTALL_FRESHCLAM_CONF, test 0 = 1 )
+++dnl Install default config files
+++AM_CONDITIONAL(INSTALL_CLAMAV_CONF, test 1 = 1 )
+++AM_CONDITIONAL(INSTALL_FRESHCLAM_CONF, test 1 = 1 )
 + 
 + if test "$test_urandom" = "yes"
 + then
diff -ruN clamav-devel.orig/files/patch-etc::Makefile.in clamav-devel/files/patch-etc::Makefile.in
--- clamav-devel.orig/files/patch-etc::Makefile.in	Thu Jan  1 01:00:00 1970
+++ clamav-devel/files/patch-etc::Makefile.in	Sun Jul 11 17:38:56 2004
@@ -0,0 +1,13 @@
+--- etc/Makefile.in.orig	Thu Feb 19 14:17:02 2004
++++ etc/Makefile.in	Thu Feb 19 14:17:36 2004
+@@ -248,8 +248,8 @@
+ 
+ install:
+ 	$(mkinstalldirs) $(DESTDIR)$(CFGINST)
+-@INSTALL_CLAMAV_CONF_TRUE@	@$(INSTALL_DATA) $(srcdir)/clamav.conf $(DESTDIR)$(CFGINST)
+-@INSTALL_FRESHCLAM_CONF_TRUE@	@$(INSTALL_DATA) $(srcdir)/freshclam.conf $(DESTDIR)$(CFGINST)
++@INSTALL_CLAMAV_CONF_TRUE@	@$(INSTALL_DATA) $(srcdir)/clamav.conf $(DESTDIR)$(CFGINST)/clamav.conf.default
++@INSTALL_FRESHCLAM_CONF_TRUE@	@$(INSTALL_DATA) $(srcdir)/freshclam.conf $(DESTDIR)$(CFGINST)/freshclam.conf.default
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
+ # Otherwise a system limit (for SysV at least) may be exceeded.
+ .NOEXPORT:
diff -ruN clamav-devel.orig/pkg-deinstall clamav-devel/pkg-deinstall
--- clamav-devel.orig/pkg-deinstall	Sun Jul 11 11:58:27 2004
+++ clamav-devel/pkg-deinstall	Sun Jul 11 16:32:55 2004
@@ -1,7 +1,13 @@
-if [ ! "$2" = "POST-DEINSTALL" ]; then
+#!/bin/sh
+# $FreeBSD: ports/security/clamav/pkg-deinstall,v 1.2 2004/04/01 16:36:28 eik Exp $
+
+if [ "$2" != "POST-DEINSTALL" ]; then
 	exit 0
 fi
-echo "----------------------------------------------------------"
-echo "  If you really want to remove this package, please remove"
-echo " the clamav-user and clean out log files and database"
-echo "----------------------------------------------------------"
+
+CLAMAVUSER=%%CLAMAVUSER%%
+
+if pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then
+	echo "To delete ${CLAMAVUSER} user permanently, use 'pw userdel \"${CLAMAVUSER}\"'"
+fi
+exit 0
diff -ruN clamav-devel.orig/pkg-install clamav-devel/pkg-install
--- clamav-devel.orig/pkg-install	Sun Jul 11 11:58:27 2004
+++ clamav-devel/pkg-install	Sun Jul 11 17:48:28 2004
@@ -1,50 +1,58 @@
 #!/bin/sh
+# $FreeBSD: ports/security/clamav/pkg-install,v 1.7 2004/05/30 08:01:22 pav Exp $
 
-if [ "$2" = "PRE-INSTALL" ]; then
-
-if [ -z "${CLAMAVUSER}" ]; then
-	CLAMAVUSER=clamav
-fi
-
-if [ -z "${CLAMAVGROUP}" ]; then
-	CLAMAVGROUP=clamav
-fi
+PREFIX=${PKG_PREFIX:-%%PREFIX%%}
 
+CLAMAVUSER=%%CLAMAVUSER%%
+CLAMAVGROUP=%%CLAMAVGROUP%%
 UID=106
-GID=${UID}
+GID=$UID
 
 CLAMRUN=/var/run/clamav
 CLAMLOG=/var/log/clamav
+DBDIR=%%DBDIR%%
+
+if [ "$2" = "PRE-INSTALL" ]; then
+
+	if ! pw groupshow "$CLAMAVGROUP" 2>/dev/null 1>&2; then
+		if pw groupadd $CLAMAVGROUP -g $GID; then
+			echo "=> Added group \"$CLAMAVGROUP\"."
+		else
+			echo "=> Adding group \"$CLAMAVGROUP\" failed..."
+			exit 1
+		fi
+	fi
 
-echo "===> Adding user \"${CLAMAVUSER}\" if necessary."
-if ! pw groupshow "${CLAMAVGROUP}" 2>/dev/null 1>&2; then
-	if pw groupadd ${CLAMAVGROUP} -g ${GID}; then
-		echo "===> Added group \"${CLAMAVGROUP}\"."
-	else
-                echo "===> Adding group \"${CLAMAVGROUP}\" failed..."
-                exit 1
+	if ! pw usershow "$CLAMAVUSER" 2>/dev/null 1>&2; then
+		if pw useradd $CLAMAVUSER -u $UID -g $CLAMAVGROUP -h - \
+			-s "/sbin/nologin" -d "/nonexistent" \
+			-c "Clam Antivirus"; \
+		then
+			pw groupmod mail -m $CLAMAVUSER
+			echo "=> Added user \"$CLAMAVUSER\"."
+		else
+			echo "=> Adding user \"$CLAMAVUSER\" failed..."
+			exit 1
+		fi
 	fi
-fi
 
-if ! pw usershow "${CLAMAVUSER}" 2>/dev/null 1>&2; then
-	if pw useradd ${CLAMAVUSER} -u ${UID} -g ${CLAMAVGROUP} -h - \
-		-s "/usr/sbin/nologin" -d "/nonexistent" \
-		-c "Clam Antivirus"; \
-        then
-                echo "===> Added user \"${CLAMAVUSER}\"."
-		pw groupmod mail -m ${CLAMAVUSER}
-        else
-                echo "===> Adding user \"${CLAMAVUSER}\" failed..."
-                exit 1
-        fi
-fi
-
-echo "===> Setting permissions..."
-mkdir -p "${CLAMRUN}"
-chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMRUN}"
+elif [ "$2" = "POST-INSTALL" ]; then
+
+	if [ ! -d "$CLAMRUN" ]; then
+		mkdir -p "$CLAMRUN" || exit 1
+		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMRUN" || exit 1
+	fi
+
+	if [ ! -d "$CLAMLOG" ]; then
+		mkdir -p "$CLAMLOG" || exit 1
+		chown "$CLAMAVUSER:$CLAMAVGROUP" "$CLAMLOG" || exit 1
+	fi
+
+	if [ ! -d "${DBDIR}" ]; then
+		mkdir -p "$DBDIR" || exit 1
+		chown "$CLAMAVUSER:$CLAMAVGROUP" "$DBDIR" || exit 1
+	fi
 
-mkdir -p "${CLAMLOG}"
-chown "${CLAMAVUSER}:${CLAMAVGROUP}" "${CLAMLOG}"
 fi
 
 exit 0
diff -ruN clamav-devel.orig/pkg-plist clamav-devel/pkg-plist
--- clamav-devel.orig/pkg-plist	Sun Jul 11 11:58:27 2004
+++ clamav-devel/pkg-plist	Sun Jul 11 17:59:22 2004
@@ -1,3 +1,4 @@
+@comment $FreeBSD:
 @unexec [ ! -f /var/run/clamav/clamd.pid ] || %%RC_DIR%%/clamav-clamd%%RC_SUFX%% stop || true
 @unexec [ ! -f /var/run/clamav/freshclam.pid ] || %%RC_DIR%%/clamav-freshclam%%RC_SUFX%% stop || true
 bin/clamav-config
@@ -15,21 +16,14 @@
 lib/libclamav.so
 lib/libclamav.a
 libdata/pkgconfig/libclamav.pc
-%%PORTDOCS%%%%DOCSDIR%%/clamav-mirror-howto.pdf
-%%PORTDOCS%%%%DOCSDIR%%/clamdoc.pdf
-%%PORTDOCS%%%%DOCSDIR%%/signatures.pdf
 @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
 @unexec if cmp -s %D/etc/freshclam.conf %D/etc/freshclam.conf.default; then rm -f %D/etc/freshclam.conf; fi
 etc/freshclam.conf.default
 @exec [ -f %B/freshclam.conf ] || cp %B/%f %B/freshclam.conf
-@owner %%CLAMAVUSER%%
-@group %%CLAMAVGROUP%%
-@exec chown %%CLAMAVUSER%%:%%CLAMAVGROUP%% %B
-@unexec [ -s %D/%%DATADIR%%/main.cvd ] || rm -f %D/%%DATADIR%%/main.cvd
-@unexec [ -s %D/%%DATADIR%%/daily.cvd ] || rm -f %D/%%DATADIR%%/daily.cvd
-@unexec rmdir %D/%%DATADIR%% 2>/dev/null || true
+@unexec [ -s %%DBDIR%%/main.cvd ] || rm -f %%DBDIR%%/main.cvd
+@unexec [ -s %%DBDIR%%/daily.cvd ] || rm -f %%DBDIR%%/daily.cvd
+@unexec rmdir %%DBDIR%% 2>/dev/null || true
 @unexec rmdir /var/run/clamav 2>/dev/null || true
 @unexec rmdir /var/log/clamav 2>/dev/null || true
-%%PORTDOCS%%@dirrm %%DOCSDIR%%
--- clamav-devel.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040711161149.3B21452ED>