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.

193 lines
5.0 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:=1
  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_MONITOR \
  23. CONFIG_OPENLDAP_DB47 \
  24. CONFIG_OPENLDAP_ICU
  25. include $(INCLUDE_DIR)/package.mk
  26. define Package/libopenldap/Default
  27. SECTION:=net
  28. CATEGORY:=Network
  29. SUBMENU:=OpenLDAP
  30. TITLE:=LDAP directory suite
  31. URL:=http://www.openldap.org/
  32. MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  33. endef
  34. define Package/libopenldap
  35. $(call Package/libopenldap/Default)
  36. MENU:=1
  37. DEPENDS:=+libopenssl +libsasl2 +libpthread +OPENLDAP_DB47:libdb47 +OPENLDAP_ICU:icu
  38. TITLE+= (libraries)
  39. endef
  40. define Package/libopenldap/config
  41. config OPENLDAP_DEBUG
  42. bool "Enable debugging information"
  43. default y
  44. help
  45. Enable debugging information. This option must be enabled
  46. for the loglevel directive to work.
  47. config OPENLDAP_MONITOR
  48. bool "Enable monitor backend"
  49. default n
  50. help
  51. Enable monitor backend to obtain information about the running
  52. status of the daemon. See OpenLDAP documentation for more
  53. information.
  54. config OPENLDAP_DB47
  55. bool "Berkeley DB support"
  56. default n
  57. help
  58. Enable Berkeley DB support (BDB).
  59. config OPENLDAP_ICU
  60. bool "ICU support"
  61. default n
  62. help
  63. Enable ICU (International Components for Unicode) support.
  64. endef
  65. define Package/libopenldap/description
  66. 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.
  67. endef
  68. define Package/libopenldap/conffiles
  69. /etc/openldap/ldap.conf
  70. endef
  71. define Package/openldap-utils
  72. $(call Package/libopenldap/Default)
  73. DEPENDS:=+libopenldap
  74. TITLE+= (utilities)
  75. endef
  76. define Package/openldap-utils/description
  77. This package contains client programs required to access LDAP servers.
  78. endef
  79. define Package/openldap-server
  80. $(call Package/libopenldap/Default)
  81. DEPENDS:=+libopenldap +libuuid
  82. TITLE+= (server)
  83. endef
  84. define Package/openldap-server/description
  85. This package contains server programs required to provide LDAP services.
  86. endef
  87. define Package/openldap-server/conffiles
  88. /etc/openldap/slapd.conf
  89. /etc/init.d/ldap
  90. endef
  91. TARGET_CFLAGS += $(FPIC) -lpthread \
  92. -DURANDOM_DEVICE=\\\"/dev/urandom\\\"
  93. CONFIGURE_ARGS += \
  94. --enable-shared \
  95. --enable-static \
  96. --enable-dynamic \
  97. --enable-syslog \
  98. --with-cyrus-sasl \
  99. --with-threads \
  100. --with-tls \
  101. --with-yielding_select="yes" \
  102. --enable-null \
  103. --disable-relay
  104. ifdef CONFIG_OPENLDAP_MONITOR
  105. CONFIGURE_ARGS+= --enable-monitor
  106. else
  107. CONFIGURE_ARGS+= --disable-monitor
  108. endif
  109. ifdef CONFIG_OPENLDAP_DEBUG
  110. CONFIGURE_ARGS+= --enable-debug
  111. else
  112. CONFIGURE_ARGS+= --disable-debug
  113. endif
  114. ifdef CONFIG_OPENLDAP_DB47
  115. CONFIGURE_ARGS+= \
  116. --enable-bdb \
  117. --enable-hdb
  118. else
  119. CONFIGURE_ARGS+= \
  120. --disable-bdb \
  121. --disable-hdb
  122. endif
  123. ifndef CONFIG_OPENLDAP_ICU
  124. CONFIGURE_VARS += \
  125. ol_cv_lib_icu="no"
  126. endif
  127. define Build/Compile
  128. $(MAKE) -C $(PKG_BUILD_DIR) \
  129. DESTDIR="$(PKG_INSTALL_DIR)" \
  130. HOSTCC="$(HOSTCC)" \
  131. depend all install
  132. cd $(PKG_BUILD_DIR)/libraries/liblmdb && $(MAKE) $(CONFIGURE_VARS)
  133. endef
  134. define Build/InstallDev
  135. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  136. $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/
  137. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/
  138. endef
  139. define Package/libopenldap/install
  140. $(INSTALL_DIR) $(1)/etc/openldap $(1)/usr/lib
  141. $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
  142. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
  143. endef
  144. define Package/openldap-utils/install
  145. $(INSTALL_DIR) $(1)/usr/bin
  146. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
  147. endef
  148. define Package/openldap-server/install
  149. $(INSTALL_DIR) $(1)/etc/init.d
  150. $(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
  151. $(INSTALL_DIR) $(1)/etc/openldap/schema
  152. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
  153. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/
  154. $(INSTALL_DIR) $(1)/usr/sbin
  155. # NB: OpenLDAP installs slapd into libexecdir, not sbindir
  156. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
  157. $(eval SLAPTOOLS := slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema)
  158. for i in $(SLAPTOOLS); do \
  159. $(LN) ./slapd $(1)/usr/sbin/$$$$i; \
  160. done
  161. endef
  162. $(eval $(call BuildPackage,libopenldap))
  163. $(eval $(call BuildPackage,openldap-utils))
  164. $(eval $(call BuildPackage,openldap-server))