RRD TOOL安装
1.下载
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
下载完毕,解压缩:
tar zxf rrdtool.tar.gz
cd rrdtool
2.安装必要的软件
看看你的机器有没有这些包,cgilib、zlib、libpng、freetype、libart_lgpl,没有就装吧。
设定环境变量:
set BUILD_DIR=/tmp/rrdbuild
set INSTALL_DIR=/usr/local/rrdtool
开始安装
安装cgilib
cd $BUILD_DIR
wget http://down1.chinaunix.net/distfiles/cgilib-0.5.tar.gz
tar zxf cgilib-0.5.tar.gz
cd cgilib-0.5
make CC=gcc CFLAGS="-O3 -fPIC -I."
mkdir -p $BUILD_DIR/lb/include
cp *.h $BUILD_DIR/lb/include
mkdir -p $BUILD_DIR/lb/lib
cp libcgi* $BUILD_DIR/lb/lib
安装zllib
cd $BUILD_DIR
wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
zlib-1.2.3.tar.gz
cd zlib-1.2.3
env CFLAGS="-O3 -fPIC" ./configure –prefix=$BUILD_DIR/lb
make
make install
安装libpng
cd $BUILD_DIR
wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
tar zxvf libpng-1.2.8-config.tar.gz
cd libpng-1.2.8-config
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC"
./configure –disable-shared –prefix=$BUILD_DIR/lb
make
make install
安装freetype
cd $BUILD_DIR
wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.bz2
tar zxvf freetype-2.3.5.tar.bz2
cd freetype-2.3.5
env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC"
./configure –disable-shared –prefix=$BUILD_DIR/lb
make
make install
安装libart_lgpl
cd $BUILD_DIR
wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
tar zxvf libart_lgpl-2.3.17.tar.gz
cd libart_lgpl-2.3.17
env CFLAGS="-O3 -fPIC" ./configure –disable-shared –prefix=$BUILD_DIR/lb
make
make install
如果你用bash/sh/ash/ksh/zsh,就执行下面的:
IR=-I$BUILD_DIR/lb/include
CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
LDFLAGS="-L$BUILD_DIR/lb/lib"
CFLAGS=-O3
export CPPFLAGS LDFLAGS CFLAGS
真的开始安装rrd了
cd $BUILD_DIR/rrdtool
./configure –prefix=$INSTALL_DIR –disable-python && make clean && make && make install
安装完毕啦。(详细参见rrd安装包中的doc/rrdbuild.txt)