Creating a Ceph RPM Package
- Install rpmbuild.
yum install rpmdevtools -y rpmdev-setuptree
If you perform the compilation as the root user, an rpmbuild directory is generated in the /root directory. The compilation occupies 20 GB to 30 GB of space. If the /root directory has a smaller space, replace the rpmbuild directory with another one, for example, /home.
- Modify the .rpmmacros file after installing rpmbuild.
vi /root/.rpmmacros Change %_topdir to /home/rpmbuild.

- Run the following command to install rpmbuild again:
rpmdev-setuptree
- Modify the file.
- Modify do_cmake.sh.
vi do_cmake.sh The modification is as follows: ${CMAKE} -DCMAKE_BUILD_TYPE=RelWithDebInfo $ ARGS "$@" .. || exit 1
- Copy the ceph.spec file.
cp ceph.spec /home/rpmbuild/SPECS/
- Copy the source package.
cd /home/ tar -cjvf ceph-14.2.8.tar.bz2 ceph-14.2.8 cp ceph-14.2.8.tar.bz2 /home/rpmbuild/SOURCES/
- Modify do_cmake.sh.
- Build an RPM package.
- Edit the ceph.spec file.
vi /home/rpmbuild/SPECS/ceph.spec
- Add the following field to the beginning of the ceph.spec file:
%define _binaries_in_noarch_packages_terminate_build 0
- Build an RPM package.
rpmbuild -bb /home/rpmbuild/SPECS/ceph.spec
- Edit the ceph.spec file.
- Modify the file.
Parent topic: Compiling and Deploying Ceph