1.安装依赖环境
yum install gcc make python-devel openssl-devel graphviz autoconf automake rpm-build redhat-rpm-config libtool
2.下载 kernel 源码:
yum install "kernel-devel-uname-r == $(uname -r)"
3.创建rpmbuild目录结构
mkdir rpmbuild/{BUILD,SOURCES,SPECS,RPMS,BUILDROOT} -pv
4.下载源码,解压,编译
cp ceph-12.2.8.tar.gz rpmbuild/SOURCES/
tar -xvf ceph-12.2.8.tar.gz
cp ceph-12.2.8/ceph.spec rpmbuild/SPECS/
5.下载ceph依赖包
cd ceph-12.2.8/ && ./install-deps.sh
6.编译
rpmbuild -bb rpmbuild/SPECS/ceph.spec --nocheck
或者:(指定rpmbuild目录)
rpmbuild --define "_topdir ${dir:-/wangjq/openstack_rocky/open_source/ceph_rpm/rpmbuild}" -bb ceph.spec --without cephfs_java --without selinux --without ceph_test_package --without lttng --with cephfs_shell --without amqp_endpoint --without libradosstriper --without ocf
7.问题解决:
问题1:/usr/share/selinux/devel/policyhelp 被 ceph-2:12.2.8-0.el7.centos.x86_64 需要
解决:yum install selinux-policy-doc -y