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