summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/openldap/openldap_2.4.40.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-support/openldap/openldap_2.4.40.bb')
-rw-r--r--meta-oe/recipes-support/openldap/openldap_2.4.40.bb225
1 files changed, 225 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/openldap/openldap_2.4.40.bb b/meta-oe/recipes-support/openldap/openldap_2.4.40.bb
new file mode 100644
index 000000000..5afcb6a58
--- /dev/null
+++ b/meta-oe/recipes-support/openldap/openldap_2.4.40.bb
@@ -0,0 +1,225 @@
1# OpenLDAP, a license free (see http://www.OpenLDAP.org/license.html)
2#
3SUMMARY = "OpenLDAP Directory Service"
4DESCRIPTION = "OpenLDAP Software is an open source implementation of the Lightweight Directory Access Protocol."
5HOMEPAGE = "http://www.OpenLDAP.org/license.html"
6# The OpenLDAP Public License - see the HOMEPAGE - defines
7# the license. www.openldap.org claims this is Open Source
8# (see http://www.openldap.org), the license appears to be
9# basically BSD. opensource.org does not record this license
10# at present (so it is apparently not OSI certified).
11LICENSE = "OpenLDAP"
12LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=f2bdbaa4f50199a00b6de2ca7ec1db05 \
13 file://LICENSE;md5=153d07ef052c4a37a8fac23bc6031972 \
14"
15SECTION = "libs"
16
17LDAP_VER = "${@'.'.join(d.getVar('PV',1).split('.')[0:2])}"
18
19SRC_URI = "ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/${BP}.tgz \
20 file://openldap-m4-pthread.patch \
21 file://kill-icu.patch \
22 file://openldap-2.4.28-gnutls-gcrypt.patch \
23 file://use-urandom.patch \
24 file://initscript \
25 file://slapd.service \
26 file://thread_stub.patch \
27 file://0001-ITS-8027-require-non-empty-AttributeList.patch \
28 file://0001-ITS-8046-fix-vrFilter_free.patch \
29"
30SRC_URI[md5sum] = "423c1f23d2a0cb96b3e9baf7e9d7dda7"
31SRC_URI[sha256sum] = "d12611a5c25b6499293c2bb7b435dc2b174db73e83f5a8cb7e34f2ce5fa6dadb"
32
33DEPENDS = "util-linux groff-native"
34
35# The original top.mk used INSTALL, not INSTALL_STRIP_PROGRAM when
36# installing .so and executables, this fails in cross compilation
37# environments
38SRC_URI += "file://install-strip.patch"
39
40inherit autotools-brokensep update-rc.d systemd
41
42# CV SETTINGS
43# Required to work round AC_FUNC_MEMCMP which gets the wrong answer
44# when cross compiling (should be in site?)
45EXTRA_OECONF += "ac_cv_func_memcmp_working=yes"
46
47# CONFIG DEFINITIONS
48# The following is necessary because it cannot be determined for a
49# cross compile automagically. Select should yield fine on all OE
50# systems...
51EXTRA_OECONF += "--with-yielding-select=yes"
52# Shared libraries are nice...
53EXTRA_OECONF += "--enable-dynamic"
54
55PACKAGECONFIG ??= "gnutls modules \
56 ldap meta monitor null passwd shell proxycache dnssrv \
57"
58#--with-tls with TLS/SSL support auto|openssl|gnutls [auto]
59PACKAGECONFIG[gnutls] = "--with-tls=gnutls,,gnutls libgcrypt"
60PACKAGECONFIG[openssl] = "--with-tls=openssl,,openssl"
61
62PACKAGECONFIG[sasl] = "--with-cyrus-sasl,--without-cyrus-sasl,cyrus-sasl"
63PACKAGECONFIG[modules] = "lt_cv_dlopen_self=yes --enable-modules,--disable-modules,libtool"
64
65# SLAPD options
66#
67# UNIX crypt(3) passwd support:
68EXTRA_OECONF += "--enable-crypt"
69
70# SLAPD BACKEND
71#
72# The backend must be set by the configuration. This controls the
73# required database.
74#
75# Backends="bdb dnssrv hdb ldap mdb meta monitor ndb null passwd perl relay shell sock sql"
76#
77# Note that multiple backends can be built. The ldbm backend requires a
78# build-time choice of database API. The bdb backend forces this to be
79# DB4. To use the gdbm (or other) API the Berkely database module must
80# be removed from the build.
81md = "${libexecdir}/openldap"
82#
83#--enable-bdb enable Berkeley DB backend no|yes|mod yes
84# The Berkely DB is the standard choice. This version of OpenLDAP requires
85# the version 4 implementation or better.
86PACKAGECONFIG[bdb] = "--enable-bdb=yes,--enable-bdb=no,db"
87
88#--enable-dnssrv enable dnssrv backend no|yes|mod no
89PACKAGECONFIG[dnssrv] = "--enable-dnssrv=mod,--enable-dnssrv=no"
90
91#--enable-hdb enable Hierarchical DB backend no|yes|mod no
92PACKAGECONFIG[hdb] = "--enable-hdb=yes,--enable-hdb=no,db"
93
94#--enable-ldap enable ldap backend no|yes|mod no
95PACKAGECONFIG[ldap] = "--enable-ldap=mod,--enable-ldap=no,"
96
97#--enable-mdb enable mdb database backend no|yes|mod [yes]
98PACKAGECONFIG[mdb] = "--enable-mdb=mod,--enable-mdb=no,"
99
100#--enable-meta enable metadirectory backend no|yes|mod no
101PACKAGECONFIG[meta] = "--enable-meta=mod,--enable-meta=no,"
102
103#--enable-monitor enable monitor backend no|yes|mod yes
104PACKAGECONFIG[monitor] = "--enable-monitor=mod,--enable-monitor=no,"
105
106#--enable-ndb enable MySQL NDB Cluster backend no|yes|mod [no]
107PACKAGECONFIG[ndb] = "--enable-ndb=mod,--enable-ndb=no,"
108
109#--enable-null enable null backend no|yes|mod no
110PACKAGECONFIG[null] = "--enable-null=mod,--enable-null=no,"
111
112#--enable-passwd enable passwd backend no|yes|mod no
113PACKAGECONFIG[passwd] = "--enable-passwd=mod,--enable-passwd=no,"
114
115#--enable-perl enable perl backend no|yes|mod no
116# This requires a loadable perl dynamic library, if enabled without
117# doing something appropriate (building perl?) the build will pick
118# up the build machine perl - not good (inherit perlnative?)
119PACKAGECONFIG[perl] = "--enable-perl=mod,--enable-perl=no,perl"
120
121#--enable-relay enable relay backend no|yes|mod [yes]
122PACKAGECONFIG[relay] = "--enable-relay=mod,--enable-relay=no,"
123
124#--enable-shell enable shell backend no|yes|mod no
125# configure: WARNING: Use of --without-threads is recommended with back-shell
126PACKAGECONFIG[shell] = "--enable-shell=mod --without-threads,--enable-shell=no,"
127
128#--enable-sock enable sock backend no|yes|mod [no]
129PACKAGECONFIG[sock] = "--enable-sock=mod,--enable-sock=no,"
130
131#--enable-sql enable sql backend no|yes|mod no
132# sql requires some sql backend which provides sql.h, sqlite* provides
133# sqlite.h (which may be compatible but hasn't been tried.)
134PACKAGECONFIG[sql] = "--enable-sql=mod,--enable-sql=no,sqlite3"
135
136#--enable-dyngroup Dynamic Group overlay no|yes|mod no
137# This is a demo, Proxy Cache defines init_module which conflicts with the
138# same symbol in dyngroup
139PACKAGECONFIG[dyngroup] = "--enable-dyngroup=mod,--enable-dyngroup=no,"
140
141#--enable-proxycache Proxy Cache overlay no|yes|mod no
142PACKAGECONFIG[proxycache] = "--enable-proxycache=mod,--enable-proxycache=no,"
143FILES_${PN}-overlay-proxycache = "${md}/pcache-*.so.*"
144PACKAGES += "${PN}-overlay-proxycache"
145
146# Append URANDOM_DEVICE='/dev/urandom' to CPPFLAGS:
147# This allows tls to obtain random bits from /dev/urandom, by default
148# it was disabled for cross-compiling.
149CPPFLAGS_append = " -D_GNU_SOURCE -DURANDOM_DEVICE=\'/dev/urandom\'"
150
151do_configure() {
152 cp ${STAGING_DATADIR_NATIVE}/libtool/build-aux/ltmain.sh ${S}/build
153 rm -f ${S}/libtool
154 aclocal
155 libtoolize --force --copy
156 gnu-configize
157 autoconf
158 oe_runconf
159}
160
161LEAD_SONAME = "libldap-${LDAP_VER}.so.*"
162
163# The executables go in a separate package. This allows the
164# installation of the libraries with no daemon support.
165# Each module also has its own package - see above.
166PACKAGES += "${PN}-slapd ${PN}-slurpd ${PN}-bin"
167
168# Package contents - shift most standard contents to -bin
169FILES_${PN} = "${libdir}/lib*.so.* ${sysconfdir}/openldap/ldap.* ${localstatedir}/openldap-data"
170FILES_${PN}-slapd = "${sysconfdir}/init.d ${libexecdir}/slapd ${sbindir} ${localstatedir}/run ${localstatedir}/volatile/run \
171 ${sysconfdir}/openldap/slapd.* ${sysconfdir}/openldap/schema \
172 ${sysconfdir}/openldap/DB_CONFIG.example ${systemd_unitdir}/system/*"
173FILES_${PN}-slurpd = "${libexecdir}/slurpd ${localstatedir}/openldap-slurp ${localstatedir}/run ${localstatedir}/volatile/run"
174FILES_${PN}-bin = "${bindir}"
175FILES_${PN}-dev = "${includedir} ${libdir}/lib*.so ${libdir}/*.la ${libdir}/*.a ${libexecdir}/openldap/*.a ${libexecdir}/openldap/*.la ${libexecdir}/openldap/*.so"
176FILES_${PN}-dbg += "${libexecdir}/openldap/.debug"
177
178do_install_append() {
179 install -d ${D}${sysconfdir}/init.d
180 cat ${WORKDIR}/initscript > ${D}${sysconfdir}/init.d/openldap
181 chmod 755 ${D}${sysconfdir}/init.d/openldap
182 # This is duplicated in /etc/openldap and is for slapd
183 rm -f ${D}${localstatedir}/openldap-data/DB_CONFIG.example
184
185 # Installing slapd under ${sbin} is more FHS and LSB compliance
186 mv ${D}${libexecdir}/slapd ${D}/${sbindir}/slapd
187 SLAPTOOLS="slapadd slapcat slapdn slapindex slappasswd slaptest slapauth slapacl slapschema"
188 cd ${D}/${sbindir}/
189 rm -f ${SLAPTOOLS}
190 for i in ${SLAPTOOLS}; do ln -sf slapd $i; done
191
192 rmdir "${D}${localstatedir}/run"
193 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
194
195 install -d ${D}${systemd_unitdir}/system/
196 install -m 0644 ${WORKDIR}/slapd.service ${D}${systemd_unitdir}/system/
197 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/*.service
198}
199
200INITSCRIPT_PACKAGES = "${PN}-slapd"
201INITSCRIPT_NAME_${PN}-slapd = "openldap"
202INITSCRIPT_PARAMS_${PN}-slapd = "defaults"
203SYSTEMD_SERVICE_${PN}-slapd = "hostapd.service"
204SYSTEMD_AUTO_ENABLE_${PN}-slapd ?= "disable"
205
206
207PACKAGES_DYNAMIC += "^${PN}-backends.* ^${PN}-backend-.*"
208
209python populate_packages_prepend () {
210 backend_dir = d.expand('${libexecdir}/openldap')
211 do_split_packages(d, backend_dir, 'back_([a-z]*)\-.*\.so\..*$', 'openldap-backend-%s', 'OpenLDAP %s backend', extra_depends='', allow_links=True)
212
213 metapkg = "${PN}-backends"
214 d.setVar('ALLOW_EMPTY_' + metapkg, "1")
215 d.setVar('FILES_' + metapkg, "")
216 metapkg_rdepends = []
217 packages = d.getVar('PACKAGES', 1).split()
218 for pkg in packages[1:]:
219 if pkg.count("openldap-backend-") and not pkg in metapkg_rdepends and not pkg.count("-dev") and not pkg.count("-dbg") and not pkg.count("static") and not pkg.count("locale"):
220 metapkg_rdepends.append(pkg)
221 d.setVar('RDEPENDS_' + metapkg, ' '.join(metapkg_rdepends))
222 d.setVar('DESCRIPTION_' + metapkg, 'OpenLDAP backends meta package')
223 packages.append(metapkg)
224 d.setVar('PACKAGES', ' '.join(packages))
225}