Skip to contentSkip to conversation

openldap: Make client binary install configurable

PATCH New Stefan Sørensen 2 participants 2 messages Feb 17, 2015 – Mar 8, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 openldap: Make client binary install configurable

Some OpenLDAP deployment only need the client libraries and not the client tools, so make the tool installation optional.

---
 package/openldap/Config.in   | 12 ++++++++++++
 package/openldap/openldap.mk | 11 +++++++++++
 2 files changed, 23 insertions(+)
package/openldap/Config.in +12 -0
index 1f0b1ea..3085a5c 100644
@@ -10,6 +10,18 @@ config BR2_PACKAGE_OPENLDAP
 
 	  http://www.openldap.org/
 
+if BR2_PACKAGE_OPENLDAP
+
+config BR2_PACKAGE_OPENLDAP_CLIENTS
+	bool "openldap client binaries"
+	default y
+	help
+	  Install the OpenLDAP client tools (ldapadd, ldapcompare, ldapdelete,
+	  ldapexop, ldapmodify, ldapmodrdn, ldappasswd, ldapsearch, ldapurl,
+	  ldapwhoami)
+
+endif
+
 comment "openldap needs a toolchain w/ wchar"
 	depends on BR2_USE_MMU # needs fork()
 	depends on !BR2_USE_WCHAR
package/openldap/openldap.mk +11 -0
index 332b2c4..3e90a87 100644
@@ -55,4 +55,15 @@ OPENLDAP_CONF_OPTS += \
 # executable it is supposed to install, resulting in an error.
 OPENLDAP_MAKE_ENV = STRIP="$(TARGET_STRIP)"
 
+ifeq ($(BR2_PACKAGE_OPENLDAP_CLIENTS),)
+define OPENLDAP_REMOVE_CLIENTS
+	for f in ldapurl ldapexop ldapcompare ldapwhoami ldappasswd ldapmodrdn \
+		ldapdelete ldapmodify ldapsearch; do \
+		rm -rf $(TARGET_DIR)/usr/bin/$f; \
+	done
+	rm -rf $(TARGET_DIR)/etc/openldap
+endef
+OPENLDAP_POST_INSTALL_TARGET_HOOKS += OPENLDAP_REMOVE_CLIENTS
+endif
+
 $(eval $(autotools-package))
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 openldap: Make client binary install configurable

Dear Stefan S?rensen,

Quoted 4 lines · Stefan S?rensen

Some OpenLDAP deployment only need the client libraries and not the client tools, so make the tool installation optional.

Thanks, I've applied, after rewriting the logic to use a make "foreach" loop rather than a shell "for" loop.

See
http://git.buildroot.net/buildroot/commit/?id=c6aa56e081bd31981a547d8f2db060fe05a75d57.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com