From nobody@FreeBSD.org  Fri Jan 16 08:51:06 2009
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 F1019106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 16 Jan 2009 08:51:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id DEA4B8FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 16 Jan 2009 08:51:06 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n0G8p6Bq035070
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 16 Jan 2009 08:51:06 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n0G8p6tb035068;
	Fri, 16 Jan 2009 08:51:06 GMT
	(envelope-from nobody)
Message-Id: <200901160851.n0G8p6tb035068@www.freebsd.org>
Date: Fri, 16 Jan 2009 08:51:06 GMT
From: Sergey <z_serg_2000@mail.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: port net/samba32-devel don't build at libsmb/libsmb_cache.c if old version of Samba is installed
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         130610
>Category:       ports
>Synopsis:       port net/samba32-devel don't build at libsmb/libsmb_cache.c if old version of Samba is installed
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    timur
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jan 16 09:00:01 UTC 2009
>Closed-Date:    Sun Feb 22 02:39:21 UTC 2009
>Last-Modified:  Sun Feb 22 02:39:21 UTC 2009
>Originator:     Sergey
>Release:        FreeBSD 7.0-RELEASE-p7
>Organization:
>Environment:
FreeBSD acc.acc.tula.ru 7.0-RELEASE-p7 FreeBSD 7.0-RELEASE-p7 #62: Tue Dec 23 12:57:54 MSK 2008 root@acc.acc.tula.ru:/usr/obj/usr/src/sys/Z i386
>Description:
If old version of Samba is installed port net/samba32-devel stop building at libsmb/libsmb_cache.c with error:
Linking non-shared library bin/libnetapi.a
Compiling libsmb/libsmb_cache.c
In file included from libsmb/libsmb_cache.c:25:
include/libsmb_internal.h:176: error: expected specifier-qualifier-list before 'smbc_smb_encrypt_level'
libsmb/libsmb_cache.c: In function 'SMBC_add_cached_server':
libsmb/libsmb_cache.c:91: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:91: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:91: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:91: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:91: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c: In function 'SMBC_get_cached_server':
libsmb/libsmb_cache.c:121: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:163: error: called object 'smbc_getFunctionRemoveCachedServer(context)' is not a function
libsmb/libsmb_cache.c:178: error: called object 'smbc_getFunctionRemoveCachedServer(context)' is not a function
libsmb/libsmb_cache.c: In function 'SMBC_remove_cached_server':
libsmb/libsmb_cache.c:203: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:207: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:207: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:207: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:207: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c:207: error: dereferencing pointer to incomplete type
libsmb/libsmb_cache.c: In function 'SMBC_purge_cached_servers':
libsmb/libsmb_cache.c:232: error: dereferencing pointer to incomplete type
The following command failed:
cc -I. -I/usr/ports/net/samba32-devel/work/samba-3.2.4/source -O -D_SAMBA_BUILD_=3 -I/usr/local/include -I/usr/ports/net/samba32-devel/work/samba-3.2.4/source/iniparser/src -Iinclude -I./include -I. -I. -I./lib/replace -I./lib/talloc -I./lib/tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H -I/usr/local/include -Iinclude -I./include -I. -I. -I./lib/replace -I./lib/talloc -I./lib/tdb/include -I./libaddns -I./librpc -I./popt -I/usr/local/include -DLDAP_DEPRECATED -I/include -I/usr/ports/net/samba32-devel/work/samba-3.2.4/source/lib -D_SAMBA_BUILD_=3 -fPIC -DPIC -c libsmb/libsmb_cache.c -o libsmb/libsmb_cache.o
gmake: *** [libsmb/libsmb_cache.o] Ошибка 1
*** Error code 2

Stop in /usr/ports/net/samba32-devel.
*** Error code 1

Stop in /usr/ports/net/samba32-devel.
>How-To-Repeat:
        1. Install net/samba3
        2. Try to make at net/samba32-devel

>Fix:
The reason of error is simple:
make use /usr/local/include/libsmbclient.h instead of libsmbclient.h from work directory because of -I/usr/local/include is first path for searching *.h files.
===>  Building for samba-3.2.4_2
Using FLAGS      =  -O -D_SAMBA_BUILD_=3 -I/usr/local/include  -I/usr/ports/net/samba32-devel/work/samba-3.2.4/source/iniparser/src -Iinclude -I./include  -I. -I. -I./lib/replace -I./lib/talloc -I./lib/tdb/include -I./libaddns -I./librpc -DHAVE_CONFIG_H  -I/usr/local/include -Iinclude -I./include -I. -I. -I./lib/replace -I./lib/talloc -I./lib/tdb/include -I./libaddns -I./librpc -I./popt -I/usr/local/include -DLDAP_DEPRECATED   -I/include -I/usr/ports/net/samba32-devel/work/samba-3.2.4/source/lib -D_SAMBA_BUILD_=3

The patch is just stop biulding if /usr/local/include/libsmbclient.h from early version of Samba.



Patch attached with submission follows:

--- /usr/ports/net/samba32-devel/Makefile	2009-01-07 03:28:42.000000000 +0300
+++ Makefile	2009-01-10 12:30:13.000000000 +0300
@@ -99,6 +99,11 @@
 .if exists(${LOCALBASE}/include/tdb.h)
 IGNORE=			doesn't compile when tdb is installed. Uninstall databases/tdb port
 .endif
+# Stop building if Samba 3.0.x or previous is installed
+OLD_SAMBA!=		grep -s -q SMBC_internal_data /usr/local/include/libsmbclient.h; echo $$?
+.if ${OLD_SAMBA}==1
+IGNORE=			doesn't compile when old Samba version installed
+.endif
 # Let process generate meaningful backtrace on a core dump
 LIB_DEPENDS+=		execinfo.1:${PORTSDIR}/devel/libexecinfo
 


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->timur 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Jan 16 09:00:23 UTC 2009 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=130610 
State-Changed-From-To: open->closed 
State-Changed-By: timur 
State-Changed-When: Sun Feb 22 02:38:02 UTC 2009 
State-Changed-Why:  
Hi! 

A new version of port, net/samba32 3.2.8 was commited, that tries to 
address this problem. 

Please, try it. 

With regards, Timur. 


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