打rpm包的方法

主机环境 RHEL6.5

随便找个tar 包。

keepalived-1.2.13.tar.gz

仅仅演示打rpm包。

yum install rpmbuild

rpmbuild ~ 在家目录下生成rpmbuild路径

[root@nginx1 ~]# cp  /root/rpmbuild/keepalived-1.2.13.tar.gz/SOURCES/
[root@nginx1 ~]# cd /root/rpmbuild/SOURCES/
[root@nginx1 SOURCES]# ls
 keepalived-1.2.13.tar.gz 
[root@nginx1 SOURCES]# tar zxf keepalived-1.2.13.tar.gz

cd keepalived-1.2.13

./configure

 rpmbuild -bb keepalived.spec

把spec文件全编译了,有的包或许你在编译的时候得加上--enable-spec才可以

完了去
cd /root/rpmbuild/RPMS/x86_64
[root@nginx1 x86_64]# ls
keepalived-1.2.13-5.x86_64.rpm
[root@nginx1 x86_64]# rpm -ivh keepalived-1.2.13-5.x86_64.rpm
Preparing...                ########################################### [100%]
    package keepalived-1.2.13-5.x86_64 is already installed



ok~~~~~~~~~~~~~~~``


你可能感兴趣的:(打rpm包的方法)