port expat to buildroot-ng
[openwrt/svn-archive/archive.git] / libs / openldap / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=openldap
12 PKG_VERSION:=2.2.29
13 PKG_RELEASE:=1
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
17 PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
18 ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
19 ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
20 ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
21 PKG_MD5SUM:=6c4c72a1336aa45b463e738034c078d6
22 PKG_CAT:=zcat
23
24 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
25
26 PKG_CONFIGURE_OPTIONS = \
27 --enable-shared \
28 --enable-static \
29 --disable-debug \
30 --enable-dynamic \
31 --enable-syslog \
32 --disable-local \
33 --disable-slapd \
34 --disable-slurpd \
35 --with-cyrus-sasl \
36 --without-fetch \
37 --with-threads \
38 --with-tls \
39 --with-yielding_select="yes" \
40
41 include $(INCLUDE_DIR)/package.mk
42
43 define Package/libopenldap
44 SECTION:=libs
45 CATEGORY:=Libraries
46 DEPENDS:=+libopenssl +libsasl2
47 TITLE:=LDAP client libraries
48 DESCRIPTION:=LDAP (Lightweight Directory Access Protocol) client libraries.\\\
49 OpenLDAP Software is an open source implementation of the \\\
50 Lightweight Directory Access Protocol (LDAP).\\\
51 \\\
52 This package contains the shared LDAP client libraries, needed by other \\\
53 programs.
54 URL:=http://www.openldap.org/
55 endef
56
57 define Package/libopenldap/conffiles
58 /etc/openldap/ldap.conf
59 endef
60
61 define Package/openldap-utils
62 SECTION:=libs
63 CATEGORY:=Libraries
64 DEPENDS:=libopenldap
65 TITLE:=LDAP client utilities
66 DESCRIPTION:=LDAP (Lightweight Directory Access Protocol) client utilities.\\\
67 OpenLDAP Software is an open source implementation of the \\\
68 Lightweight Directory Access Protocol (LDAP).\\\
69 \\\
70 This package contains client programs required to access LDAP servers.
71 URL:=http://www.openldap.org/
72 endef
73
74 define Build/Configure
75 endef
76
77 define Build/Compile
78 rm -rf $(PKG_INSTALL_DIR)
79 mkdir -p $(PKG_INSTALL_DIR)
80 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
81 ./configure \
82 --target=$(GNU_HOST_NAME) \
83 --host=$(GNU_HOST_NAME) \
84 --build=$(GNU_HOST_NAME) \
85 --program-prefix="" \
86 --program-suffix="" \
87 --prefix=/usr \
88 --exec-prefix=/usr \
89 --bindir=/usr/bin \
90 --datadir=/usr/share \
91 --includedir=/usr/include \
92 --libdir=/usr/lib \
93 --libexecdir=/usr/lib \
94 --localstatedir=/var \
95 --mandir=/usr/share/man \
96 --sbindir=/usr/sbin \
97 --sysconfdir=/etc \
98 $(DISABLE_LARGEFILE) \
99 $(DISABLE_NLS) \
100 $(PKG_CONFIGURE_OPTIONS) \
101 --without-cyrus-sasl \
102 --without-threads \
103 --without-tls \
104 );
105 $(MAKE) -C $(PKG_BUILD_DIR) depend
106 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil
107 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber
108 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblunicode
109 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber clean
110 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil clean
111 (cd $(PKG_BUILD_DIR); rm -f config.cache; \
112 $(TARGET_CONFIGURE_OPTS) \
113 CFLAGS="$(TARGET_CFLAGS)" \
114 CPPFLAGS="-I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \
115 LDFLAGS="-L$(STAGING_DIR)/usr/lib -L$(STAGING_DIR)/lib " \
116 ac_cv_func_memcmp_clean="yes" \
117 ./configure \
118 --target=$(GNU_TARGET_NAME) \
119 --host=$(GNU_TARGET_NAME) \
120 --build=$(GNU_HOST_NAME) \
121 --program-prefix="" \
122 --program-suffix="" \
123 --prefix=/usr \
124 --exec-prefix=/usr \
125 --bindir=/usr/bin \
126 --datadir=/usr/share \
127 --includedir=/usr/include \
128 --libdir=/usr/lib \
129 --libexecdir=/usr/lib \
130 --localstatedir=/var \
131 --mandir=/usr/share/man \
132 --sbindir=/usr/sbin \
133 --sysconfdir=/etc \
134 $(DISABLE_LARGEFILE) \
135 $(DISABLE_NLS) \
136 $(PKG_CONFIGURE_OPTIONS) \
137 );
138 $(MAKE) -C $(PKG_BUILD_DIR) \
139 DESTDIR="$(PKG_INSTALL_DIR)" \
140 all install
141 endef
142
143 define Package/libopenldap/install
144 install -m0755 -d $(1)/etc/openldap
145 $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
146 install -m0755 -d $(1)/usr/lib
147 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
148 install -m0755 -d $(1)/usr/share/openldap
149 $(CP) $(PKG_INSTALL_DIR)/usr/share/openldap/* $(1)/usr/share/openldap/
150 endef
151
152 define Package/openldap-utils/install
153 install -m0755 -d $(1)/usr/bin
154 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
155 endef
156
157 define Build/InstallDev
158 mkdir -p $(STAGING_DIR)/usr/include
159 $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(STAGING_DIR)/usr/include/
160 mkdir -p $(STAGING_DIR)/usr/lib/
161 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(STAGING_DIR)/usr/lib/
162 endef
163
164 define Build/UninstallDev
165 rm -rf \
166 $(STAGING_DIR)/usr/include/{lber,ldap}*.h \
167 $(STAGING_DIR)/usr/lib/lib{lber,ldap}*.{a,so*}
168 endef
169
170 $(eval $(call BuildPackage,libopenldap))
171 $(eval $(call BuildPackage,openldap-utils))