Bug 57057

Summary: Fix -pthread problem on current
Product: Ports & Packages Reporter: rob
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me CC: kris
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description rob 2003-09-21 16:10:14 UTC
Fix -pthread problems on current, use a replacement thread implementation.
Comment 1 rob 2003-09-21 16:24:21 UTC
Rob Evers wrote:
>>Number:         57057
>>Category:       ports
>>Synopsis:       Fix -pthread problem on current
>>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 Sep 21 08:10:14 PDT 2003
>>Closed-Date:
>>Last-Modified:
>>Originator:     Rob Evers
>>Release:        FreeBSD 4.9-PRERELEASE i386
>>Organization:
>>Environment:
> 
> System: FreeBSD haha.debank.tv 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Thu Sep 18 16:37:14 CEST 2003 rob@haha.debank.tv:/usr/obj/usr/src/sys/HAHA i386
> 
> 
> 	
> 
>>Description:
> 
> Fix -pthread problems on current, use a replacement thread implementation.
> 
>>How-To-Repeat:
>>Fix:
> 
> 


Forgot to bump PORTREVISION
Here is a newer patch

diff -ruN clamav-devel.org/Makefile clamav-devel/Makefile
--- clamav-devel.org/Makefile   Thu Sep  4 04:53:25 2003
+++ clamav-devel/Makefile       Sun Sep 21 17:22:06 2003
@@ -7,6 +7,7 @@

  PORTNAME=      clamav
  PORTVERSION=   20030829
+PORTREVISION=  1
  CATEGORIES=    security
  MASTER_SITES=  http://clamav.sourceforge.net/snapshot/
  PKGNAMESUFFIX= -devel
@@ -43,6 +44,9 @@
  # compiles only with optimizer
  CFLAGS+=       -O
  LDFLAGS+=      -lcipher
+.else
+LIB_DEPENDS+=  pthread.10:${PORTSDIR}/devel/ngpt
+EXTRA_PATCHES+=        ${FILESDIR}/pthread.diff
  .endif

  .if defined(WITH_MILTER)
diff -ruN clamav-devel.org/files/pthread.diff 
clamav-devel/files/pthread.diff
--- clamav-devel.org/files/pthread.diff Thu Jan  1 01:00:00 1970
+++ clamav-devel/files/pthread.diff     Sun Sep 21 15:48:50 2003
@@ -0,0 +1,13 @@
+--- configure.orig     Fri Aug 29 05:54:57 2003
++++ configure  Sun Sep 21 15:40:39 2003
+@@ -9089,8 +9089,8 @@
+     ;;
+ freebsd*)
+     if test "$have_pthreads" = "yes"; then
+-      LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -pthread -lc_r"
+-      CLAMD_LIBS="-pthread -lc_r"
++      LIBCLAMAV_LIBS="$LIBCLAMAV_LIBS -lpthread -lc_r"
++      CLAMD_LIBS="-lpthread -lc_r"
+       TH_SAFE="-thread-safe"
+       cat >>confdefs.h <<\_ACEOF
+ #define CL_THREAD_SAFE 1
diff -ruN clamav-devel.org/pkg-plist clamav-devel/pkg-plist
--- clamav-devel.org/pkg-plist  Thu Sep  4 04:53:25 2003
+++ clamav-devel/pkg-plist      Sun Sep 21 17:00:07 2003
@@ -11,6 +11,8 @@
  lib/libclamav.la
  lib/libclamav.a
  share/clamav/mirrors.txt
+share/nls/POSIX
+share/nls/en_US.US-ASCII
  @exec chown clamav share/clamav share/clamav/mirrors.txt 
share/clamav/viruses.d
b share/clamav/viruses.db2
  @dirrm share/clamav
  @unexec rmuser -y clamav


-- 
It is a book about a Spanish guy called Manual. You should read it.
        -- Dilbert
Comment 2 Kris Kennaway 2003-09-21 22:03:41 UTC
On Sun, Sep 21, 2003 at 05:04:44PM +0200, Rob Evers wrote:
> 
> >Submitter-Id:	current-users
> >Originator:	Rob Evers
> >Organization:	
> >Confidential:	no 
> >Synopsis:	Fix -pthread problem on current
> >Severity:	non-critical
> >Priority:	low
> >Category:	ports
> >Class:		maintainer-update
> >Release:	FreeBSD 4.9-PRERELEASE i386
> >Environment:
> System: FreeBSD haha.debank.tv 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Thu Sep 18 16:37:14 CEST 2003 rob@haha.debank.tv:/usr/obj/usr/src/sys/HAHA i386
> 
> 
> 	
> >Description:
> Fix -pthread problems on current, use a replacement thread implementation.


This appears to be wrong on several counts.  FreeBSD 5.x supports
pthreads, so you don't need to add a dependency on some other thread
port.  Instead, you need to patch the port to use PTHREAD_LIBS and
PTHREAD_CFLAGS instead of hard-coding a specific value, because the
correct string is different on 4.x and 5.x.

> +share/nls/POSIX
> +share/nls/en_US.US-ASCII


This shouldn't be here either.

Kris
Comment 3 rob 2003-09-22 11:12:43 UTC
Kris Kennaway wrote:
> On Sun, Sep 21, 2003 at 05:04:44PM +0200, Rob Evers wrote:
> 
>>>Submitter-Id:	current-users
>>>Originator:	Rob Evers
>>>Organization:	
>>>Confidential:	no 
>>>Synopsis:	Fix -pthread problem on current
>>>Severity:	non-critical
>>>Priority:	low
>>>Category:	ports
>>>Class:		maintainer-update
>>>Release:	FreeBSD 4.9-PRERELEASE i386
>>>Environment:
>>
>>System: FreeBSD haha.debank.tv 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Thu Sep 18 16:37:14 CEST 2003 rob@haha.debank.tv:/usr/obj/usr/src/sys/HAHA i386
>>
>>
>>	
>>
>>>Description:
>>
>>Fix -pthread problems on current, use a replacement thread implementation.
> 
> 
> This appears to be wrong on several counts.  FreeBSD 5.x supports
> pthreads, so you don't need to add a dependency on some other thread
> port.  Instead, you need to patch the port to use PTHREAD_LIBS and
> PTHREAD_CFLAGS instead of hard-coding a specific value, because the
> correct string is different on 4.x and 5.x.
> 
> 
>>+share/nls/POSIX
>>+share/nls/en_US.US-ASCII
> 
> 
> This shouldn't be here either.
> 
> Kris


OK, here's a new patch that uses REINPLACE and native pthreads.

diff -ruN clamav-devel.org/Makefile clamav-devel/Makefile
--- clamav-devel.org/Makefile   Thu Sep  4 04:53:25 2003
+++ clamav-devel/Makefile       Mon Sep 22 12:06:47 2003
@@ -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 @@
                 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}
@@ -53,6 +55,8 @@
  PLIST_SUB+=    CLAMAV-MILTER:="@comment "
  .endif

+post-patch:
+       @${REINPLACE_CMD} -e 's|-pthread|${PTHREAD_LIBS}|g' 
${WRKSRC}/configure
  pre-install:
         @${ECHO} "===>  Creating custom user to run clamav..."
         ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
Comment 4 Christian Weisgerber freebsd_committer freebsd_triage 2003-09-26 18:05:27 UTC
State Changed
From-To: open->closed

Close on request by submitter: port has already been updated.