Preparing the Environment
The operations vary according to the OS. Unless otherwise specified, the operations are the same in the two OSs.
CentOS 7.6
- Install the EPEL source.
1yum install epel-release -y
- Install the software collection (SCL).
1yum -y install centos-release-scl
- Modify the SCL Repo source.
1vi /etc/yum.repos.d/CentOS-SCLo-scl.repoAdd the following content:
1baseurl=http://mirror.centos.org/altarch/7/sclo/$basearch/rh/
Change http in the scl-rh Repo source to https.1vi /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo
- Configure the Yum certificate verification.
1vi /etc/yum.conf1 2
sslverify=false deltarpm=0
- Refresh the Yum cache.
1yum clean all && yum makecache
- (Optional) Simulate and verify the GCC 7 compilation environment.The compilation requires GCC 7 or later. If the GCC version meets the requirement, skip this step. If not, run the following commands to simulate the GCC 7 environment.
1 2 3
yum -y install devtoolset-7 scl enable devtoolset-7 bash gcc --version
If the GCC version is 7.0 in the command output, the environment is successfully simulated.
openEuler 20.03
- Configure the local liboath source.
- Download the liboath source code and patch.
1 2 3
yum install git -y git config --global http.sslVerify false git clone https://gitee.com/src-openeuler/oath-toolkit.git
- Use Yum to install the dependencies required for the RPM package.
1yum install wget rpmdevtools gtk-doc pam-devel xmlsec1-devel libtool libtool-ltdl-devel createrepo cmake -y
- Create an rpmbuild directory. Move the patch file and source package to the /root/rpmbuild/SOURCES directory.
1 2 3 4 5
rpmdev-setuptree cd oath-toolkit mv 0001-oath-toolkit-2.6.5-lockfile.patch /root/rpmbuild/SOURCES mv oath-toolkit-2.6.5.tar.gz /root/rpmbuild/SOURCES cp oath-toolkit.spec /root/rpmbuild/SPECS/
- Compile the RPM package.
1rpmbuild -bb /root/rpmbuild/SPECS/oath-toolkit.spec
- Use the compiled RPM package as the local Yum source.
1 2 3
mkdir -p /home/oath cp -r /root/rpmbuild/RPMS/* /home/oath/ cd /home/oath && createrepo .
- Configure the Repo file.
1vi /etc/yum.repos.d/local.repoAdd the following content to the file:
1 2 3 4 5 6
[local-oath] name=local-oath baseurl=file:///home/oath enabled=1 gpgcheck=0 priority=1
- Download the liboath source code and patch.
- Edit the yum.conf file and set the Yum certificate verification status to false (no verification).
1vi /etc/yum.confAdd the following content to the end of the file:
1 2
sslverify=false deltarpm=0
- Configure the Huawei proxy to increase the download speed.
1 2
mkdir -p ~/.pip vi ~/.pip/pip.conf
Add the following content:
1 2 3 4
[global] timeout = 120 index-url =https://repo.huaweicloud.com/repository/pypi/simple trusted-host = repo.huaweicloud.com
- Download the Huawei image source Repo.
1wget -O /etc/yum.repos.d/openEulerOS.repo https://repo.huaweicloud.com/repository/conf/openeuler_aarch64.repo
- Install the dependencies required for compiling the Ceph source code on the server.
1yum install java-devel sharutils checkpolicy selinux-policy-devel gperf cryptsetup fuse-devel gperftools-devel libaio-devel libblkid-devel libcurl-devel libudev-devel libxml2-devel libuuid-devel ncurses-devel python-devel valgrind-devel xfsprogs-devel xmlstarlet yasm nss-devel libibverbs-devel openldap-devel CUnit-devel python2-Cython python3-setuptools python-prettytable lttng-ust-devel expat-devel junit boost-random keyutils-libs-devel openssl-devel libcap-ng-devel python-sphinx python2-sphinx python3-sphinx leveldb leveldb-devel snappy snappy-devel lz4 lz4-devel liboath liboath-devel libbabeltrace-devel librabbitmq librabbitmq-devel librdkafka librdkafka-devel libnl3 libnl3-devel rdma-core-devel numactl numactl-devel numactl-libs createrepo openldap-devel rdma-core-devel lz4-devel expat-devel lttng-ust-devel libbabeltrace-devel python3-Cython python2-Cython gperftools-devel bc dnf-plugins-core librabbitmq-devel rpm-build java-1.8.0-openjdk-devel -y
- Regenerate the rpmbuild directory in /home.
- Run the rpmbuild installation command.
1rpmdev-setuptree
- Modify the .rpmmacros file.
1vi /root/.rpmmacrosChange %_topdir to /home/rpmbuild.

- Run the rpmbuild installation command again.
1rpmdev-setuptree
- Run the rpmbuild installation command.
Parent topic: Compiling and Deploying Ceph