rrdtool在监控展示方面用的比较普遍,照着源码目录的doc/rrdbuild.txt 说明安装,就是依赖比较多,把它弄成个脚本。
## rrdtool
## http://oss.oetiker.ch/rrdtool/index.en.html
##
SRC_DIR=$PWD/src
BUILD_DIR=$PWD/build
INSTALL_DIR=$PWD/rrdtool
export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
export PATH=$INSTALL_DIR/bin:$PATH
export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
export MAKE=make
#mkdir -p $SRC_DIR
#cd $SRC_DIR
#wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
#wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
#wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
#wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.2.tar.gz
mkdir -p $BUILD_DIR
### build pkg-config
cd $BUILD_DIR
gunzip -c $SRC_DIR/pkg-config-0.23.tar.gz | tar xf -
cd pkg-config-0.23
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
## build zlib
cd $BUILD_DIR
gunzip -c $SRC_DIR/zlib-1.2.3.tar.gz | tar xf -
cd zlib-1.2.3
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared
$MAKE
$MAKE install
## build libpng
cd $BUILD_DIR
gunzip -c $SRC_DIR/libpng-1.2.18.tar.gz | tar xf -
cd libpng-1.2.18
env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR
$MAKE
$MAKE install
## build freetype
cd $BUILD_DIR
gunzip -c $SRC_DIR/freetype-2.3.5.tar.gz | tar xf -
cd freetype-2.3.5
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
## build libxml
cd $BUILD_DIR
gunzip -c $SRC_DIR/libxml2-2.6.32.tar.gz | tar xf -
cd libxml2-2.6.32
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
## build fontconfig
cd $BUILD_DIR
gunzip -c $SRC_DIR/fontconfig-2.4.2.tar.gz | tar xf -
cd fontconfig-2.4.2
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --with-freetype-config=$INSTALL_DIR/bin/freetype-config
$MAKE
$MAKE install
## build pixman
cd $BUILD_DIR
gunzip -c $SRC_DIR/pixman-0.10.0.tar.gz | tar xf -
cd pixman-0.10.0
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
## build cairo
cd $BUILD_DIR
gunzip -c $SRC_DIR/cairo-1.6.4.tar.gz | tar xf -
cd cairo-1.6.4
./configure --prefix=$INSTALL_DIR \
--enable-xlib=no \
--enable-xlib-render=no \
--enable-win32=no \
CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
### build libiconv (for glib)
#cd $BUILD_DIR
#gunzip -c $SRC_DIR/libiconv-1.13.1.tar.gz | tar xf -
#cd libiconv-1.13.1
#./configure --prefix=$INSTALL_DIR
#$MAKE
#$MAKE install
## build glib
cd $BUILD_DIR
gunzip -c $SRC_DIR/glib-2.15.4.tar.gz | tar xf -
cd glib-2.15.4
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
#./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --with-libiconv
$MAKE
$MAKE install
## build pango
cd $BUILD_DIR
bunzip2 -c $SRC_DIR/pango-1.21.1.tar.bz2 | tar xf -
cd pango-1.21.1
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x
$MAKE
$MAKE install
### BUILD RRD
cd $BUILD_DIR/rrdtool-1.4.2
./configure --prefix=$INSTALL_DIR --disable-tcl
$MAKE
$MAKE install
|
阅读(1361) | 评论(0) | 转发(0) |