1、定义变量
- BUILD_DIR=/tmp/rrdbuild
- INSTALL_DIR=/usr/local/rrdtool
- mkdir -p $BUILD_DIR
- cd $BUILD_DIR
2、安装rrdtool。
- wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
- gunzip -c rrdtool-x.y.z.tar.gz | tar xf –
- cd rrdtool-x.y.z
- ./configure –prefix=$INSTALL_DIR && make && make install
如果安装失败,请继续第三步安装所需依赖。
3、安装依赖
定义变量
- export LDFLAGS="-Wl,–rpath -Wl,${INSTALL_DIR}/lib"
- export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
- export PATH=$INSTALL_DIR/bin:$PATH
3.1、安装pkgconfig
- cd $BUILD_DIR
- wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.26.tar.gz
- gunzip -c pkg-config-0.26.tar.gz | tar xf –
- cd pkg-config-0.26
- ./configure –prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
- export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
3.2、安装zlib
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
- gunzip -c zlib-1.2.3.tar.gz | tar xf –
- cd zlib-1.2.3
- ./configure –prefix=$INSTALL_DIR –shared
- make
- make install
3.3、安装libpng
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
- gunzip -c libpng-1.2.18.tar.gz | tar xf –
- cd libpng-1.2.18
- env CFLAGS="-O3 -fPIC" ./configure –prefix=$INSTALL_DIR
- make
- make install
3.4、安装freetype
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
- gunzip -c freetype-2.3.5.tar.gz | tar xf –
- cd freetype-2.3.5
- ./configure –prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
3.5、安装LibXML2
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
- gunzip -c libxml2-2.6.32.tar.gz | tar xf –
- cd libxml2-2.6.32
- ./configure –prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
3.6、安装fontconfig
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
- gunzip -c 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
3.7、安装Pixman
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
- gunzip -c pixman-0.10.0.tar.gz | tar xf –
- cd pixman-0.10.0
- ./configure –prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
3.8、安装Cairo
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
- gunzip -c 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
3.9、安装Glib
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
- gunzip -c glib-2.15.4.tar.gz | tar xf –
- cd glib-2.15.4
- ./configure –prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
- make
- make install
3.10、安装Pango
- cd $BUILD_DIR
- wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
- bunzip2 -c 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
3.11、重新安装rrdtool
- cd $BUILD_DIR/rrdtool-1.4.6
- ./configure –prefix=$INSTALL_DIR
- make clean
- make
- make install
- ln -s /usr/local/rrdtool/bin/* /usr/local/bin/