From nobody@FreeBSD.org  Fri Nov 25 17:14:42 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 51DCB106568B
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Nov 2011 17:14:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 283418FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Nov 2011 17:14:42 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id pAPHEfoJ080861
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 25 Nov 2011 17:14:41 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id pAPHEfop080860;
	Fri, 25 Nov 2011 17:14:41 GMT
	(envelope-from nobody)
Message-Id: <201111251714.pAPHEfop080860@red.freebsd.org>
Date: Fri, 25 Nov 2011 17:14:41 GMT
From: Alfred Bartsch <bartsch@dssgmbh.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: some problems in net/wireshark/Makefile
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         162879
>Category:       ports
>Synopsis:       some problems in net/wireshark/Makefile
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 25 17:20:05 UTC 2011
>Closed-Date:    Tue Dec 20 00:15:35 UTC 2011
>Last-Modified:  Tue Dec 20 00:15:35 UTC 2011
>Originator:     Alfred Bartsch
>Release:        FreeBSD 8.2-stable
>Organization:
Data-Service GmbH
>Environment:
FreeBSD ds832pkg.incore 8.2-STABLE FreeBSD 8.2-STABLE #1: Thu Oct  6 08:55:49 CEST 2011     root@dsscons2.incore:/usr/obj/usr/src/sys/SERVER  i386
>Description:
After setting WITHOUT_GNUTLS=yes in /etc/make.conf, "make index" and "portmaster -gH net/wireshark" seem to work as expected (no dependency to gnutls left neither in INDEX-8 nor in /var/db/pkg/wireshark-1.6.2/+CONTENTS).
I built a package on my build server and installed it into a test machine.
running tshark ends in:
/libexec/ld-elf.so.1: Shared object "libgnutls.so.47" not found, required by "libwireshark.so.1"

CONFIGURE_ARGS setting "--with-gnutls=yes/no" depending on "WITHOUT_GNUTLS" is missing in Makefile, as expected by configure to work properly.

Another weakness: --with-libgnutls-prefix seems to by a typo, should read ...libgcrypt... instead, if I'm not completely wrong.

IMHO, pure existence of a single file should not make any difference concerning dependencies, at least in a build environment, so I opt for removing the ".if exists" part of these conditional statements.

The attached fix addresses all these weaknesses.

>How-To-Repeat:
set "WITHOUT_GNUTLS=yes" in /etc/make.conf
build a package on a server with gnutls already installed
install this package on a server without gnutls installed
run wireshark or tshark
>Fix:
patching the wireshark Makefile solves this for me:

--- Makefile.1st        2011-09-29 12:50:19.000000000 +0200
+++ Makefile    2011-11-25 17:00:19.000000000 +0100
@@ -146,13 +146,16 @@
 CONFIGURE_ARGS+=       --with-geoip=no
 .endif
 
-.if exists(${LOCALBASE}/lib/libgnutls.so) || !defined(WITHOUT_GNUTLS)
+.if !defined(WITHOUT_GNUTLS)
 LIB_DEPENDS+=  gnutls.47:${PORTSDIR}/security/gnutls \
                gcrypt.18:${PORTSDIR}/security/libgcrypt
-CONFIGURE_ARGS+=--with-libgnutls-prefix=${LOCALBASE}
+CONFIGURE_ARGS+=       --with-libgcrypt-prefix=${LOCALBASE}
+CONFIGURE_ARGS+=       --with-gnutls=yes
+.else
+CONFIGURE_ARGS+=       --with-gnutls=no
 .endif
 
-.if exists(${LOCALBASE}/lib/libgcrypt.so) || !defined(WITHOUT_LIBGCRYPT)
+.if !defined(WITHOUT_LIBGCRYPT)
 LIB_DEPENDS+=  gcrypt.18:${PORTSDIR}/security/libgcrypt
 CONFIGURE_ARGS+=--with-libgcrypt-prefix=${LOCALBASE}
 .endif


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Nov 25 17:20:16 UTC 2011 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162879 
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Tue Dec 20 00:15:21 UTC 2011 
State-Changed-Why:  
Committed thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=162879 
>Unformatted:
