41.3. openldap-2.6.15
The LDAP client library and the ldapsearch family of tools
| Version | 2.6.15, release 1 |
| Shelf | auth — Authentication, authorisation, accounts and directory services |
| Phase | 30_foundation (Build Foundation), 83 of 127 in build order |
| Licence | OLDAP-2.8 |
| Homepage | https://www.openldap.org/ |
| Build time | 0.7 SBU |
| Installed size | 1.7 MiB in 230 files |
| Recipe | ports/core/auth/openldap/kpkgbuild |
About
OpenLDAP is the reference implementation of LDAP, the directory protocol. KDOS builds only its client half: the libraries libldap and liblber, the ldapsearch family of command-line tools and the client configuration file /etc/openldap/ldap.conf. There is no slapd server and no load balancer.
The 30_foundation list names the library for two consumers: curl, whose ldap:// and ldaps:// URLs go through libldap, and gnupg, whose dirmngr looks keys and certificates up in LDAP directories. postgresql, nfs-utils and libreoffice link it too.
The recipe is held to one upstream release line by its series key, so a version check never offers a release from a later line (see Filtering).
Why it is in KDOS
The comment above it in script/phases/30_foundation/packages.txt:
libldap, for curl's ldap:// URLs and dirmngr's directory lookups.
Sources
openldap-2.6.15.tar.gz(6.2 MiB)
sha256bc91225dbfc50354033b1303bc91d1a7f6ddd1dc32fac950d79c28fe66d6bca8
upstream: https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.15.tgz
archive copy: sources-1/auth--openldap-2.6.15.tar.gz
Dependencies
Depends on: openssl, cyrus-sasl, mandoc, util-linux.
Required by (6): curl, gnupg, kldap, libreoffice, nfs-utils, postgresql.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install openldap'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/auth/openldap.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/auth/openldap
echo 'bc91225dbfc50354033b1303bc91d1a7f6ddd1dc32fac950d79c28fe66d6bca8 openldap-2.6.15.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/openldap
SRC=$SRC_ROOT/openldap-2.6.15
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf openldap-2.6.15.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--disable-static \
--enable-shared \
--enable-dynamic \
--disable-slapd \
--with-tls=openssl \
--with-cyrus-sasl \
--without-systemd \
--without-fetch
make depend
make
make DESTDIR=$PKG install
rm -f "$PKG"/usr/share/man/man8/*.8 \
"$PKG"/usr/share/man/man5/slap*.5 \
"$PKG"/usr/share/man/man5/lloadd*.5
rmdir "$PKG/usr/share/man/man8"
The switches, and why each is set:
--enable-dynamic— Link theldap*programs against the sharedlibldapandliblber. At configure’s default,auto, they are linked with the libraries built in statically, even though the shared libraries are built and installed.--disable-slapd— Build noslapd, the LDAP server, and none of its tools (slapadd,slapcatand the rest). The image serves no directory.--with-tls=openssl— Do TLS (ldaps://and StartTLS) with OpenSSL rather than GnuTLS. Named this way, configure stops when OpenSSL is missing; atautoit would try GnuTLS next and, finding neither, build with no TLS and only a warning.--with-cyrus-sasl— Authenticate binds with SASL through cyrus-sasl.--without-systemd— No systemd service notification. KDOS has no systemd (No systemd), and the notification is only for the servers; with--disable-slapdconfigure ignores the switch anyway.--without-fetch— Do not read URLs through FreeBSD’sfetch(3)library, which the tree does not carry.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/openldap, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf openldap-2.6.15-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/openldap, and runs the triggers its paths call for.
Contents
Installed programs: ldapadd, ldapcompare, ldapdelete, ldapexop, ldapmodify, ldapmodrdn, ldappasswd, ldapsearch, ldapurl, ldapvc, ldapwhoami.
Installed libraries: liblber.so, libldap.so.
Installed directories: /etc/openldap, /usr/share/licenses/openldap.
Short descriptions
ldapcompare |
LDAP compare tool |
ldapdelete |
LDAP delete entry tool |
ldapexop |
issue LDAP extended operations |
ldapmodify |
LDAP modify entry and LDAP add entry tools |
ldapmodrdn |
LDAP rename entry tool |
ldappasswd |
change the password of an LDAP entry |
ldapsearch |
LDAP search tool |
ldapurl |
LDAP URL formatting tool |
ldapvc |
LDAP verify credentials tool |
ldapwhoami |
LDAP who am i? tool |
lber.pc |
OpenLDAP Lightweight ASN.1 Basic Encoding Rules library |
ldap.pc |
OpenLDAP Lightweight Directory Access Protocol library |
Notes
make depend runs before make, as OpenLDAP’s INSTALL prescribes: it writes the header dependencies into each directory’s Makefile.
The manual pages are installed by directory, whether or not the server is built, so make install puts slapd(8), lloadd(8), slapd.conf(5) and the other server pages on the system even with --disable-slapd. build.sh removes every page in man8, which holds only server pages, and the slap* and lloadd* pages of man5, so man does not describe programs the package does not install.