Subject: Re: clamav-milter under CURRENT
To: Antoine Jacoutot <ajacoutot@lphp.org>
From: Mike M. Volokhov <mishka@apk.od.ua>
List: tech-pkg
Date: 01/29/2004 12:36:11
On Thu, 29 Jan 2004 11:06:26 +0100
Antoine Jacoutot <ajacoutot@lphp.org> wrote:

> Hi :)
> 
> I have a question concerning the clamav package under NetBSD.
> Even if I defined "USE_MILTER=yes" in mk.conf but clamav-milter is not being
> built under CURRENT, only the clamav-milter man page is added to the package, 
> but not the
> clamav-milter binary.
> Does anyone see this behaviour ?
> 

The both current and stable have not strerror_r(3) function in libc
(yet?). However if you may test clamav with my patches, please apply
a one patch from

	http://mail-index.netbsd.org/tech-pkg/2004/01/27/0007.html

It have close to strerror_r implementation for that code parts. Inside
clamav-milter.c file you can see recommendations about
'-Dstrerror_r=strerror' flag passed to C compiler on Solaris, but
it won't compiles in smooth way.

Then use the following patch to mail/clamav/Makefile file:

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/mail/clamav/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	2003/12/08 06:47:31	1.7
+++ Makefile	2004/01/29 10:22:32
@@ -32,9 +32,10 @@
 
 .include "../../mk/bsd.prefs.mk"
 .if defined(USE_MILTER) && ${USE_MILTER} == "YES"
-#.include "../../mail/libmilter/buildlink2.mk"
-#CONFIGURE_ARGS+=	--enable-milter
-#PLIST_SRC+=		${PKGDIR}/PLIST.milter
+.include "../../mail/libmilter/buildlink2.mk"
+CONFIGURE_ARGS+=	--enable-milter
+PLIST_SRC+=		${PKGDIR}/PLIST.milter
+CFLAGS+=		-DNO_STRERROR_R
 .else
 CONFIGURE_ARGS+=	--disable-milter
 .endif

Of course, on some systems (FreeBSD, glibc-??) the 'CFLAGS+=...' variable
should be avoided, but that is test patch only, not a decision yet.

--
Best regards,
Mishka.

P.S. What a benefits to have an strerror_r() and what a problems to
implement it on NetBSD C library?