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