Merge pull request #8518 from neheb/i
[feed/packages.git] / libs / openldap / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=openldap
11 PKG_VERSION:=2.4.47
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
15 PKG_SOURCE_URL:=https://gpl.savoirfairelinux.net/pub/mirrors/openldap/openldap-release/ \
16 http://mirror.eu.oneandone.net/software/openldap/openldap-release/ \
17 http://mirror.switch.ch/ftp/software/mirror/OpenLDAP/openldap-release/ \
18 https://www.openldap.org/software/download/OpenLDAP/openldap-release/
19 PKG_HASH:=f54c5877865233d9ada77c60c0f69b3e0bfd8b1b55889504c650047cc305520b
20 PKG_LICENSE:=OLDAP-2.8
21 PKG_LICENSE_FILES:=LICENSE
22
23 PKG_FIXUP:=autoreconf
24
25 PKG_CONFIG_DEPENDS := \
26 CONFIG_OPENLDAP_DEBUG \
27 CONFIG_OPENLDAP_CRYPT \
28 CONFIG_OPENLDAP_MONITOR \
29 CONFIG_OPENLDAP_DB47 \
30 CONFIG_OPENLDAP_ICU
31
32 include $(INCLUDE_DIR)/package.mk
33
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
43 define Package/libopenldap
44 $(call Package/libopenldap/Default)
45 MENU:=1
46 DEPENDS:=+libopenssl +libsasl2 +libpthread +OPENLDAP_DB47:libdb47 +OPENLDAP_ICU:icu
47 TITLE+= (libraries)
48 endef
49
50 define Package/libopenldap/config
51 config OPENLDAP_DEBUG
52 bool "Enable debugging information"
53 default y
54 help
55 Enable debugging information. This option must be enabled
56 for the loglevel directive to work.
57 config OPENLDAP_CRYPT
58 bool "Crypt(3) passwords support"
59 default n
60 help
61 With crypt(3) password storage scheme enabled, OpenLDAP can
62 receive and store SHA-256 and SHA-512 password hashes from
63 Samba AD-DC. If this option is disabled, synchronization of
64 passwords between Samba AD-DC (v4.5 and above) and OpenLDAP
65 requires use of cleartext passwords.
66 To enable crypt(3) password synchronization functionality:
67 1. Re-include crypt(3) support in OpenWRT by enabling 'Include
68 crypt() support for SHA256, SHA512 and Blowfish ciphers' option
69 in "Advanced configuration options (for developers)" ->
70 "Toolchain Options".
71 2. Provision AD-DC with 'password hash userPassword schemes'
72 option. For more information, see smb.conf manpage for details
73 on 'password hash userPassword schemes'.
74 3. Use a script to synchronize passwords from AD-DC to
75 OpenLDAP. See samba-tool manpage for 'user syncpasswords'.
76 config OPENLDAP_MONITOR
77 bool "Enable monitor backend"
78 default n
79 help
80 Enable monitor backend to obtain information about the running
81 status of the daemon. See OpenLDAP documentation for more
82 information.
83 config OPENLDAP_DB47
84 bool "Berkeley DB support"
85 default n
86 help
87 Enable Berkeley DB support (BDB).
88 config OPENLDAP_ICU
89 bool "ICU support"
90 default n
91 help
92 Enable ICU (International Components for Unicode) support.
93 endef
94
95 define Package/libopenldap/description
96 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.
97 endef
98
99 define Package/libopenldap/conffiles
100 /etc/openldap/ldap.conf
101 endef
102
103 define Package/openldap-utils
104 $(call Package/libopenldap/Default)
105 DEPENDS:=+libopenldap
106 TITLE+= (utilities)
107 endef
108
109 define Package/openldap-utils/description
110 This package contains client programs required to access LDAP servers.
111 endef
112
113 define Package/openldap-server
114 $(call Package/libopenldap/Default)
115 DEPENDS:=+libopenldap +libuuid
116 TITLE+= (server)
117 endef
118
119 define Package/openldap-server/description
120 This package contains server programs required to provide LDAP services.
121 endef
122
123 define Package/openldap-server/conffiles
124 /etc/openldap/slapd.conf
125 /etc/init.d/ldap
126 endef
127
128 TARGET_CFLAGS += $(FPIC) -lpthread \
129 -DURANDOM_DEVICE=\\\"/dev/urandom\\\"
130
131 CONFIGURE_ARGS += \
132 --enable-shared \
133 --enable-static \
134 --enable-dynamic \
135 --enable-syslog \
136 --with-cyrus-sasl \
137 --with-threads \
138 --with-tls \
139 --with-yielding_select="yes" \
140 --enable-null \
141 --disable-relay
142
143
144 ifdef CONFIG_OPENLDAP_CRYPT
145 CONFIGURE_ARGS+= --enable-crypt
146 else
147 CONFIGURE_ARGS+= --disable-crypt
148 endif
149
150 ifdef CONFIG_OPENLDAP_MONITOR
151 CONFIGURE_ARGS+= --enable-monitor
152 else
153 CONFIGURE_ARGS+= --disable-monitor
154 endif
155
156 ifdef CONFIG_OPENLDAP_DEBUG
157 CONFIGURE_ARGS+= --enable-debug
158 else
159 CONFIGURE_ARGS+= --disable-debug
160 endif
161
162 ifdef CONFIG_OPENLDAP_DB47
163 CONFIGURE_ARGS+= \
164 --enable-bdb \
165 --enable-hdb
166 else
167 CONFIGURE_ARGS+= \
168 --disable-bdb \
169 --disable-hdb
170 endif
171
172 ifndef CONFIG_OPENLDAP_ICU
173 CONFIGURE_VARS += \
174 ol_cv_lib_icu="no"
175 endif
176
177 define Build/Compile
178 $(MAKE) -C $(PKG_BUILD_DIR) \
179 DESTDIR="$(PKG_INSTALL_DIR)" \
180 HOSTCC="$(HOSTCC)" \
181 depend all install
182 cd $(PKG_BUILD_DIR)/libraries/liblmdb && $(MAKE) $(CONFIGURE_VARS)
183 endef
184
185 define Build/InstallDev
186 $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
187 $(CP) $(PKG_INSTALL_DIR)/usr/include/{lber,ldap}*.h $(1)/usr/include/
188 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.{a,so*} $(1)/usr/lib/
189 endef
190
191 define Package/libopenldap/install
192 $(INSTALL_DIR) $(1)/etc/openldap $(1)/usr/lib
193 $(CP) $(PKG_INSTALL_DIR)/etc/openldap/ldap.conf $(1)/etc/openldap/
194 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib{lber,ldap}*.so.* $(1)/usr/lib/
195 endef
196
197 define Package/openldap-utils/install
198 $(INSTALL_DIR) $(1)/usr/bin
199 $(CP) $(PKG_INSTALL_DIR)/usr/bin/ldap* $(1)/usr/bin/
200 endef
201
202 define Package/openldap-server/install
203 $(INSTALL_DIR) $(1)/etc/init.d
204 $(INSTALL_BIN) ./files/ldap.init $(1)/etc/init.d/ldap
205 $(INSTALL_DIR) $(1)/etc/openldap/schema
206 $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/openldap/schema/* $(1)/etc/openldap/schema/
207 $(INSTALL_CONF) $(PKG_INSTALL_DIR)/etc/openldap/slapd.conf $(1)/etc/openldap/
208 $(INSTALL_DIR) $(1)/usr/sbin
209 # NB: OpenLDAP installs slapd into libexecdir, not sbindir
210 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/slapd $(1)/usr/sbin/
211 $(eval SLAPTOOLS := slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema)
212 for i in $(SLAPTOOLS); do \
213 $(LN) ./slapd $(1)/usr/sbin/$$$$i; \
214 done
215 endef
216
217 $(eval $(call BuildPackage,libopenldap))
218 $(eval $(call BuildPackage,openldap-utils))
219 $(eval $(call BuildPackage,openldap-server))