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.

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