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