Hey everyone, I apologize for all the issues with the HOWTO. Most of the issues 
were weird formatting that the code plugin I use on wordpress did. Right now my 
site is down due to DNS issues but should be up by next week(with an 
updated/fixed HOWTO).  As many have pointed out Fix 3 does not work, this is 
due to syntax errors.  Here is the full corrected rrddeps.sh



Code:

#! /usr/bin/env bash

# This script builds the RRDtool dependencies from source. It untargzips them
# from rrddeps/ into $BUILD_DIR (default is build/) and runs configure/make/
# make install.  Everything is installed into $DESTDIR$ZENHOME, so if $DESTDIR
# is undefined then it is installed into $ZENHOME. If the script finds that a
# library has already been untargzipped into $BUILD_DIR, then it will skip
# that library.  You can run ./rrdclean.sh to remove all the untargzipped
# libraries from $BUILD_DIR.

HOME_DIR=`pwd`

if [ -z "$BUILD_DIR" ]
then
   BUILD_DIR=$HOME_DIR/build
fi

RRDDEPS_DIR=$HOME_DIR/rrddeps
INSTALL_DIR=$ZENHOME

if [ ! -e $BUILD_DIR ]
then
  mkdir -p $BUILD_DIR || exit $?
fi
cd $BUILD_DIR || exit $?

export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
export PATH=$INSTALL_DIR/bin:$PATH

os_name=`uname -s`
if [ "$os_name" == "SunOS" ]
then
  export LDFLAGS="-R${INSTALL_DIR}/lib"
elif [ "$os_name" == "Darwin" ]
then
  export LDFLAGS="-L${INSTALL_DIR}/lib"
else
  export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
fi

export CFLAGS="-O3 -fPIC -I${INSTALL_DIR}/include"
export USE_GETTEXT="yes"
export CPPFLAGS+=" -I${INSTALL_DIR}/include"
if [ ! -e $BUILD_DIR ]
then
  mkdir -p $BUILD_DIR || exit $?
fi
cd $BUILD_DIR || exit $?

export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
export PATH=$INSTALL_DIR/bin:$PATH

os_name=`uname -s`
if [ "$os_name" == "SunOS" ]
then
  export LDFLAGS="-R${INSTALL_DIR}/lib"
elif [ "$os_name" == "Darwin" ]
then
  export LDFLAGS="-L${INSTALL_DIR}/lib"
else
  export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
fi

export CFLAGS="-O3 -fPIC -I${INSTALL_DIR}/include"
export USE_GETTEXT="yes"
export CPPFLAGS+=" -I${INSTALL_DIR}/include"
export LDFLAGS+=" -L${INSTALL_DIR}/lib"

export GNU_CONFIGURE="yes"
export CONFIGURE_ENV="CPPFLAGS=-I/usr/local/zenoss/include 
LDFLAGS=-L/usr/local/zenoss/lib"

build_dep () {
  if [ -e $BUILD_DIR/$dep-* ]
  then
    echo "Skipping $dep..."
  else
    tar xvzf $RRDDEPS_DIR/$dep-*.tar.gz || exit $?
    if [ -n "$patch" ]
    then
      patch -p0 <$RRDDEPS_DIR/$patch || exit $?
    fi
    cd $dep-* || exit $?
    if [ "$dep" == "freetype" ]
    then 
        GNUMAKE=gmake ./configure --prefix=$ZENHOME $confopts || exit $?
        gmake || exit $?
        gmake install DESTDIR="" || exit $?
        if [ -n "$DESTDIR" ] && [ "$DESTDIR" != "/" ]
        then
                gmake install DESTDIR="$DESTDIR" || exit $?
        fi
    else
        ./configure --prefix=$ZENHOME $confopts || exit $?
        make || exit $?
        make install DESTDIR="" || exit $?
        if [ -n "$DESTDIR" ] && [ "$DESTDIR" != "/" ]
        then
                make install DESTDIR="$DESTDIR" || exit $?
        fi
    fi
    cd ..
  fi
}

dep=libiconv
confopts=""
path=""
build_dep

dep=pkg-config
confopts=''
patch=""
build_dep

dep=gettext
confopts=''
patch="gettext-0.17.all.patch01"
build_dep

dep=zlib
confopts="--shared"
patch="zlib-1.2.3.all.patch01"
build_dep

dep=libpng
confopts=''
patch=""
build_dep

dep=freetype
confopts=''
patch=""
build_dep

dep=libxml2
confopts=''
patch=""
build_dep

dep=fontconfig
if [ -e /usr/lib64 ]
then
  confopts="--with-expat-lib=/usr/lib64"
else
  confopts=""
fi
patch=""
build_dep

dep=pixman
confopts=''
patch=""
build_dep

dep=cairo
confopts='--enable-xlib=no --enable-xlib-render=no --enable-win32=no'
patch=""
build_dep

dep=glib
confopts=''
patch=""
build_dep

dep=pango
confopts='--without-x'
tar xvzf $RRDDEPS_DIR/$dep-*.tar.gz || exit $?
cd $dep-* || exit $?

# configure and compile
sed 's/^have_cairo=false$/have_cairo=true/' configure > configure.sed || exit $?
mv -v configure.sed configure || exit $?
chmod 755 configure || exit $?
./configure --prefix=$ZENHOME $confopts || exit $?
make || exit $?

# install in $ZENHOME
make install DESTDIR="" || exit $?
if [ ! -e "${INSTALL_DIR}/etc/pango" ]
then
  mkdir -p "${INSTALL_DIR}/etc/pango" || exit $?
fi
${INSTALL_DIR}/bin/pango-querymodules > 
"${INSTALL_DIR}/etc/pango/pango.modules" || exit $?

# optionally install in $DESTDIR/$ZENHOME for buildbot
if [ -n "$DESTDIR" ] && [ "$DESTDIR" != "/" ]
then
  make install DESTDIR="$DESTDIR" || exit $?
  if [ ! -e "${DESTDIR}/${INSTALL_DIR}/etc/pango" ]
  then
    mkdir -p "${DESTDIR}/${INSTALL_DIR}/etc/pango" || exit $?
  fi
  cp -v "${INSTALL_DIR}/etc/pango/pango.modules" 
"${DESTDIR}/${INSTALL_DIR}/etc/pango/pango.modules" || exit $?
fi

cd ..




If you have any issues with this, or would like me to email you my rrddeps.sh 
just let me know.

-Casey Hillman




-------------------- m2f --------------------

Read this topic online here:
http://forums.zenoss.com/viewtopic.php?p=36574#36574

-------------------- m2f --------------------



_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to