ports/92749: [maintainer-update] security/samba-vscan OPTIONS feature

Jean Milanez Melo jmelo at freebsdbrasil.com.br
Thu Feb 2 22:30:06 UTC 2006


>Number:         92749
>Category:       ports
>Synopsis:       [maintainer-update] security/samba-vscan OPTIONS feature
>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:   Thu Feb 02 22:30:03 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Jean Milanez Melo
>Release:        FreeBSD 5.3-STABLE i386
>Organization:
>Environment:
System: FreeBSD capeta.freebsdbrasil.com.br 5.3-STABLE FreeBSD 5.3-STABLE #5: Wed Mar 2 15:03:19 BRT 2005 eksffa at capeta.freebsdbrasil.com.br:/usr/obj/usr/src/sys/CAPETA i386


	
>Description:
	
- Now port uses OPTIONS feature. The user must to choose what modules he wants to compile/install.
- I changed all port structure.
>How-To-Repeat:
	
>Fix:

	

--- samba-vscan.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/security/samba-vscan/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	31 Jan 2006 09:57:08 -0000	1.7
+++ Makefile	2 Feb 2006 22:14:10 -0000
@@ -15,19 +15,35 @@
 COMMENT=	On-access virus scanning with Samba
 
 BUILD_DEPENDS=	${NONEXISTENT}:${PORTSDIR}/net/${VSCAN_SAMBA_PORT}:configure
+
+OPTIONS=	VSCAN_ANTIVIR "for use with AntiVir" off \
+		VSCAN_CLAMAV "for use with Clam AntiVirus Daemon" off \
+		VSCAN_FPROTD "for use with F-Prot Daemon" off \
+		VSCAN_FSAV "for use with F-Secure AntiVirus" off \
+		VSCAN_ICAP "for use with an ICAP anti-virus" off \
+		VSCAN_KAVP "for use with Kaspersky AntiVirus" off \
+		VSCAN_MKSD "for use with mks32" off \
+		VSCAN_NAI "for use with NAI/McAfee uvscan" off \
+		VSCAN_OAV "for use with OpenAntiVirus.org ScannerDaemon" off \
+		VSCAN_SOPHOS "for use with Sophos" off \
+		VSCAN_TREND "for use with Trend Micro FileScanner" off
 .if !defined(NOPORTDOCS)
 PORTDOCS=	AUTHORS COPYING ChangeLog FAQ INSTALL NEWS README
 .endif
 
 USE_AUTOTOOLS=	autoconf:259
 USE_BZIP2=	yes
-SAMBA_WRKSRC=	`cd ${PORTSDIR}/net/${VSCAN_SAMBA_PORT}; make -V WRKSRC`
+VSCAN_SAMBA_PORT?=	samba3
+SAMBA_WRKSRC!=	${MAKE} -C ${.CURDIR}/../../net/${VSCAN_SAMBA_PORT} -V WRKSRC
 HAS_CONFIGURE=	yes
 USE_GMAKE=	yes
 CONFIGURE_ARGS=	--with-samba-source=${SAMBA_WRKSRC}
-ETCDIR=		${PREFIX}/etc/samba-vscan
-PKGMESSAGE=	${WRKDIR}/pkg-message
-VSCAN_SAMBA_PORT?=samba3
+ETCDIR=		etc/samba-vscan
+SUB_FILES=	pkg-message
+VFSDIR?=	lib/samba/vfs
+VSCAN_NAME=
+VSCAN_CONF=
+ALL_TARGET=
 
 .include <bsd.port.pre.mk>
 
@@ -35,17 +51,94 @@
 EXTRA_PATCHES=${FILESDIR}/extra_patch-*
 .endif
 
-.if ${VSCAN_SAMBA_PORT} == "samba3"
-PLIST_SUB=	VFSDIR=lib/samba/vfs
-.else
-PLIST_SUB=	VFSDIR=lib/samba
+.if ${VSCAN_SAMBA_PORT} != "samba3"
+VFSDIR=lib/samba
+.endif
+
+.if defined(WITH_VSCAN_ANTIVIR)
+ALL_TARGET+=antivir
+VSCAN_NAME+=vscan-antivir.so
+VSCAN_CONF+=antivir/vscan-antivir.conf
+.endif
+
+.if defined(WITH_VSCAN_CLAMAV)
+ALL_TARGET+=clamav
+VSCAN_NAME+=vscan-clamav.so
+VSCAN_CONF+=clamav/vscan-clamav.conf
+.endif
+
+.if defined(WITH_VSCAN_FPROTD)
+ALL_TARGET+=fprotd
+VSCAN_NAME+=vscan-fprotd.so
+VSCAN_CONF+=fprot/vscan-fprotd.conf
+.endif
+
+.if defined(WITH_VSCAN_FSAV)
+ALL_TARGET+=fsav
+VSCAN_NAME+=vscan-fsav.so
+VSCAN_CONF+=f-secure/vscan-fsav.conf
+.endif
+
+.if defined(WITH_VSCAN_ICAP)
+ALL_TARGET+=icap
+VSCAN_NAME+=vscan-icap.so
+VSCAN_CONF+=icap/vscan-icap.conf
+.endif
+
+.if defined(WITH_VSCAN_KAVP)
+ALL_TARGET+=kavp
+VSCAN_NAME+=vscan-kavp.so
+VSCAN_CONF+=kaspersky/vscan-kavp.conf
 .endif
 
