Created
November 27, 2012 08:03
-
-
Save yangsu/4153059 to your computer and use it in GitHub Desktop.
Script for installing openldap on linux machines locally without sudo permissions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASHRC='~/.bashrc' | |
BINDIR='~/local/bin' | |
mkdir -p $BINDIR | |
cd $BINDIR | |
# Install db4 | |
DBVERSION='db-4.8.30.NC' | |
DBBINPATH="$BINDIR/db4" | |
## Download Package | |
wget "http://download.oracle.com/berkeley-db/$DBVERSION.tar.gz" | |
tar -zxvf $DBVERSION.tar.gz | |
## Configure and install | |
cd $DBVERSION/build_unix/ | |
../dist/configure -prefix=$DBBINPATH | |
make && make install | |
## Set Env Variables | |
export CPPFLAGS="-I$DBBINPATH/include" | |
export LDFLAGS="-L/usr/local/lib -L$DBBINPATH/lib -R$DBBINPATH/lib" | |
export LD_LIBRARY_PATH="$DBBINPATH/lib" | |
# Install Ldap | |
LDAPVERSION=openldap-2.4.33 | |
cd $BINDIR | |
# Download Package | |
wget "http://www.openldap.org/software/download/OpenLDAP/openldap-release/$LDAPVERSION.tgz" | |
gzip -cd $LDAPVERSION.tgz | tar xvf - | |
cd $LDAPVERSION | |
## Configure and install | |
./configure -with-tls=openssl -prefix=$BINDIR/ldap | |
make depend | |
make | |
# make test | |
make install | |
# add ldap bin to PATH | |
echo 'PATH=$PATH:'$BINDIR/ldap/bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment