2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
16 PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
17 ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
18 ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
19 ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
20 PKG_MD5SUM:=6c4c72a1336aa45b463e738034c078d6
23 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
26 include $(INCLUDE_DIR)/package.mk
28 define Package/openldap/Default
29 TITLE:=LDAP implementation
31 OpenLDAP Software is an open source implementation of the \\\
32 Lightweight Directory Access Protocol (LDAP).
33 URL:=http://www.openldap.org/
36 define Package/libopenldap
37 $(call Package/openldap/Default)
40 DEPENDS:=+libopenssl +libsasl2
44 This package contains the shared LDAP client libraries, needed by other programs.
47 define Package/libopenldap/conffiles
48 /etc/openldap/ldap.conf
51 define Package/openldap-utils
52 $(call Package/openldap/Default)
59 This package contains client programs required to access LDAP servers.
62 PKG_CONFIGURE_OPTIONS = \
75 --with-yielding_select="yes" \
77 define Build/Configure
81 rm -rf $(PKG_INSTALL_DIR)
82 mkdir -p $(PKG_INSTALL_DIR)
83 -$(MAKE) -C $(PKG_BUILD_DIR) \
84 DESTDIR="$(PKG_INSTALL_DIR)" \
86 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
88 --target=$(GNU_HOST_NAME) \
89 --host=$(GNU_HOST_NAME) \
90 --build=$(GNU_HOST_NAME) \
96 --datadir=/usr/share \
97 --includedir=/usr/include \
99 --libexecdir=/usr/lib \
100 --localstatedir=/var \
101 --mandir=/usr/share/man \
102 --sbindir=/usr/sbin \
104 $(DISABLE_LARGEFILE) \
106 $(PKG_CONFIGURE_OPTIONS) \
107 --without-cyrus-sasl \
111 $(MAKE) -C $(PKG_BUILD_DIR) depend
112 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil
113 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber
114 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblunicode
115 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber clean
116 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil clean
117 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
118 $(TARGET_CONFIGURE_OPTS) \
119 CFLAGS="$(TARGET_CFLAGS)" \
120 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
121 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib " \
122 ac_cv_func_memcmp_clean="yes" \
124 --target=$(GNU_TARGET_NAME) \
125 --host=$(GNU_TARGET_NAME) \
126 --build=$(GNU_HOST_NAME) \
127 --program-prefix="" \
128 --program-suffix="" \
132 --datadir=/usr/share \
133 --includedir=/usr/include \
135 --libexecdir=/usr/lib \
136 --localstatedir=/var \
137 --mandir=/usr/share/man \
138 --sbindir=/usr/sbin \
140 $(DISABLE_LARGEFILE) \
142 $(PKG_CONFIGURE_OPTIONS) \
144 $(MAKE) -C $(PKG_BUILD_DIR) \
145 DESTDIR="$(PKG_INSTALL_DIR)" \
149 define Build/InstallDev
150 mkdir -p $(STAGING_DIR)/usr/include
151 $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(STAGING_DIR)/usr/include/
152 mkdir -p $(STAGING_DIR)/usr/lib/
153 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(STAGING_DIR)/usr/lib/
156 define Build/UninstallDev
157 rm -rf $(STAGING_DIR)/usr/include/{lber,ldap}*.h \
158 $(STAGING_DIR)/usr/lib/lib{lber,ldap}*.{a,so*}
161 define Package/libopenldap/install
162 install -d -m0755 $(1)/etc/openldap
163 $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
164 install -d -m0755 $(1)/usr/lib
165 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
166 install -d -m0755 $(1)/usr/share/openldap
167 $(CP) $(PKG_INSTALL_DIR)/usr/share/openldap/* $(1)/usr/share/openldap/
170 define Package/openldap-utils/install
171 install -d -m0755 $(1)/usr/bin
172 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
175 $(eval $(call BuildPackage,libopenldap))
176 $(eval $(call BuildPackage,openldap-utils))