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.

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