我要评分
获取效率
正确性
完整性
易理解

Creating a Ceph RPM Package

  1. 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.

  2. Modify the .rpmmacros file after installing rpmbuild.
    vi /root/.rpmmacros 
    Change %_topdir to /home/rpmbuild.

  1. Run the following command to install rpmbuild again:

    rpmdev-setuptree

    1. 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/
    2. Build an RPM package.
      1. Edit the ceph.spec file.
        vi /home/rpmbuild/SPECS/ceph.spec
      2. Add the following field to the beginning of the ceph.spec file:
        %define _binaries_in_noarch_packages_terminate_build 0
      3. Build an RPM package.
        rpmbuild -bb /home/rpmbuild/SPECS/ceph.spec