[root@localhost ~]# yum install rpm-build

安装包:

gdb-7.2-92.el6.x86_64.rpm
redhat-rpm-config-9.0.3-51.el6.centos.noarch.rpm
rpm-build-4.8.0-55.el6.x86_64.rpm

配置:

[root@localhost ~]# mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
[root@localhost ~]# echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros