diff --git a/24-cyrus-sasl.sh b/24-cyrus-sasl.sh new file mode 100644 index 0000000..f43d235 --- /dev/null +++ b/24-cyrus-sasl.sh @@ -0,0 +1,68 @@ +#!/bin/bash + +if [ "`whoami`" == "root" ]; then + echo "Danger, Will Robinson!" + echo "Do not execute me as r00t" + exit 1 +fi + +TARBALL="cyrus-sasl-2.1.28.tar.gz" +DNL="https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.28/cyrus-sasl-2.1.28.tar.gz" +SHA256="7ccfc6abd01ed67c1a0924b353e526f1b766b21f42d4562ee635a8ebfc5bb38c" + +[ -d cyrus-sasl-2.1.28 ] && rm -rf cyrus-sasl-2.1.28 + +if [ ! -f ${TARBALL} ]; then + wget ${DNL} + if [ $? -ne 0 ]; then + echo "Could not retrieve ${DNL}" + 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 + +tar -zxf ${TARBALL} && cd cyrus-sasl-2.1.28 + +sed '/saslint/a #include ' -i lib/saslutil.c +sed '/plugin_common/a #include ' -i plugins/cram.c + +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --enable-auth-sasldb \ + --with-dblib=lmdb \ + --with-dbpath=/var/lib/sasl/sasldb2 \ + --with-sphinx-build=no \ + --with-saslauthd=/var/run/saslauthd +if [ $? -ne 0 ]; then + echo "Configure script failed for Cyrus SASL. Sorry." + exit 1 +fi + +make -j1 +if [ $? -ne 0 ]; then + echo "Failed building Cyrus SASL. Sorry." + exit 1 +fi + +cat > makeinstall.sh << "EOF" +#!/bin/bash + +make install +install -d -m700 /var/lib/sasl +install -d -m755 /usr/share/doc/cyrus-sasl-2.1.28/html +install -m644 saslauthd/LDAP_SASLAUTHD /usr/share/doc/cyrus-sasl-2.1.28 +install -m644 doc/legacy/*.html /usr/share/doc/cyrus-sasl-2.1.28/html +EOF + +echo +echo "As the root user:" +echo +echo " cd cyrus-sasl-2.1.28" +echo " bash makeinstall.sh" +echo diff --git a/README.md b/README.md index e9afc75..46e1811 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,8 @@ dependencies outside of LFS. Dependency Two: SQLite3 ----------------------- -Justification: Needed to build RPM itself. Depends upon UnZip for documentation. +Justification: Needed to build RPM itself and for Cyrus SASL. Depends upon UnZip +for documentation. * Script: [`02-sqlite3.sh`](02-sqlite3.sh) * Status: Script Works @@ -223,4 +224,13 @@ Justification: Needed for Cyrus SASL. No build dependencies outside of LFS. * Script: [`23-lmdb.sh`](23-lmdb.sh) * Status: Script Untested +Dependency Twenty-Four: Cyrus SASL +---------------------------------- + +Justification: Needed for OpenLDAP. Requires LMDB and SQLite3 + +* Script: [`24-cyrus-sasl.sh`](24-cyrus-sasl.sh) +* Status: Script Untested +* Note: Does not install files needed to start the auth daemon +