+.if defined(WITH_VSCAN_MKSD)
+ALL_TARGET+=mksd
+VSCAN_NAME+=vscan-mksd.so
+VSCAN_CONF+=mks/vscan-mks32.conf
+.endif
+
+.if defined(WITH_VSCAN_NAI)
+ALL_TARGET+=nai
+VSCAN_NAME+=vscan-mcdaemon.so
+VSCAN_CONF+=nai/vscan-mcdaemon.conf
+.endif
+
+.if defined(WITH_VSCAN_OAV)
+ALL_TARGET+=oav
+VSCAN_NAME+=vscan-oav.so
+VSCAN_CONF+=openantivirus/vscan-oav.conf
+.endif
+
+.if defined(WITH_VSCAN_SOPHOS)
+ALL_TARGET+=sophos
+VSCAN_NAME+=vscan-sophos.so
+VSCAN_CONF+=sophos/vscan-sophos.conf
+.endif
+
+.if defined(WITH_VSCAN_TREND)
+ALL_TARGET+=trend
+VSCAN_NAME+=vscan-trend.so
+VSCAN_CONF+=trend/vscan-trend.conf
+.endif
+
+PLIST_FILES+=	${VSCAN_NAME:S|^|${VFSDIR}/|} \
+		${VSCAN_CONF:S|^|${ETCDIR}/|:C|(.*/).*/(.*.conf)|\1\2|}
+PLIST_DIRS=	${ETCDIR} ${VFSDIR}
+
 pre-configure:
 .if ${VSCAN_SAMBA_PORT} == "samba3"
 		@cd ${SAMBA_WRKSRC}; make proto 2>&1 > /dev/null
 .endif
 
