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