概述

从ceph的源码build出rpm包;

#git clone --recursive  https://github.com/ceph/ceph.git
#./instal-dep.sh

以上两点其实在README里面有提及;

mkdir build; cd build; cmake ..;

make dist-bzip2 //此时生成了ceph-XXX.tar.bz2的源码压缩包

准备rpmbuild 目录

mkdir ~/rpmbuild/

mkdir ~/rpmbuild/BUILD

mkdir ~/rpmbuild/BUILDROOT

mkdir ~/rpmbuild/RPMS

mkdir ~/rpmbuild/SOURCES

mkdir ~/rpmbuild/SPECS

mkdir ~/rpmbuild/SRPMS

准备构建文件

cp ceph/ceph-XXX.tar.bz2 ~/rpmbuild/SOURCES/

cp ceph/rpm/init-ceph.in-fedora.patch ~/rpmbuild/SOURCES/

cp ceph/ceph.spec ~/rpmbuild/SPECS

build RPM

rpmbuild -ba rpmbuild/SPECS/ceph.spec //这里可能需要修改版本号,跨大版本可能编译不过;

build结束之后,会在~/rpmbuild/RPMS/x86_64/下看到编译出来的RPMS

05-10 23:03