+do-install:
+.for i in ${VSCAN_NAME}
+	${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/${VFSDIR}
+.endfor
+	@${MKDIR} ${PREFIX}/${ETCDIR}
+.for i in ${VSCAN_CONF}
+	${INSTALL_DATA} ${WRKSRC}/${i} ${PREFIX}/${ETCDIR}
+.endfor
+
 post-install:
 .if !defined(NOPORTDOCS)
 	@${MKDIR} ${DOCSDIR}
@@ -53,16 +146,6 @@
 	@${INSTALL_DATA} ${WRKSRC}/${i} ${DOCSDIR}
 .endfor
 .endif
-	@${MKDIR} ${PREFIX}/etc/samba-vscan
-	@${INSTALL_DATA} ${WRKSRC}/clamav/vscan-clamav.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/fprot/vscan-fprotd.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/icap/vscan-icap.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/kaspersky/vscan-kavp.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/mks/vscan-mks32.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/openantivirus/vscan-oav.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/sophos/vscan-sophos.conf ${ETCDIR}
-	@${INSTALL_DATA} ${WRKSRC}/trend/vscan-trend.conf ${ETCDIR}
-	@${SED} "s|%%PREFIX%%|${PREFIX}|g;" ${.CURDIR}/pkg-message > ${PKGMESSAGE}
 	@${CAT} ${PKGMESSAGE}
 
 .include <bsd.port.post.mk>
Index: pkg-message
===================================================================
RCS file: pkg-message
diff -N pkg-message
--- pkg-message	28 Aug 2004 05:08:45 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,43 +0,0 @@
-*****************************************************************************
-You have installed the samba-vscan package.
-
-The vfs object's is in %%PREFIX%%/lib/samba.
-
-The configuration files is in %%PREFIX%%/etc/samba-vscan.
-
-Edit %%PREFIX%%/etc/smb.conf and add the following entry if you are using 
-samba 2.X (that's only an example):
-
-  [vscan]
-       comment = virus-protected /tmp directory
-       path = /tmp
-       vfs object = %%PREFIX%%/lib/samba/vscan-oav.so
-       vfs options = config-file = %%PREFIX%%/etc/samba-vscan/vscan-oav.conf
-       writeable = yes
-       browseable = yes
-       guest ok = yes
-
-If you are using samba 3.X:
-
-Edit /etc/smb.conf and add the following entry (that's only an example):
-  [vscan]
-      comment = virus-protected /tmp directory
-      path = /tmp
-      vfs object = vscan-oav
-      vscan-oav: config-file = %%PREFIX%%/etc/samba-vscan/vscan-oav.conf
-      writeable = yes
-      browseable = yes
-      guest ok = yes
-
-Basically you have to add a vfs object line to your shares
-which should be virus-protected by this module. If you'd like to use the
-run-time configuration file, simply add the
-vfs options = config-file = /path/config-file
-(different settings for several shares can be achieved by using a different
-name of the configuration file for each share). If you want to protect _all_
-shares your Samba server offers, simply add the vfs object line (and the
-vfs options line, if you like) to the [global] section.
-
-Then restart samba.
-
-Important: Remember, you need to install Clamav, Fprot, Icap, Kaspersky, Mks, Openantivirus, Sophos or Trend Antivirus to samba-vscan works correctly.
Index: pkg-plist
===================================================================
RCS file: pkg-plist
diff -N pkg-plist
--- pkg-plist	22 Jan 2006 02:50:53 -0000	1.4
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-etc/samba-vscan/vscan-clamav.conf
-etc/samba-vscan/vscan-fprotd.conf
-etc/samba-vscan/vscan-icap.conf
-etc/samba-vscan/vscan-kavp.conf
-etc/samba-vscan/vscan-mks32.conf
-etc/samba-vscan/vscan-oav.conf
-etc/samba-vscan/vscan-sophos.conf
-etc/samba-vscan/vscan-trend.conf
-%%VFSDIR%%/vscan-clamav.so
-%%VFSDIR%%/vscan-fprotd.so
-%%VFSDIR%%/vscan-fsav.so
-%%VFSDIR%%/vscan-icap.so
-%%VFSDIR%%/vscan-kavp.so
-%%VFSDIR%%/vscan-mcdaemon.so
-%%VFSDIR%%/vscan-mksd.so
-%%VFSDIR%%/vscan-oav.so
-%%VFSDIR%%/vscan-sophos.so
-%%VFSDIR%%/vscan-trend.so
-%%VFSDIR%%/vscan-antivir.so
- at dirrmtry %%VFSDIR%%
- at dirrmtry lib/samba
- at dirrm etc/samba-vscan
Index: files/pkg-message.in
===================================================================
RCS file: files/pkg-message.in
diff -N files/pkg-message.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/pkg-message.in	2 Feb 2006 22:14:10 -0000
@@ -0,0 +1,43 @@
+*****************************************************************************
+You have installed the samba-vscan package.
+
+The vfs object's is in %%PREFIX%%/lib/samba.
+
+The configuration files is in %%PREFIX%%/etc/samba-vscan.
+
+Edit %%PREFIX%%/etc/smb.conf and add the following entry if you are using 
+samba 2.X (that's only an example):
+
+  [vscan]
+       comment = virus-protected /tmp directory
+       path = /tmp
+       vfs object = %%PREFIX%%/lib/samba/vscan-oav.so
+       vfs options = config-file = %%PREFIX%%/etc/samba-vscan/vscan-oav.conf
+       writeable = yes
+       browseable = yes
+       guest ok = yes
+
+If you are using samba 3.X:
+
+Edit %%PREFIX%%/etc/smb.conf and add the following entry (that's only an example):
+  [vscan]
+      comment = virus-protected /tmp directory
+      path = /tmp
+      vfs object = vscan-oav
+      vscan-oav: config-file = %%PREFIX%%/etc/samba-vscan/vscan-oav.conf
+      writeable = yes
+      browseable = yes
+      guest ok = yes
+
+Basically you have to add a vfs object line to your shares
+which should be virus-protected by this module. If you'd like to use the
+run-time configuration file, simply add the
+vfs options = config-file = /path/config-file
+(different settings for several shares can be achieved by using a different
+name of the configuration file for each share). If you want to protect _all_
+shares your Samba server offers, simply add the vfs object line (and the
+vfs options line, if you like) to the [global] section.
+
+Then restart samba.
+
+Important: Remember, you need to install Clamav, Fprot, Icap, Kaspersky, Mks, Openantivirus, Sophos or Trend Antivirus to samba-vscan works correctly.
--- samba-vscan.diff ends here ---


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



More information about the freebsd-ports-bugs mailing list