AndyViky 2012-12-13
首先.src.rpm的包是包含了源代码的rpm包, 在安装时需要进行编译. 这类软件包在CentOS 6.2下有两种安装方法
一、
# rpm -ivh ganglia-web-3.5.4-1.src.rpm
1:ganglia-web ########################################### [100%]
# ls /root/rpmbuild/SPECS/
ganglia-web.spec
# ls /root/rpmbuild/SOURCES/
ganglia-web-3.5.4.tar.gz
# rpmbuild -bp ganglia-web.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6qKvVF
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf ganglia-web-3.5.4
+ /bin/tar -xvvf -
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/ganglia-web-3.5.4.tar.gz
drwxr-xr-x vuksan/vuksan 0 2012-10-26 03:01 ganglia-web-3.5.4/
-rw-r--r-- vuksan/vuksan 11565 2012-10-26 03:01 ganglia-web-3.5.4/conf_default.php
-rw-r--r-- vuksan/vuksan 1919 2012-10-26 03:00 ganglia-web-3.5.4/views.php
-rwxr-xr-x vuksan/vuksan 16718 2012-10-26 03:00 ganglia-web-3.5.4/header.php
-rw-r--r-- vuksan/vuksan 2230 2012-10-26 03:00 ganglia-web-3.5.4/ganglia-web.spec.in
-rw-r--r-- vuksan/v
。
。
。
-rw-r--r-- vuksan/vuksan 2094 2012-10-26 03:01 ganglia-web-3.5.4/ganglia-web.spec
-rw-r--r-- vuksan/vuksan 1810 2012-10-26 03:00 ganglia-web-3.5.4/TODO
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ganglia-web-3.5.4
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
# cd ../
BUILD/ BUILDROOT/ RPMS/ SOURCES/ SPECS/ SRPMS/
# cd ../BUILD/ganglia-web-3.5.4/
这个目录相当于你解压出来的源码包,执行老三步;
# ./configure 可以加上参数, 也可以具体看./configure --help, 按照指导进行安装
# make && make install
二、
直接对你的.src.rpm进行rebuild
说明: --rebuild
build binary package from
*建立二进制包
# rpmbuild --rebuild ganglia-web-3.5.4-1.src.rpm
Installing ganglia-web-3.5.4-1.src.rpm
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.gmgvJa
+ umask 022
+ cd /root/rpmbuild/BUILD
+ LANG=C
+ export LANG
+ unset DISPLAY
+ cd /root/rpmbuild/BUILD
+ rm -rf ganglia-web-3.5.4
+ /bin/tar -xvvf -
+ /usr/bin/gzip -dc /root/rpmbuild/SOURCES/ganglia-web-3.5.4.tar.gz
drwxr-xr-x vuksan/vuksan 0 2012-10-26 03:01 ganglia-web-3.5.4/
-rw-r--r-- vuksan/vuksan 11565 2012-10-26 03:01 ganglia-web-3.5.4/conf_default.php
-rw-r--r-- vuksan/vuksan
。
。
。
-rw-r--r-- vuksan/vuksan 1810 2012-10-26 03:00 ganglia-web-3.5.4/TODO
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd ganglia-web-3.5.4
+ /bin/chmod -Rf a+rX,u+w,g-w,o-w .
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.uIA9bj
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd ganglia-web-3.5.4
+ LANG=C
+ export LANG
+ unset DISPLAY
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.YIT8Er
+ umask 022
+ cd /root/rpmbuild/BUILD
+ '[' /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64 '!=' / ']'
+ rm -rf /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64
++ dirname /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64
+ mkdir -p /root/rpmbuild/BUILDROOT
+ mkdir /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64
+ cd ganglia-web-3.5.4
+ LANG=C
+ export LANG
+ unset DISPLAY
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64
+ /bin/mkdir -p /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64//var/www/html/ganglia
+ /bin/cp -rf AUTHORS COPYING Makefile README TODO actions.php aggregate_graphs.php api autorotation.php calendar.php cluster_legend.html cluster_view.php compare_hosts.php conf conf_default.php conf_default.php.in css dash debian decompose_graph.php dwoo edit_optional_graphs.php eval_conf.php events.php footer.php functions.php ganglia-web ganglia-web.spec ganglia-web.spec.in ganglia.php get_context.php get_ganglia.php get_overlay_events.php global.php graph.d graph.php graph_all_periods.php grid_tree.php header.php host_overview.php host_view.php img index.php inspect_graph.php js lib login.php logout.php meta_view.php mobile.php mobile_helper.php nagios node_legend.html physical_view.php pie.php search.php show_node.php stacked.php styles.css tasseo.php tattle_autocomplete.php templates test trend_navigation.php version.php version.php.in views.php views_view.php /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64//var/www/html/ganglia
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64//var/www/html/ganglia/conf
+ /usr/bin/install -d -m 0755 /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/filters
+ /usr/bin/install -d -m 0755 /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/conf
+ /bin/cp -rf conf/default.json conf/event_color.json conf/events.json conf/sql conf/view_default.json /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/conf
+ /usr/bin/install -d -m 0755 /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/dwoo
+ /usr/bin/install -d -m 0755 /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/dwoo/compiled
+ /usr/bin/install -d -m 0755 /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64/var/lib/ganglia/dwoo/cache
+ /usr/lib/rpm/find-debuginfo.sh --strict-build-id /root/rpmbuild/BUILD/ganglia-web-3.5.4
+ /usr/lib/rpm/check-buildroot
+ /usr/lib/rpm/RedHat/brp-compress
+ /usr/lib/rpm/redhat/brp-strip-static-archive /usr/bin/strip
+ /usr/lib/rpm/redhat/brp-strip-comment-note /usr/bin/strip /usr/bin/objdump
+ /usr/lib/rpm/brp-python-bytecompile
+ /usr/lib/rpm/redhat/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-java-repack-jars
Processing files: ganglia-web-3.5.4-1.noarch
。
。
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.jfURUU
+ umask 022
+ cd /root/rpmbuild/BUILD
+ cd ganglia-web-3.5.4
+ /bin/rm -rf /root/rpmbuild/BUILDROOT/ganglia-web-3.5.4-1.x86_64
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.wU17na
+ umask 022
+ cd /root/rpmbuild/BUILD
+ rm -rf ganglia-web-3.5.4
+ exit 0
# ls /root/rpmbuild/RPMS/noarch/ganglia-web-3.5.4-1.noarch.rpm
/root/rpmbuild/RPMS/noarch/ganglia-web-3.5.4-1.noarch.rpm
这个是编译好的二进制文件
# rpm -ivh ganglia-web-3.5.4-1.noarch.rpm
Preparing... ########################################### [100%]
1:ganglia-web ########################################### [100%]
OK;
安装完成
其实挺简单的问题。