歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 64位 CentOS 5.6 中 rrdtool 的編譯安裝

64位 CentOS 5.6 中 rrdtool 的編譯安裝

日期:2017/2/28 16:00:04   编辑:Linux教程

所有包都在code.google.com或者sourceforge之類的地方尋找盡可能新的版本,名稱以及md5如下:


  1. cgilib-0.7.tar.gz 2c7053f58dfb06f7a80a112797ed7e86
  2. expat-2.0.1.tar.gz ee8b492592568805593f81f8cdf2a04c
  3. fontconfig-2.8.0.tar.gz 77e15a92006ddc2adbb06f840d591c0e
  4. freetype-2.4.8.tar.gz 5d82aaa9a4abc0ebbd592783208d9c76
  5. gd-2.0.33.tar.gz be0a6d326cd8567e736fbc75df0a5c45
  6. jpegsrc.v8c.tar.gz a2c10c04f396a9ce72894beb18b4e1f9
  7. libart_lgpl-2.3.21.tar.gz 722471ec8ae084af4293126d06b60880
  8. libpng-1.5.7.tar.gz 944b56a84b65d94054cc73d7ff965de8
  9. libxml2-2.7.8.tar.gz 8127a65e8c3b08856093099b52599c86
  10. rrdtool-1.4.5.tar.gz 4d116dba9a0888d8aaac179e35d3980a
  11. zlib-1.2.5.tar.gz c735eab2d659a96e5a594c9e8541ad63


將以上的包放在同一個目錄內,比如 /root/rrdtool/ 中
########################### START ##################################### #將以下內容保存為 install_rrdtool.sh
  1. #!/bin/sh
  2. export CFLAGS="-O3 -fPIC"
  3. tar zxvf zlib-1.2.5.tar.gz
  4. cd zlib-1.2.5
  5. CFLAGS="-O3 -fPIC" ./configure --prefix=/usr
  6. make
  7. make install
  8. cd ..
  9. echo
  10. read -n 1 -p 'Press any key to continue...'
  11. echo
  12. tar zxvf expat-2.0.1.tar.gz
  13. cd expat-2.0.1
  14. ./configure
  15. make
  16. make install
  17. cd ..
  18. echo
  19. read -n 1 -p 'Press any key to continue...'
  20. echo
  21. tar zxvf cgilib-0.7.tar.gz
  22. cd cgilib-0.7
  23. aclocal
  24. autoconf
  25. libtoolize --force
  26. automake --add-missing --foreign
  27. ./configure
  28. make
  29. make install
  30. cd ..
  31. echo
  32. read -n 1 -p 'Press any key to continue...'
  33. echo
  34. tar zxvf libpng-1.5.7.tar.gz
  35. cd libpng-1.5.7
  36. mv scripts/makefile.linux ./makefile
  37. make
  38. make install
  39. cd ..
  40. echo
  41. read -n 1 -p 'Press any key to continue...'
  42. echo
  43. tar zxvf freetype-2.4.8.tar.gz
  44. cd freetype-2.4.8
  45. ./configure --prefix=/usr/local/freetype
  46. make
  47. make install
  48. cd ..
  49. echo
  50. read -n 1 -p 'Press any key to continue...'
  51. echo
  52. tar zxvf fontconfig-2.8.0.tar.gz
  53. cd fontconfig-2.8.0
  54. ./configure --with-freetype-config=/usr/local/freetype/bin/freetype-config
  55. make
  56. make install
  57. cd ..
  58. echo
  59. read -n 1 -p 'Press any key to continue...'
  60. echo
  61. tar zxvf libart_lgpl-2.3.21.tar.gz
  62. cd libart_lgpl-2.3.21
  63. ./configure
  64. make
  65. make install
  66. cd ..
  67. echo
  68. read -n 1 -p 'Press any key to continue...'
  69. echo
  70. tar zxvf libxml2-2.7.8.tar.gz
  71. cd libxml2-2.7.8
  72. ./configure --with-zlib=/usr
  73. make
  74. make install
  75. cd ..
  76. echo
  77. read -n 1 -p 'Press any key to continue...'
  78. echo
  79. tar zxvf jpegsrc.v8c.tar.gz
  80. cd jpeg-8c/
  81. ./configure --prefix=/usr/local/libjpeg --enable-shared --enable-static
  82. make
  83. make install
  84. cd ..
  85. echo
  86. read -n 1 -p 'Press any key to continue...'
  87. echo
  88. tar zxvf gd-2.0.33.tar.gz
  89. cd gd-2.0.33
  90. ./configure --prefix=/usr/local/libgd --with-png --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/libjpeg --with-xpm --enable-m4_pattern_allow
  91. make
  92. make install
  93. cd ..
  94. echo
  95. read -n 1 -p 'Press any key to continue...'
  96. echo
  97. tar zxvf rrdtool-1.4.5.tar.gz
  98. cd rrdtool-1.4.5
  99. ./configure --prefix=/usr/local/rrdtool --disable-python --disable-tcl
  100. make
  101. make install
  102. #驗證
  103. /usr/local/rrdtool/bin/rrdtool --help
########################### END ####################################
然後執行該腳本即可
  1. chmod u+x install_rrdtool.sh;
  2. ./install_rrdtool.sh > test.log;
可能會有很多warning,但只要沒有嚴重錯誤,就可以一直回車,直至腳本運行完成。 如果覺得煩的話,可以刪掉 read -n 1 -p 'Press any key to continue...' 的部分,那樣腳本就直接能運行完了。 運行完成後,rrdtool即安裝完畢,可以手動進行下測試。
Copyright © Linux教程網 All Rights Reserved