382d88190c9a5623f3aff850d2512c28fbc6241e
[openwrt/svn-archive/archive.git] / openwrt / package / openldap / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=openldap
6 PKG_VERSION:=2.2.26
7 PKG_RELEASE:=1
8 PKG_MD5SUM:=afc8700b5738da863b30208e1d3e9de8
9
10 PKG_SOURCE_URL:=ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/ \
11 ftp://sunsite.cnlab-switch.ch/mirror/OpenLDAP/openldap-release/ \
12 ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/ \
13 ftp://ftp.plig.org/pub/OpenLDAP/openldap-release/
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_CAT:=zcat
16
17 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
18 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
19
20 PKG_CONFIGURE_OPTIONS = \
21 --enable-shared \
22 --enable-static \
23 --disable-debug \
24 --enable-dynamic \
25 --enable-syslog \
26 --disable-local \
27 --disable-slapd \
28 --disable-slurpd \
29 --with-cyrus-sasl \
30 --without-fetch \
31 --with-threads \
32 --with-tls \
33 --with-yielding_select="yes" \
34
35 include $(TOPDIR)/package/rules.mk
36
37 $(eval $(call PKG_template,LIBOPENLDAP,libopenldap,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
38 $(eval $(call PKG_template,OPENLDAP_UTILS,openldap-utils,$(PKG_VERSION)-$(PKG_RELEASE),$(ARCH)))
39
40 $(PKG_BUILD_DIR)/.configured:
41 touch $@
42
43 $(PKG_BUILD_DIR)/.built:
44 rm -rf $(PKG_INSTALL_DIR)
45 mkdir -p $(PKG_INSTALL_DIR)
46 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
47 ./configure \
48 --target=$(GNU_HOST_NAME) \
49 --host=$(GNU_HOST_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=/usr \
54 --exec-prefix=/usr \
55 --bindir=/usr/bin \
56 --datadir=/usr/share \
57 --includedir=/usr/include \
58 --libdir=/usr/lib \
59 --libexecdir=/usr/lib \
60 --localstatedir=/var \
61 --mandir=/usr/share/man \
62 --sbindir=/usr/sbin \
63 --sysconfdir=/etc \
64 $(DISABLE_LARGEFILE) \
65 $(DISABLE_NLS) \
66 $(PKG_CONFIGURE_OPTIONS) \
67 --without-cyrus-sasl \
68 --without-threads \
69 --without-tls \
70 )
71 $(MAKE) -C $(PKG_BUILD_DIR) depend
72 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil
73 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber
74 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblunicode
75 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblber clean
76 $(MAKE) -C $(PKG_BUILD_DIR)/libraries/liblutil clean
77 (cd $(PKG_BUILD_DIR); rm -rf config.{cache,status} ; \
78 $(TARGET_CONFIGURE_OPTS) \
79 CFLAGS="$(TARGET_CFLAGS)" \
80 CPPFLAGS="-I$(STAGING_DIR)/usr/include" \
81 LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
82 ac_cv_func_memcmp_clean="yes" \
83 ./configure \
84 --target=$(GNU_TARGET_NAME) \
85 --host=$(GNU_TARGET_NAME) \
86 --build=$(GNU_HOST_NAME) \
87 --program-prefix="" \
88 --program-suffix="" \
89 --prefix=/usr \
90 --exec-prefix=/usr \
91 --bindir=/usr/bin \
92 --datadir=/usr/share \
93 --includedir=/usr/include \
94 --libdir=/usr/lib \
95 --libexecdir=/usr/lib \
96 --localstatedir=/var \
97 --mandir=/usr/share/man \
98 --sbindir=/usr/sbin \
99 --sysconfdir=/etc \
100 $(DISABLE_LARGEFILE) \
101 $(DISABLE_NLS) \
102 $(PKG_CONFIGURE_OPTIONS) \
103 )
104 $(MAKE) -C $(PKG_BUILD_DIR) \
105 DESTDIR="$(PKG_INSTALL_DIR)" \
106 all install
107 touch $@
108
109
110 $(IPKG_LIBOPENLDAP):
111 mkdir -p $(IDIR_LIBOPENLDAP)/etc/openldap
112 cp -fpR $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(IDIR_LIBOPENLDAP)/etc/openldap/
113 mkdir -p $(IDIR_LIBOPENLDAP)/usr/lib/
114 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(IDIR_LIBOPENLDAP)/usr/lib/
115 mkdir -p $(IDIR_LIBOPENLDAP)/usr/share/openldap
116 cp -fpR $(PKG_INSTALL_DIR)/usr/share/openldap/* $(IDIR_LIBOPENLDAP)/usr/share/openldap/
117 $(RSTRIP) $(IDIR_LIBOPENLDAP)
118 $(IPKG_BUILD) $(IDIR_LIBOPENLDAP) $(PACKAGE_DIR)
119
120 $(IPKG_OPENLDAP_UTILS):
121 mkdir -p $(IDIR_OPENLDAP_UTILS)/usr/bin
122 cp -fpR $(PKG_INSTALL_DIR)/usr/bin/ldap* $(IDIR_OPENLDAP_UTILS)/usr/bin/
123 $(RSTRIP) $(IDIR_OPENLDAP_UTILS)
124 $(IPKG_BUILD) $(IDIR_OPENLDAP_UTILS) $(PACKAGE_DIR)
125
126 $(STAGING_DIR)/usr/lib/libldap.so: $(PKG_BUILD_DIR)/.built
127 mkdir -p $(STAGING_DIR)/usr/include
128 cp -fpR $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(STAGING_DIR)/usr/include/
129 mkdir -p $(STAGING_DIR)/usr/lib/
130 cp -fpR $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(STAGING_DIR)/usr/lib/
131 touch $@
132
133 install-dev: $(STAGING_DIR)/usr/lib/libldap.so
134
135 uninstall-dev:
136 rm -rf $(STAGING_DIR)/usr/include/{lber,ldap}*.h
137 rm -rf $(STAGING_DIR)/usr/lib/lib{lber,ldap}*.{a,so*}
138
139 compile-targets: install-dev
140 clean-targets: uninstall-dev