Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Thébaudeau" <benoit.thebaudeau.dev@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] samba: Add support for libnss_win*.so* installation
Date: Wed, 26 Nov 2014 01:00:15 +0100	[thread overview]
Message-ID: <1416960016-5956-1-git-send-email-benoit.thebaudeau.dev@gmail.com> (raw)

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.

Signed-off-by: Beno?t Th?baudeau <benoit.thebaudeau.dev@gmail.com>

---

Changes in v2:
- Make BR2_PACKAGE_SAMBA_LIBNSS_WIN* depend on BR2_TOOLCHAIN_USES_GLIBC
  and BR2_PACKAGE_SAMBA_WINBINDD.
- Use full path for target in 'install -D'.
- Move the definitions of the hook functions inside the corresponding
  conditional blocks.
---
 package/samba/Config.in |   19 +++++++++++++++++++
 package/samba/samba.mk  |   18 ++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/package/samba/Config.in b/package/samba/Config.in
index 8dd0bf2..e2cac9e 100644
--- a/package/samba/Config.in
+++ b/package/samba/Config.in
@@ -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
 
 
diff --git a/package/samba/samba.mk b/package/samba/samba.mk
index 1957997..c87b391 100644
--- a/package/samba/samba.mk
+++ b/package/samba/samba.mk
@@ -135,6 +135,24 @@ endef
 
 SAMBA_POST_INSTALL_TARGET_HOOKS += SAMBA_REMOVE_UNNEEDED_BINARIES
 
+ifeq ($(BR2_PACKAGE_SAMBA_LIBNSS_WINS),y)
+define SAMBA_INSTALL_LIBNSS_WINS
+	# 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 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
-- 
1.7.10.4

             reply	other threads:[~2014-11-26  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  0:00 Benoît Thébaudeau [this message]
2014-11-26  0:09 ` [Buildroot] [PATCH v2] samba: Add support for libnss_win*.so* installation Benoît Thébaudeau
2014-11-26 21:26   ` Thomas Petazzoni
2014-11-26 21:26 ` Thomas Petazzoni
2014-11-27 20:46   ` Benoît Thébaudeau
2014-11-27 21:22     ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416960016-5956-1-git-send-email-benoit.thebaudeau.dev@gmail.com \
    --to=benoit.thebaudeau.dev@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox