分类: LINUX
2012-02-05 19:33:25
1.编译环境
Centos 5.4
2.编译版本
heartbeat-3.0.2-2.el5.src.rpm
1. 依赖包安装(可以rpm安装也可以源码编译安装)
[root@localhost ~]# rpmbuild --rebuild heartbeat-3.0.2-2.el5.src.rpm
error: Failed build dependencies:
cluster-glue-libs-devel is needed by heartbeat-3.0.2-2.i386
[root@localhost ~]# rpm -ivh cluster-glue-libs-devel-1.0.6-1.6.el5.i386.rpm cluster-glue-libs-1.0.6-1.6.el5.i386.rpm cluster-glue-1.0.6-1.6.el5.i386.rpm
error: Failed dependencies:
libopenhpi.so.2 is needed by cluster-glue-1.0.6-1.6.el5.i386
perl-TimeDate is needed by cluster-glue-1.0.6-1.6.el5.i386
[root@localhost CentOS]# rpm -ivh openhpi-2.14.0-5.el5.i386.rpm openhpi-libs-2.14.0-5.el5.i386.rpm
warning: openhpi-2.14.0-5.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:openhpi-libs ########################################### [ 50%]
2:openhpi ########################################### [100%]
[root@localhost ~]# rpm -ivh /mnt/CentOS/perl-TimeDate-1.16-5.el5.noarch.rpm
warning: /mnt/CentOS/perl-TimeDate-1.16-5.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
Preparing... ########################################### [100%]
1:perl-TimeDate ########################################### [100%]
[root@localhost ~]# rpm -ivh cluster-glue-libs-devel-1.0.6-1.6.el5.i386.rpm cluster-glue-libs-1.0.6-1.6.el5.i386.rpm cluster-glue-1.0.6-1.6.el5.i386.rpm
Preparing... ########################################### [100%]
1:cluster-glue ########################################### [ 33%]
2:cluster-glue-libs ########################################### [ 67%]
3:cluster-glue-libs-devel########################################### [100%]
4.编译SRPM
[root@localhost ~]# rpmbuild --rebuild heartbeat-3.0.2-2.el5.src.rpm
开始编译,完成./configure make 和生成rpm包的过程
…………………………………………省略
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires: heartbeat = 3.0.2-2 libapphb.so.2 libccmclient.so.1 libclm.so.1 libhbclient.so.1
Processing files: heartbeat-debuginfo-3.0.2-2
Provides: bcast.so.debug bz2.so.debug crc.so.debug libapphb.so.2.0.0.debug libccmclient.so.1.0.0.debug libclm.so.1.0.0.debug libhbclient.so.1.0.0.debug majority.so.debug mcast.so.debug md5.so.debug ping.so.debug ping6.so.debug ping_group.so.debug serial.so.debug sha1.so.debug twonodes.so.debug ucast.so.debug weight.so.debug zlib.so.debug
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/heartbeat-3.0.2-2-root-root
Wrote: /usr/src/redhat/RPMS/i386/heartbeat-3.0.2-2.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/heartbeat-libs-3.0.2-2.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/heartbeat-devel-3.0.2-2.i386.rpm
Wrote: /usr/src/redhat/RPMS/i386/heartbeat-debuginfo-3.0.2-2.i386.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.56718
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd heartbeat
+ rm -rf /var/tmp/heartbeat-3.0.2-2-root-root
+ exit 0
Executing(--clean): /bin/sh -e /var/tmp/rpm-tmp.56718
+ umask 022
+ cd /usr/src/redhat/BUILD
+ rm -rf heartbeat
+ exit 0
查看生成的rpm包:
[root@localhost i386]# ls
heartbeat-2.1.3-3.i386.rpm heartbeat-devel-2.1.3-3.i386.rpm heartbeat-libs-3.0.2-2.i386.rpm
heartbeat-3.0.2-2.i386.rpm heartbeat-devel-3.0.2-2.i386.rpm heartbeat-pils-2.1.3-3.i386.rpm
heartbeat-debuginfo-2.1.3-3.i386.rpm heartbeat-gui-2.1.3-3.i386.rpm heartbeat-stonith-2.1.3-3.i386.rpm
heartbeat-debuginfo-3.0.2-2.i386.rpm heartbeat-ldirectord-2.1.3-3.i386.rpm
[root@localhost i386]# pwd
/usr/src/redhat/RPMS/i386