作者/来源:yixinu.com
栏目:运维/编程
日期:2012-06-11 09:27:49
1、安装开发环境包,安装 rpm build ,安装 libuuid
yum groupinstall "Development Tools"
[root@localhost heartbeat]# yum install libuuid libuud-devel -y
2、解压并重新打包
[root@localhost ~]# tar -xjvf Heartbeat-3-0-7e3a82377fa8.tar.bz2 …… [root@localhost ~]# mv Heartbeat-3-0-7e3a82377fa8 heartbeat …… [root@localhost ~]# tar -cjvf heartbeat.tar.bz2 heartbeat/ ……
3、rpmbuild 编译
[root@testserver001 ~]# rpmbuild -ba heartbeat/heartbeat-fedora.spec
Requires: libapphb.so.2 libccmclient.so.1 libclm.so.1 libhbclient.so.1 Processing files: heartbeat-debuginfo-3.0.5-1.el6.i686 Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/heartbeat-3.0.5-1.el6.i386 Wrote: /root/rpmbuild/SRPMS/heartbeat-3.0.5-1.el6.src.rpm Wrote: /root/rpmbuild/RPMS/i686/heartbeat-3.0.5-1.el6.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/heartbeat-libs-3.0.5-1.el6.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/heartbeat-devel-3.0.5-1.el6.i686.rpm Wrote: /root/rpmbuild/RPMS/i686/heartbeat-debuginfo-3.0.5-1.el6.i686.rpm Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.jkPhwZ + umask 022 + cd /root/rpmbuild/BUILD + cd heartbeat + rm -rf /root/rpmbuild/BUILDROOT/heartbeat-3.0.5-1.el6.i386
[root@localhost i686]# ls heartbeat-3.0.5-1.el6.i686.rpm heartbeat-devel-3.0.5-1.el6.i686.rpm heartbeat-debuginfo-3.0.5-1.el6.i686.rpm heartbeat-libs-3.0.5-1.el6.i686.rpm
4、建立YUM仓库,并安装 heartbeat
建立仓库
[root@localhost i686]# createrepo -pdo ./ ./
[root@localhost i686]# ls heartbeat-3.0.5-1.el6.i686.rpm heartbeat-devel-3.0.5-1.el6.i686.rpm repodata heartbeat-debuginfo-3.0.5-1.el6.i686.rpm heartbeat-libs-3.0.5-1.el6.i686.rpm [root@localhost i686]# pwd /root/rpmbuild/RPMS/i686
修改 repo 文件
[dvd] name=dvd baseurl=file:///mnt/dvd gpgcheck=0 enabled=1 [myyum] name=myyum baseurl=file:///root/rpmbuild/RPMS/i686 gpgcheck=0 enabled=1
清空缓存 并安装
[root@localhost i686]# yum clean all Loaded plugins: fastestmirror, refresh-packagekit Cleaning repos: dvd myyum Cleaning up Everything Cleaning up list of fastest mirrors [root@localhost i686]# yum list | grep heart heartbeat.i686 3.0.5-1.el6 myyum heartbeat-debuginfo.i686 3.0.5-1.el6 myyum heartbeat-devel.i686 3.0.5-1.el6 myyum heartbeat-libs.i686 3.0.5-1.el6 myyum [root@localhost i686]# yum install heartbeat