samba: add option to install libsmbclient
authorSven Neumann <s.neumann@raumfeld.com>
Mon, 21 Sep 2009 21:26:51 +0000 (23:26 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 21 Sep 2009 21:26:51 +0000 (23:26 +0200)
Closes #301

The libsmbclient library is part of the samba package. It can be used
to build applications that access Samba shares without the need to
mount them. Currently the library is explicitly not installed by
buildroot. Here's a patch that adds a config option to install it.

Signed-off-by: Sven Neumann <s.neumann@raumfeld.com>
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
CHANGES
package/samba/Config.in
package/samba/samba.mk

diff --git a/CHANGES b/CHANGES
index ce096109796d97bc3be1f05276121be288e77769..e0b572026e41ab387ca3eeadfe007c91d79f4a76 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,7 @@
 
        Issues resolved (http://bugs.uclibc.org):
 
+       #301: allow to install libsmbclient
        #477: Add sdl_sound package
        #487: Make kismet package sexier
        #527: misc fixes for dnsmasq package
index 40161b6e3fd58c5f642004eec8d1160cd897bd32..cb4c4f62dd33e3bf38cb50b37d87f23643c806be 100644 (file)
@@ -40,6 +40,15 @@ config BR2_PACKAGE_SAMBA_FINDSMB
 comment "findsmb       - disabled (requires nmblookup, smbclient and perl)"
        depends on !BR2_PACKAGE_SAMBA_SMBCLIENT || !BR2_PACKAGE_SAMBA_NMBLOOKUP || !BR2_PACKAGE_MICROPERL
 
+config BR2_PACKAGE_SAMBA_LIBSMBCLIENT
+       bool "libsmbclient"
+       depends on BR2_PACKAGE_SAMBA
+       help
+         libsmbclient is a library toolset that permits applications
+         to manipulate CIFS/SMB network resources using many of the
+         standards POSIX functions available for manipulating local
+         files.
+
 config BR2_PACKAGE_SAMBA_NET
        bool "net"
        default y
index 82bf152e23749acda922aad19d2df5a9bc7e5b20..c4ecebf2d665e059cb277b89e7b22616fc63537c 100644 (file)
@@ -11,6 +11,14 @@ SAMBA_CAT:=$(ZCAT)
 SAMBA_BINARY:=bin/smbd
 SAMBA_TARGET_BINARY:=usr/sbin/smbd
 
+ifeq ($(BR2_PACKAGE_SAMBA_LIBSMBCLIENT),y)
+SAMBA_LIBSMBCLIENT := libsmbclient
+SAMBA_CONF_OPTIONS := --enable-libsmbclient
+else
+SAMBA_LIBSMBCLIENT :=
+SAMBA_CONF_OPTIONS := --disable-libsmbclient
+endif
+
 $(DL_DIR)/$(SAMBA_SOURCE):
        $(call DOWNLOAD,$(SAMBA_SITE),$(SAMBA_SOURCE))
 
@@ -58,6 +66,7 @@ $(SAMBA_DIR)/.configured: $(SAMBA_DIR)/.unpacked
                --disable-static \
                --disable-cups \
                $(DISABLE_LARGEFILE) \
+               $(SAMBA_CONF_OPTIONS) \
        )
        touch $@
 
@@ -112,7 +121,6 @@ $(TARGET_DIR)/$(SAMBA_TARGET_BINARY): $(SAMBA_DIR)/$(SAMBA_BINARY)
        rm -f $(addprefix $(TARGET_DIR)/usr/bin/ldb, add del edit modify search)
        # Remove not used library by Samba binaries
        rm -f $(TARGET_DIR)/usr/lib/libnetapi*
-       rm -f $(TARGET_DIR)/usr/lib/libsmbclient*
        rm -f $(TARGET_DIR)/usr/lib/libtalloc*
        rm -f $(TARGET_DIR)/usr/lib/libtdb*
        # Remove not wanted Samba binaries
@@ -134,7 +142,12 @@ endif
        rm -rf $(TARGET_DIR)/var/cache/samba
        rm -rf $(TARGET_DIR)/var/lib/samba
 
-samba: libiconv $(TARGET_DIR)/$(SAMBA_TARGET_BINARY)
+libsmbclient: $(SAMBA_DIR)/bin/libsmbclient.so
+       $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+               DESTDIR="$(STAGING_DIR)" \
+               -C $(SAMBA_DIR) installlibs
+
+samba: libiconv $(TARGET_DIR)/$(SAMBA_TARGET_BINARY) $(SAMBA_LIBSMBCLIENT)
 
 samba-source: $(DL_DIR)/$(SAMBA_SOURCE)