openldap: Make client binary install configurable
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Tue, 17 Feb 2015 15:43:58 +0000 (16:43 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 8 Mar 2015 13:43:56 +0000 (14:43 +0100)
Some OpenLDAP deployment only need the client libraries and not the client
tools, so make the tool installation optional.

[Thomas: implement the for loop in make rather than in shell.]

Signed-off-by: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/openldap/Config.in
package/openldap/openldap.mk

index 1f0b1eabc3d604a1a35597ffd6b319975da1f4c7..3085a5c87e82e5aa6dc25acbba85c4fd308b79f6 100644 (file)
@@ -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
index 332b2c4ddfa2f254e8d77410c3c357abe79cf4bd..991d36953f3e4dccf2c170825db456539b324e00 100644 (file)
@@ -55,4 +55,16 @@ OPENLDAP_CONF_OPTS += \
 # executable it is supposed to install, resulting in an error.
 OPENLDAP_MAKE_ENV = STRIP="$(TARGET_STRIP)"
 
+ifeq ($(BR2_PACKAGE_OPENLDAP_CLIENTS),)
+OPENLDAP_CLIENTS = \
+       ldapurl ldapexop ldapcompare ldapwhoami \
+       ldappasswd ldapmodrdn ldapdelete ldapmodify \
+       ldapsearch
+define OPENLDAP_REMOVE_CLIENTS
+       $(RM) -f $(foreach p,$(OPENLDAP_CLIENTS),$(TARGET_DIR)/usr/bin/$(p))
+       $(RM) -rf $(TARGET_DIR)/etc/openldap
+endef
+OPENLDAP_POST_INSTALL_TARGET_HOOKS += OPENLDAP_REMOVE_CLIENTS
+endif
+
 $(eval $(autotools-package))