samba: Add support for libnss_win*.so* installation
authorBenoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Wed, 26 Nov 2014 00:00:15 +0000 (01:00 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Wed, 26 Nov 2014 21:24:52 +0000 (22:24 +0100)
The libnss_wins and libnss_winbind libraries are required in order to
add support for the wins and winbind sources to the Name Service Switch
(NSS), so make it possible to install them. This is useful in order to
resolve NetBIOS names or user and group information from a Windows NT
server.

These libraries are installed to /lib/ like the standard libnss_*
libraries from (E)GLIBC.

[Thomas: remove useless comments.]

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/samba/Config.in
package/samba/samba.mk

index 8dd0bf2b4acd5678b5e38a78c7c0acc0ef6d8be1..e2cac9e94f6eb65a6a64912f9f3360da6273c3bc 100644 (file)
@@ -240,6 +240,25 @@ config BR2_PACKAGE_SAMBA_LIBSMBCLIENT
          standards POSIX functions available for manipulating local
          files.
 
+config BR2_PACKAGE_SAMBA_LIBNSS_WINS
+       bool "libnss_wins"
+       default y
+       depends on BR2_TOOLCHAIN_USES_GLIBC
+       depends on BR2_PACKAGE_SAMBA_WINBINDD
+       help
+         libnss_wins is a library that permits the Name Service Switch
+         to resolve NetBIOS names.
+
+config BR2_PACKAGE_SAMBA_LIBNSS_WINBIND
+       bool "libnss_winbind"
+       default y
+       depends on BR2_TOOLCHAIN_USES_GLIBC
+       depends on BR2_PACKAGE_SAMBA_WINBINDD
+       help
+         libnss_winbind is a library that permits the Name Service
+         Switch to resolve user and group information from a Windows
+         NT server.
+
 endmenu
 
 
index 19579978cfc86005ac6135c2403202b29cafdb85..ec8e6ecb7ec555de2ee4cd639cbfd9863903800c 100644 (file)
@@ -135,6 +135,22 @@ endef
 
 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_UNNEEDED_BINARIES
 
+ifeq ($(BR2_PACKAGE_SAMBA_LIBNSS_WINS),y)
+define SAMBA_INSTALL_LIBNSS_WINS
+       $(INSTALL) -m 0755 -D $(@D)/nsswitch/libnss_wins.so $(TARGET_DIR)/lib/libnss_wins.so
+       ln -snf libnss_wins.so $(TARGET_DIR)/lib/libnss_wins.so.2
+endef
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_LIBNSS_WINS
+endif
+
+ifeq ($(BR2_PACKAGE_SAMBA_LIBNSS_WINBIND),y)
+define SAMBA_INSTALL_LIBNSS_WINBIND
+       $(INSTALL) -m 0755 -D $(@D)/nsswitch/libnss_winbind.so $(TARGET_DIR)/lib/libnss_winbind.so
+       ln -snf libnss_winbind.so $(TARGET_DIR)/lib/libnss_winbind.so.2
+endef
+SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_INSTALL_LIBNSS_WINBIND
+endif
+
 define SAMBA_REMOVE_SWAT_DOCUMENTATION
        # Remove the documentation
        rm -rf $(TARGET_DIR)/usr/swat/help/manpages