[gvfs/f18] Fix compilation against Samba4

Tomas Bzatek tbzatek at fedoraproject.org
Wed Oct 17 12:24:20 UTC 2012


commit 664ede1e0000de9b6b83455d684e3e1fbbec4e5f
Author: Tomas Bzatek <tbzatek at redhat.com>
Date:   Wed Oct 17 14:23:51 2012 +0200

    Fix compilation against Samba4

 gvfs-1.15.0-samba4-includes.patch |   52 +++++++++++++++++++++++++++++++++++++
 gvfs.spec                         |    3 ++
 2 files changed, 55 insertions(+), 0 deletions(-)
---
diff --git a/gvfs-1.15.0-samba4-includes.patch b/gvfs-1.15.0-samba4-includes.patch
new file mode 100644
index 0000000..d48819f
--- /dev/null
+++ b/gvfs-1.15.0-samba4-includes.patch
@@ -0,0 +1,52 @@
+From 82d369758beba0c62f4e7d9d77b57784b38f6f9d Mon Sep 17 00:00:00 2001
+From: Alexander Larsson <alexl at redhat.com>
+Date: Wed, 17 Oct 2012 08:52:56 +0000
+Subject: Find libsmbclient with samba 4
+
+Samba 4 put libsmbclient.h in a subdir and added a smbclient.pc
+file to let us find it. Use it if it exists, falling back on
+the old code.
+---
+diff --git a/configure.ac b/configure.ac
+index 4062a93..e3dde83 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -496,28 +496,31 @@ AM_CONDITIONAL(HAVE_BLURAY, [test "$msg_bluray" = "yes"])
+ dnl ==========================================================================
+ dnl Samba 3.0
+ 
++dnl Samba 4 ships a pc file and requires a non-default include subdir, so pick it up:
++PKG_CHECK_MODULES(SMBCLIENT, smbclient, samba_default_cflags="$SMBCLIENT_CFLAGS",samba_default_cflags=-I/usr/include)
++
+ AC_ARG_ENABLE(samba, AS_HELP_STRING([--disable-samba],[build without samba support]))
+ msg_samba="no"
+ if test "x$enable_samba" != "xno"; then
+   AC_ARG_WITH(samba-includes, AS_HELP_STRING([--with-samba-includes=PREFIX],[Location of samba includes.]),
+-	      with_samba_includes="$withval", with_samba_includes="/usr/include")
++	      with_samba_includes="-I$withval", with_samba_includes=${samba_default_cflags})
+   have_samba_includes="no"
+-  if test "x${with_samba_includes}" != "xno"; then
++  if test "x${with_samba_includes}" != "x-Ino"; then
+ 	CPPFLAGS_save="$CPPFLAGS"
+ 
+-	CPPFLAGS="$CPPFLAGS -I$with_samba_includes"
++	CPPFLAGS="$CPPFLAGS $with_samba_includes"
+ 	AC_CHECK_HEADER(libsmbclient.h, [ samba_includes="yes" ])
+ 	CPPFLAGS="$CPPFLAGS_save"
+ 	
+ 	if test "x{samba_includes}" != "xno" -a "x${samba_includes}" != "x"; then
+ 		have_samba_includes="yes"
+ 		if test "${with_samba_includes}" != "/usr/include" ; then
+-			SAMBA_CFLAGS="-I$with_samba_includes"
++			SAMBA_CFLAGS="$with_samba_includes"
+ 		else
+ 			SAMBA_CFLAGS=""
+ 		fi
+ 		
+-		CPPFLAGS="$CPPFLAGS -I$with_samba_includes"
++		CPPFLAGS="$CPPFLAGS $with_samba_includes"
+ 		AC_CHECK_MEMBER(SMBCCTX.flags,
+ 				[AC_DEFINE(HAVE_SAMBA_FLAGS,, [Defined if flags available in SMBCCTXT])],,
+ 				[#include <libsmbclient.h>])
+--
+cgit v0.9.0.2
diff --git a/gvfs.spec b/gvfs.spec
index cd09d6e..d70854b 100644
--- a/gvfs.spec
+++ b/gvfs.spec
@@ -38,6 +38,8 @@ BuildRequires: libtool
 
 # http://bugzilla.gnome.org/show_bug.cgi?id=567235
 Patch0: gvfs-archive-integration.patch
+# from git master
+Patch1: gvfs-1.15.0-samba4-includes.patch
 
 Obsoletes: gnome-mount <= 0.8
 Obsoletes: gnome-mount-nautilus-properties <= 0.8
@@ -152,6 +154,7 @@ to applications using gvfs.
 %prep
 %setup -q
 %patch0 -p1 -b .archive-integration
+%patch1 -p1 -b .samba4-includes
 
 %build
 # Needed for gvfs-0.2.1-archive-integration.patch


More information about the scm-commits mailing list