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.

185 lines
4.9 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.6.0
  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. https://mirror.eu.oneandone.net/software/openldap/openldap-release/ \
  14. https://www.openldap.org/software/download/OpenLDAP/openldap-release/
  15. PKG_HASH:=b71c580eac573e9aba15d95f33dd4dd08f2ed4f0d7fc09e08ad4be7ed1e41a4f
  16. PKG_LICENSE:=OLDAP-2.8
  17. PKG_LICENSE_FILES:=LICENSE
  18. PKG_CPE_ID:=cpe:/a:openldap:openldap
  19. PKG_FIXUP:=autoreconf
  20. # Fixes the following:
  21. # libtool: Version mismatch error. This is libtool 2.4.2, but the
  22. # libtool: definition of this LT_INIT comes from libtool 2.4.6.
  23. # libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2
  24. # libtool: and run autoconf again.
  25. PKG_REMOVE_FILES:=build/ltversion.m4
  26. PKG_CONFIG_DEPENDS := \
  27. CONFIG_OPENLDAP_DEBUG \
  28. CONFIG_OPENLDAP_CRYPT \
  29. CONFIG_OPENLDAP_MONITOR \
  30. CONFIG_OPENLDAP_DB47 \
  31. CONFIG_OPENLDAP_ICU
  32. include $(INCLUDE_DIR)/package.mk
  33. define Package/libopenldap/Default
  34. SECTION:=net
  35. CATEGORY:=Network
  36. SUBMENU:=OpenLDAP
  37. TITLE:=LDAP directory suite
  38. URL:=https://www.openldap.org/
  39. MAINTAINER:=W. Michael Petullo <mike@flyn.org>
  40. endef
  41. define Package/libopenldap
  42. $(call Package/libopenldap/Default)
  43. MENU:=1
  44. DEPENDS:=+libopenssl +libsasl2 +libpthread +libuuid +OPENLDAP_DB47:libdb47 +OPENLDAP_ICU:icu
  45. TITLE+= (libraries)
  46. endef
  47. define Package/openldap/config
  48. source "$(SOURCE)/Config.in"
  49. endef
  50. define Package/libopenldap/description
  51. 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.
  52. endef
  53. define Package/libopenldap/conffiles
  54. /etc/openldap/ldap.conf
  55. endef
  56. define Package/openldap-utils
  57. $(call Package/libopenldap/Default)
  58. DEPENDS:=+libopenldap
  59. TITLE+= (utilities)
  60. endef
  61. define Package/openldap-utils/description
  62. This package contains client programs required to access LDAP servers.
  63. endef
  64. define Package/openldap-server
  65. $(call Package/libopenldap/Default)
  66. DEPENDS:=+libopenldap +libuuid
  67. TITLE+= (server)
  68. endef
  69. define Package/openldap-server/description
  70. This package contains server programs required to provide LDAP services.
  71. endef
  72. define Package/openldap-server/conffiles
  73. /etc/openldap/slapd.conf
  74. /etc/init.d/ldap
  75. endef
  76. TARGET_CFLAGS += $(FPIC) -lpthread \
  77. -DURANDOM_DEVICE=\\\"/dev/urandom\\\"
  78. CONFIGURE_ARGS += \
  79. --enable-shared \
  80. --enable-static \
  81. --enable-dynamic \
  82. --enable-syslog \
  83. --with-cyrus-sasl \
  84. --with-threads \
  85. --with-tls \
  86. --with-yielding_select="yes" \
  87. --enable-null \
  88. --disable-relay
  89. ifdef CONFIG_OPENLDAP_CRYPT
  90. CONFIGURE_ARGS+= --enable-crypt
  91. else
  92. CONFIGURE_ARGS+= --disable-crypt
  93. endif
  94. ifdef CONFIG_OPENLDAP_MONITOR
  95. CONFIGURE_ARGS+= --enable-monitor
  96. else
  97. CONFIGURE_ARGS+= --disable-monitor
  98. endif
  99. ifdef CONFIG_OPENLDAP_DEBUG
  100. CONFIGURE_ARGS+= --enable-debug
  101. else
  102. CONFIGURE_ARGS+= --disable-debug
  103. endif
  104. ifdef CONFIG_OPENLDAP_DB47
  105. CONFIGURE_ARGS+= \
  106. --enable-bdb \
  107. --enable-hdb
  108. else
  109. CONFIGURE_ARGS+= \
  110. --disable-bdb \
  111. --disable-hdb
  112. endif
  113. ifndef CONFIG_OPENLDAP_ICU
  114. CONFIGURE_VARS += \
  115. ol_cv_lib_icu="no"
  116. endif
  117. define Build/Compile
  118. $(MAKE) -C $(PKG_BUILD_DIR) \
  119. DESTDIR="$(PKG_INSTALL_DIR)" \
  120. HOSTCC="$(HOSTCC)" \
  121. depend all install
  122. cd $(PKG_BUILD_DIR)/libraries/liblmdb && $(MAKE) $(CONFIGURE_VARS)
  123. endef
  124. define Build/InstallDev
  125. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  126. $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/
  127. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/
  128. endef
  129. define Package/libopenldap/install
  130. $(INSTALL_DIR) $(1)/etc/openldap $(1)/usr/lib
  131. $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
  132. $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
  133. endef
  134. define Package/openldap-utils/install
  135. $(INSTALL_DIR) $(1)/usr/bin
  136. $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
  137. endef
  138. define Package/openldap-server/install
  139. $(INSTALL_DIR) $(1)/etc/init.d
  140. $(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
  141. $(INSTALL_DIR) $(1)/etc/openldap/schema
  142. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
  143. $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. # NB: OpenLDAP installs slapd into libexecdir, not sbindir
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
  147. $(eval SLAPTOOLS := slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema)
  148. for i in $(SLAPTOOLS); do \
  149. $(LN) ./slapd $(1)/usr/sbin/$$$$i; \
  150. done
  151. endef
  152. $(eval $(call BuildPackage,libopenldap))
  153. $(eval $(call BuildPackage,openldap-utils))
  154. $(eval $(call BuildPackage,openldap-server))