You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

220 lines
6.1 KiB

  1. #
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=openldap
  9. PKG_VERSION:=2.4.58
  10. PKG_RELEASE:=$(AUTORELEASE)
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
  12. PKG_SOURCE_URL:=https://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/ \
  13. http://mirror.eu.oneandone.net/software/openldap/openldap-release/ \
  14. http://mirror.switch.ch/ftp/software/mirror/OpenLDAP/openldap-release/ \
  15. https://www.openldap.org/software/download/OpenLDAP/openldap-release/
  16. PKG_HASH:=57b59254be15d0bf6a9ab3d514c1c05777b02123291533134a87c94468f8f47b
  17. PKG_LICENSE:=OLDAP-2.8
  18. PKG_LICENSE_FILES:=LICENSE
  19. PKG_CPE_ID:=cpe:/a:openldap:openldap
  20. PKG_FIXUP:=autoreconf
  21. PKG_CONFIG_DEPENDS := \
  22. CONFIG_OPENLDAP_DEBUG \
  23. CONFIG_OPENLDAP_CRYPT \
  24. CONFIG_OPENLDAP_MONITOR \
  25. CONFIG_OPENLDAP_DB47 \
  26. CONFIG_OPENLDAP_ICU
  27. include $(INCLUDE_DIR)/package.mk
  28. define Package/libopenldap/Default
  29. SECTION:=net
  30. CATEGORY:=Network
  31. SUBMENU:=OpenLDAP
  32. TITLE:=LDAP directory suite
  33. URL:=http://www.openldap.org/
  34. MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  35. endef
  36. define Package/libopenldap
  37. $(call Package/libopenldap/Default)
  38. MENU:=1
  39. DEPENDS:=+libopenssl +libsasl2 +libpthread +OPENLDAP_DB47:libdb47 +OPENLDAP_ICU:icu
  40. TITLE+= (libraries)
  41. endef
  42. define Package/libopenldap/config
  43. config OPENLDAP_DEBUG
  44. bool "Enable debugging information"
  45. default y
  46. help
  47. Enable debugging information. This option must be enabled
  48. for the loglevel directive to work.
  49. config OPENLDAP_CRYPT
  50. bool "Crypt(3) passwords support"
  51. default n
  52. help
  53. With crypt(3) password storage scheme enabled, OpenLDAP can
  54. receive and store SHA-256 and SHA-512 password hashes from
  55. Samba AD-DC. If this option is disabled, synchronization of
  56. passwords between Samba AD-DC (v4.5 and above) and OpenLDAP
  57. requires use of cleartext passwords.
  58. To enable crypt(3) password synchronization functionality:
  59. 1. Re-include crypt(3) support in OpenWRT by enabling 'Include
  60. crypt() support for SHA256, SHA512 and Blowfish ciphers' option
  61. in "Advanced configuration options (for developers)" ->
  62. "Toolchain Options".
  63. 2. Provision AD-DC with 'password hash userPassword schemes'
  64. option. For more information, see smb.conf manpage for details
  65. on 'password hash userPassword schemes'.
  66. 3. Use a script to synchronize passwords from AD-DC to
  67. OpenLDAP. See samba-tool manpage for 'user syncpasswords'.
  68. config OPENLDAP_MONITOR
  69. bool "Enable monitor backend"
  70. default n
  71. help
  72. Enable monitor backend to obtain information about the running
  73. status of the daemon. See OpenLDAP documentation for more
  74. information.
  75. config OPENLDAP_DB47
  76. bool "Berkeley DB support"
  77. default n
  78. help
  79. Enable Berkeley DB support (BDB).
  80. config OPENLDAP_ICU
  81. bool "ICU support"
  82. default n
  83. help
  84. Enable ICU (International Components for Unicode) support.
  85. endef
  86. define Package/libopenldap/description
  87. OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol (LDAP). This package contains the shared LDAP client libraries, needed by other programs.
  88. endef
  89. define Package/libopenldap/conffiles
  90. /etc/openldap/ldap.conf
  91. endef
  92. define Package/openldap-utils
  93. $(call Package/libopenldap/Default)
  94. DEPENDS:=+libopenldap
  95. TITLE+= (utilities)
  96. endef
  97. define Package/openldap-utils/description
  98. This package contains client programs required to access LDAP servers.
  99. endef
  100. define Package/openldap-server
  101. $(call Package/libopenldap/Default)
  102. DEPENDS:=+libopenldap +libuuid
  103. TITLE+= (server)
  104. endef
  105. define Package/openldap-server/description
  106. This package contains server programs required to provide LDAP services.
  107. endef
  108. define Package/openldap-server/conffiles
  109. /etc/openldap/slapd.conf
  110. /etc/init.d/ldap
  111. endef
  112. TARGET_CFLAGS += $(FPIC) -lpthread \
  113. -DURANDOM_DEVICE=\\\"/dev/urandom\\\"
  114. CONFIGURE_ARGS += \
  115. --enable-shared \
  116. --enable-static \
  117. --enable-dynamic \
  118. --enable-syslog \
  119. --with-cyrus-sasl \
  120. --with-threads \
  121. --with-tls \
  122. --with-yielding_select="yes" \
  123. --enable-null \
  124. --disable-relay
  125. ifdef CONFIG_OPENLDAP_CRYPT
  126. CONFIGURE_ARGS+= --enable-crypt
  127. else
  128. CONFIGURE_ARGS+= --disable-crypt
  129. endif
  130. ifdef CONFIG_OPENLDAP_MONITOR
  131. CONFIGURE_ARGS+= --enable-monitor
  132. else
  133. CONFIGURE_ARGS+= --disable-monitor
  134. endif
  135. ifdef CONFIG_OPENLDAP_DEBUG
  136. CONFIGURE_ARGS+= --enable-debug
  137. else
  138. CONFIGURE_ARGS+= --disable-debug
  139. endif
  140. ifdef CONFIG_OPENLDAP_DB47
  141. CONFIGURE_ARGS+= \
  142. --enable-bdb \
  143. --enable-hdb
  144. else
  145. CONFIGURE_ARGS+= \
  146. --disable-bdb \
  147. --disable-hdb
  148. endif
  149. ifndef CONFIG_OPENLDAP_ICU
  150. CONFIGURE_VARS += \
  151. ol_cv_lib_icu="no"
  152. endif
  153. define Build/Compile
  154. $(MAKE) -C $(PKG_BUILD_DIR) \
  155. DESTDIR="$(PKG_INSTALL_DIR)" \
  156. HOSTCC="$(HOSTCC)" \
  157. depend all install
  158. cd $(PKG_BUILD_DIR)/libraries/liblmdb && $(MAKE) $(CONFIGURE_VARS)
  159. endef
  160. define Build/InstallDev
  161. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  162. $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/
  163. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/
  164. endef
  165. define Package/libopenldap/install
  166. $(INSTALL_DIR) $(1)/etc/openldap $(1)/usr/lib
  167. $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
  168. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
  169. endef
  170. define Package/openldap-utils/install
  171. $(INSTALL_DIR) $(1)/usr/bin
  172. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
  173. endef
  174. define Package/openldap-server/install
  175. $(INSTALL_DIR) $(1)/etc/init.d
  176. $(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
  177. $(INSTALL_DIR) $(1)/etc/openldap/schema
  178. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
  179. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/
  180. $(INSTALL_DIR) $(1)/usr/sbin
  181. # NB: OpenLDAP installs slapd into libexecdir, not sbindir
  182. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
  183. $(eval SLAPTOOLS := slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema)
  184. for i in $(SLAPTOOLS); do \
  185. $(LN) ./slapd $(1)/usr/sbin/$$$$i; \
  186. done
  187. endef
  188. $(eval $(call BuildPackage,libopenldap))
  189. $(eval $(call BuildPackage,openldap-utils))
  190. $(eval $(call BuildPackage,openldap-server))