Linux源码编译安装rrdtool

1、定义变量

  1. BUILD_DIR=/tmp/rrdbuild
  2. INSTALL_DIR=/usr/local/rrdtool
  3. mkdir -p $BUILD_DIR
  4. cd $BUILD_DIR

2、安装rrdtool。

  1. wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
  2.  gunzip -c rrdtool-x.y.z.tar.gz | tar xf -
  3.  cd rrdtool-x.y.z
  4.  ./configure --prefix=$INSTALL_DIR && make && make install

如果安装失败,请继续第三步安装所需依赖。
3、安装依赖
定义变量

  1. export
  2. export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
  3. export PATH=$INSTALL_DIR/bin:$PATH

3.1、安装pkgconfig

  1. cd $BUILD_DIR
  2. wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.26.tar.gz
  3. gunzip -c pkg-config-0.26.tar.gz | tar xf -
  4.  cd pkg-config-0.26
  5.  ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install
  8. export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config

3.2、安装zlib

  1. cd $BUILD_DIR
  2. wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
  3.  gunzip -c zlib-1.2.3.tar.gz | tar xf -
  4.  cd zlib-1.2.3
  5.  ./configure --prefix=$INSTALL_DIR  --shared
  6.  make
  7.  make install

3.3、安装libpng

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
  3.  gunzip -c libpng-1.2.18.tar.gz | tar xf -
  4.  cd libpng-1.2.18
  5.  env ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install

3.4、安装freetype

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
  3.  gunzip -c freetype-2.3.5.tar.gz | tar xf -
  4.  cd freetype-2.3.5
  5.  ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install

3.5、安装LibXML2

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
  3.  gunzip -c libxml2-2.6.32.tar.gz | tar xf -
  4.  cd libxml2-2.6.32
  5.  ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install

3.6、安装fontconfig

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
  3.  gunzip -c fontconfig-2.4.2.tar.gz   | tar xf -
  4.  cd fontconfig-2.4.2
  5.  ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config
  6.  make
  7.  make install

3.7、安装Pixman

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
  3.  gunzip -c pixman-0.10.0.tar.gz  | tar xf -
  4.  cd pixman-0.10.0
  5.  ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install

3.8、安装Cairo

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
  3.  gunzip -c cairo-1.6.4.tar.gz   | tar xf -
  4.  cd cairo-1.6.4
  5.  ./configure --prefix=$INSTALL_DIR \
  6.     --enable-xlib=no \
  7.     --enable-xlib-render=no \
  8.     --enable-win32=no \
  9.   
  10.  make
  11.  make install

3.9、安装Glib

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
  3.  gunzip -c glib-2.15.4.tar.gz  | tar xf -
  4.  cd glib-2.15.4
  5.  ./configure --prefix=$INSTALL_DIR
  6.  make
  7.  make install

3.10、安装Pango

  1. cd $BUILD_DIR
  2.  wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
  3.  bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
  4.  cd pango-1.21.1
  5.  ./configure --prefix=$INSTALL_DIR --without-x
  6.  make
  7.  make install

3.11、重新安装rrdtool

  1. cd $BUILD_DIR/rrdtool-1.4.6
  2. ./configure --prefix=$INSTALL_DIR
  3.  make clean
  4.  make
  5.  make install
  6. ln -s /usr/local/rrdtool/bin/* /usr/local/bin/
标签:Linux 发布于:2019-11-23 12:19:05