#!/bin/bash export openssl_ver="0.9.7m" export openldap_ver="2.3.28" export BUILD_DIR="/tmp/vmware_ldap_ssl_hack" export DST_DIR="/opt/vmware/vmware_ldap_ssl_hack" export VMWARE_SRV_LIB_DIR="/opt/vmware/server/lib/lib" test -d "${DST_DIR}" && rm -rf "${DST_DIR}" test -d "${BUILD_DIR}" && rm -rf "${BUILD_DIR}" mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" wget wget http://www.openssl.org/source/openssl-${openssl_ver}.tar.gz tar xzvf openssl-${openssl_ver}.tar.gz wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-${openldap_ver}.tgz tar xzvf openldap-${openldap_ver}.tgz cd "${BUILD_DIR}/openssl-${openssl_ver}" ./config shared threads --prefix=${DST_DIR}/openssl-${openssl_ver} MAKEFLAGS=-j2 make && make install cd "${BUILD_DIR}/openldap-${openldap_ver}" #echo "CFLAGS=\"-I${DST_DIR}/openssl-${openssl_ver}/include\" LDFLAGS=\"-L${DST_DIR}/openssl-${openssl_ver}/lib\" LD_LIBRARY_PATH=\"${DST_DIR}/opens sl-${openssl_ver}/lib\" ./configure --prefix=\"/usr\" --sysconfdir=\"/etc\" --datadir=\"/var/lib/openldap-data\" --localstatedir=\"/var\" --disable- slapd --disable-slurpd --disable-backends --disable-overlays --with-threads=posix --disable-static --enable-shared --enable-dynamic --enable-local - -with-tls" #read a CFLAGS="-I${DST_DIR}/openssl-${openssl_ver}/include" \ LDFLAGS="-L${DST_DIR}/openssl-${openssl_ver}/lib" \ LD_LIBRARY_PATH="${DST_DIR}/openssl-${openssl_ver}/lib" \ ./configure --prefix="/usr" \ --sysconfdir="/etc" \ --datadir="/var/lib/openldap-data" \ --localstatedir="/var" \ --disable-slapd \ --disable-slurpd \ --disable-backends \ --disable-overlays \ --with-threads=posix \ --disable-static \ --enable-shared \ --enable-dynamic \ --enable-local \ --with-tls make depend && MAKEFLAGS=-j2 make make install DESTDIR="${DST_DIR}/openldap-${openldap_ver}" echo "install -o 0 -g 0 -m 755 -d \"${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0\"" install -o 0 -g 0 -m 755 -d "${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0" echo "install -o 0 -g 0 -m 444 \"${DST_DIR}/openldap-${openldap_ver}/usr/lib/libldap-2.3.so.0\" \"${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0/\"" install -o 0 -g 0 -m 444 "${DST_DIR}/openldap-${openldap_ver}/usr/lib/libldap-2.3.so.0" "${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0/" echo "ln -s libldap-2.3.so.0 \"${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0/libldap-2.3.so.0.2.16\"" ln -s libldap-2.3.so.0 "${VMWARE_SRV_LIB_DIR}/libldap-2.3.so.0/libldap-2.3.so.0.2.16" echo "install -o 0 -g 0 -m 755 -d \"${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0\"" install -o 0 -g 0 -m 755 -d "${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0" echo "install -o 0 -g 0 -m 444 \"${DST_DIR}/openldap-${openldap_ver}/usr/lib/liblber-2.3.so.0\" \"${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0/\"" install -o 0 -g 0 -m 444 "${DST_DIR}/openldap-${openldap_ver}/usr/lib/liblber-2.3.so.0" "${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0/" echo "ln -s liblber-2.3.so.0 \"${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0/liblber-2.3.so.0.2.16\"" ln -s liblber-2.3.so.0 "${VMWARE_SRV_LIB_DIR}/liblber-2.3.so.0/liblber-2.3.so.0.2.16"