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

Creating a Ceph RPM Package

  1. Install rpmbuild.
    1
    2
    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.
    1. Open the .rpmmacros file.
      1
      vim /root/.rpmmacros   
      
    2. Press i to enter the insert mode and set %_topdir to /home/rpmbuild.

    3. Press Esc to exit the insert mode. Type :wq! and press Enter to save the file and exit.
  1. Run the following command to install rpmbuild again:
    1
    rpmdev-setuptree
    
  2. Copy the ceph.spec file.
    1
    cp ceph.spec /home/rpmbuild/SPECS/
    
  3. Copy the source package.
    1
    2
    3
    cd /home/
    tar -cjvf ceph-14.2.8.tar.bz2 ceph-14.2.8
    cp ceph-14.2.8.tar.bz2 /home/rpmbuild/SOURCES/
    
  4. Build an RPM package.
    • On CentOS 7.6:
      1
      rpmbuild -bb /home/rpmbuild/SPECS/ceph.spec
      
    • On openEuler 20.03:
      1. Move performance.sh to the /home directory.
        1
        2
        mv /etc/profile.d/performance.sh /home/
        source /etc/profile
        
      2. Build an RPM package.
        1
        rpmbuild -bb /home/rpmbuild/SPECS/ceph.spec   
        
      3. Restore performance.sh.
        1
        2
        mv /home/performance.sh /etc/profile.d/   
        source /etc/profile