干了两天终于把 ganglia以及依赖项(主要是rrdtool)搞定,先放一个草稿,下周再整理
主要收获是 学会用PKG_CONFIG_PATH环境变量来处理非标准路径程序包,以前都是直接修改Makefile或者源文件,比较低级 ^_^
wget http://downloads.sourceforge.net/project/pnp4nagios/PNP/pnp-0.4.14/pnp-0.4.14.tar.gz?r=http%3A%2F%2Fdocs.pnp4nagios.org%2Fpnp-0.4%2Fdwnld&ts=1339554075&use_mirror=nchc
tar zxvf pnp-0.4.14.tar.gz
cd pnp-0.4.14/
./configure
wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.4.10.tar.gz
tar zxvf glib-2.15.4.tar.gz
cd glib-2.15.4/
./configure –prefix=/usr/local/glib
make
make install
cairo depend http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
CFLAGS=”-fPIC -I/usr/local/zlib64/include” LDFLAGS=”-L/usr/local/zlib64/lib” ./configure –prefix=/usr/local/png
libpng depend zlib(CFLAGS=”-fPIC” ./configure –prefix=/usr/local/zlib64 –sharedlibdir=/usr/local/zlib64)
cd ../rrdtool-1.4.7/
http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
LIBXML2_CFLAGS=”-I/usr/local/libxml2/include/libxml2″ LIBXML2_LIBS=”-L/usr/local/libxml2/lib -lxml2 -lm” ./configure –prefix=/usr/local/fontconfig –with-freetype-config=/usr/local/freetype/bin/freetype-config
pixman:
CFLAGS=” -I/usr/local/zlib64/include” LDFLAGS=”-L/usr/local/zlib64/lib -lz -lm” \
PNG_CFLAGS=”-I/usr/local/png/include/libpng12 -DPNG_NO_MMX_CODE” PNG_LIBS=”-L/usr/local/png/lib -lpng12″ \
./configure –prefix=/usr/local/pixman
cairo:
CFLAGS=”-m64 -I/usr/local/zlib64/include” LDFLAGS=”-L/usr/local/zlib64/lib -lz -lm” FONTCONFIG_CFLAGS=”-I/usr/local/fontconfig/include”
FONTCONFIG_LIBS=”-L/usr/local/fontconfig/lib -lfontconfig” FREETYPE_CONFIG=”/usr/local/freetype/bin/freetype-config”
png_REQUIRES=”/usr/local/png/bin/libpng-config” ./configure –prefix=/usr/local/cairo –enable-freetype –enable-pdf
CXXFLAGS=”-m64 -I/usr/local/zlib64/include -I/usr/local/pixman/include/pixman-1″ CFLAGS=”-m64 -I/usr/local/zlib64/include -I/usr/local/pixman/include” LDFLAGS=”-L/usr/local/zlib64/lib -lz -lm” FONTCONFIG_CFLAGS=”-I/usr/local/fontconfig/include” \
FONTCONFIG_LIBS=”-L/usr/local/fontconfig/lib -lfontconfig” FREETYPE_CONFIG=”/usr/local/freetype/bin/freetype-config” \
png_CFLAGS=”-I/usr/local/png/include/libpng12 -DPNG_NO_MMX_CODE” png_LIBS=”-L/usr/local/png/lib -lpng12″ png_REQUIRES=”libpng12″ \
pixman_CFLAGS=”-I/usr/local/pixman/include/pixman-1″ pixman_LIBS=”-L/usr/local/pixman/lib” \
./configure –prefix=/usr/local/cairo –enable-freetype –enable-pdf
pango: /usr/local/png/lib/pkgconfig/
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/cairo/lib/pkgconfig:/usr/local/fontconfig/lib/pkgconfig:/usr/local/glib/lib/pkgconfig/:/usr/local/png/lib/pkgconfig/:/usr/local/freetype/lib/pkgconfig/:/usr/local/pixman/lib/pkgconfig \
FREETYPE_CFLAGS=”-I/usr/local/freetype/include/freetype2 -I/usr/local/freetype/include” FREETYPE_LIBS=”-L/usr/local/freetype/lib -lfreetype” \
FONTCONFIG_CFLAGS=”-I/usr/local/fontconfig/include” FONTCONFIG_LIBS=”-L/usr/local/fontconfig/lib -lfontconfig” \
LDFLAGS=”-L/usr/local/cairo/lib -L/usr/local/pixman/lib -lpixman-1″ \
CAIRO_CFLAGS=”-I/usr/local/cairo/include/cairo” CAIRO_LIBS=”-L/usr/local/cairo/lib -lcairo” \
GLIB_CFLAGS=”-I/usr/local/glib/include/glib-2.0 -I/usr/local/glib/lib/glib-2.0/include” GLIB_LIBS=”-L/usr/local/glib/lib -lglib-2.0 -lgmodule-2.0 -lgobject-2.0″ \
./configure –prefix=/usr/local/pango
修改无数Makefile中的GLIB_CFLAGS
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz
tar zxvf rrdtool-1.4.7.tar.gz
依赖 cairo-png cairo-svg cairo-pdf pangocairo glib-2.0.pc libxml-2.0.p
PKG_CONFIG_PATH=$PKG_CONFIG_PATH”:/usr/local/libxml2/lib/pkgconfig:/usr/local/cario/lib/pkgconfig”
CFLAGS=” -I/usr/local/glib/include/ -I/usr/local/glib/include/glib-2.0 -I/usr/local/glib/lib/glib-2.0/include -I/usr/local/libxml2/include/libxml2 -I/usr/local/cairo/include/cairo -I/usr/local/pango/include/pango-1.0 -I/usr/local/png/include -I/usr/local/zlib64/include -I/usr/local/pixman/include/pixman-1″ \
CPPFLAGS=”-I/usr/local/glib/include/ -I/usr/local/glib/include/glib-2.0 -I/usr/local/glib/lib/glib-2.0/include -I/usr/local/libxml2/include/libxml2 -I/usr/local/cairo/include/cairo -I/usr/local/pango/include/pango-1.0 -I/usr/local/png/include -I/usr/local/zlib64/include -I/usr/local/pixman/include/pixman-1″ \
LDFLAGS=”-L/usr/local/pango/lib -L/usr/local/glib/lib -L/usr/local/libxml2/lib -L/usr/local/cairo/lib -L/usr/local/png/lib -L/usr/local/zlib64/lib” \
LIBS=”-lpango-1.0 -lglib-2.0 -lgmodule-2.0 -lgobject-2.0 -lxml2 -lpng -lcairo -lz -lm” \
./configure –prefix=/usr/local/rrdtool
rpm -i dejavu-2.26-1.17.noarch.rpm
rpm -i rrdtool-1.3.4-2.8.x86_64.rpm
./configure –with-nagios-user=nagios –with-nagios-group=nagios
make all
make install
make install-config
make install-init
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.31.zip
wget http://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz
wget http://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fexpat%2Ffiles%2Fexpat%2F2.1.0%2F&ts=1353639408&use_mirror=nchc
tar zxvf expat-2.1.0.tar.gz
cd expat
CFLAGS=”-fPIC ” ./configure –prefix=/usr/local/expat
1066 make
1067 make install
1063 tar zxvf confuse-2.7.tar.gz
1064 cd confuse-2.7/
./configure –prefix=/usr/local/confuse
1066 make
1067 make install
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’
1085 cd ../pcre-8.31/
1086 ./configure –prefix=/usr/local/pcre
1087 make
1088 make install
CFLAGS=”-I/usr/local/glib/include/ -I/usr/local/glib/include/glib-2.0 -I/usr/local/glib/lib/glib-2.0/include -I/usr/local/libxml2/include/libxml2 -I/usr/local/cairo/include/cairo -I/usr/local/pango/include/pango-1.0 -I/usr/local/png/include -I/usr/local/zlib64/include -I/usr/local/pixman/include/pixman-1 -I/usr/local/expat/include -I/usr/local/apr/include/apr-1″ \
LDFLAGS=”-L/usr/local/apr/lib -L/usr/local/confuse/lib -L/usr/local/pcre/lib” \
./configure –prefix=/usr/local/ganglia –with-libapr=/usr/local/apr –with-libconfuse=/usr/local/confuse –with-libpcre=/usr/local/pcre –with-gmetad –with-librrd=/usr/local/rrdtool