From e847e3a02cee855d68546fc3b989d2ba48b81157 Mon Sep 17 00:00:00 2001 From: YellowJacketLinux Date: Wed, 16 Oct 2024 18:25:39 -0700 Subject: [PATCH] OpenLDAP --- 25-openldap.sh | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 9 ++++++ 2 files changed, 91 insertions(+) create mode 100644 25-openldap.sh diff --git a/25-openldap.sh b/25-openldap.sh new file mode 100644 index 0000000..cf3234a --- /dev/null +++ b/25-openldap.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="openldap-2.6.8.tgz" +DNL="https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-2.6.8.tgz" +SHA256="48969323e94e3be3b03c6a132942dcba7ef8d545f2ad35401709019f696c3c4e" +PATCH="openldap-2.6.8-consolidated-1.patch" +PATCHDNL="https://www.linuxfromscratch.org/patches/blfs/12.2/openldap-2.6.8-consolidated-1.patch" +PATCHSHA256="ee96840f2235bdd810e41e8cbc2faf4d46b83c0c15be937701c147b099d0232d" + +[ -d openldap-2.6.8 ] && rm -rf openldap-2.6.8 + +if [ ! -f ${TARBALL} ]; then + wget ${DNL} + if [ $? -ne 0 ]; then + echo "Could not retrieve ${DNL}" + echo "Sorry." + exit 1 + fi +fi +if [ ! -f ${PATCH} ]; then + wget ${PATCHDNL} + if [ $? -ne 0 ]; then + echo "Could not retrieve ${PATCH}" + echo "Sorry." + exit 1 + fi +fi + +CHECK="`sha256sum ${TARBALL} |awk ' { print $1 } ' `" +if [ "${CHECK}" != "${SHA256}" ]; then + echo "${TARBALL} does not match expected SHA256. Sorry." + exit 1 +fi +CHECK="`sha256sum ${PATCH} |awk ' { print $1 } ' `" +if [ "${CHECK}" != "${PATCHSHA256}" ]; then + echo "${PATCH} does not match expected SHA256. Sorry." + exit 1 +fi + +tar -zxf ${TARBALL} && cd openldap-2.6.8 +patch -Np1 -i ../${PATCH} +autoconf +if [ $? -ne 0 ]; then + echo "Autoconf failed for openldap. Sorry." + exit 1 +fi + +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static \ + --enable-dynamic \ + --disable-debug \ + --disable-slapd \ + --disable-slurpd +if [ $? -ne 0 ]; then + echo "Configure script failed for openldap. Sorry." + exit 1 +fi + +make depend +if [ $? -ne 0 ]; then + echo "make depend failed for openldap. Sorry." + exit 1 +fi +make +if [ $? -ne 0 ]; then + echo "Failed building openldap. Sorry." + exit 1 +fi + +echo +echo "As the root user:" +echo +echo " cd openldap-2.6.8" +echo " make install" +echo diff --git a/README.md b/README.md index 46e1811..5b54b3a 100644 --- a/README.md +++ b/README.md @@ -233,4 +233,13 @@ Justification: Needed for OpenLDAP. Requires LMDB and SQLite3 * Status: Script Untested * Note: Does not install files needed to start the auth daemon +Dependency Twenty-Five: OpenLDAP +-------------------------------- + +Justification: Needed for GnuPG. Requires Cyrus SASL to build. + +* Script: [`25-openldap.sh`](25-openldap.sh) +* Status: Script Untested +* Note: Only installs client libraries, not the daemon +