Installer GeoIP avec Bind9

# choisir son répertoire et ses fichiers
COMPILE_DIR=~/monprojet
GEOIP_DOWNLOAD=http://www.maxmind.com/download/geoip/api/c/GeoIP-1.4.5.tar.gz
GEOIP_TGZ=`basename $GEOIP_DOWNLOAD`
GEOIP_DIR=`basename $GEOIP_DOWNLOAD .tar.gz`
BIND9_DOWNLOAD=http://ftp.isc.org/isc/bind9/9.4.3/bind-9.4.3.tar.gz
BIND9_TGZ=`basename $BIND9_DOWNLOAD`
BIND9_DIR=`basename $BIND9_DOWNLOAD .tar.gz`
GEODNS_PATCH_DOWNLOAD=http://www.caraytech.com/geodns/patch.diff
GEODNS_PATCH=`basename $GEODNS_PATCH_DOWNLOAD`

cd $COMPILE_DIR

# getting geoip libraries
wget $GEOIP_DOWNLOAD
tar xzf $GEOIP_TGZ
cd $GEOIP_DIR
./configure ; make

#getting bind
cd $COMPILE_DIR
wget $BIND9_DOWNLOAD
tar zxf $BIND9_TGZ

#getting geodns (geoip binding to dns software)
wget $GEODNS_PATCH_DOWNLOAD

#on applique la rustine (patch) à bind9
cd $BIND9_DIR
patch -p1 > ../$GEODNS_PATCH

# on configure bind9 avec les nouvelles librairies, noter que j'utilise directement la bibliothèque de libGeoIP (sans l'avoir installée)
CFLAGS="-I$COMPILE_DIR/$GEOIP_DIR/libGeoIP" LDFLAGS="-L$COMPILE_DIR/$GEOIP_DIR/libGeoIP/.libs -lGeoIP" LD_LIBRARY_PATH="$COMPILE_DIR/$GEOIP_DIR/libGeoIP/.libs" ./configure --prefix=/usr/local/bind

# compilation
LD_LIBRARY_PATH="$COMPILE_DIR/$GEOIP_DIR/libGeoIP/.libs" make



# tester named