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