First install the rpmbuild tool and initialize the rpmbuild working directory:
yum install -y rpm-build
rpmbuild -ba isulad.spec
The second command will exit with an error, but this command will still create the rpmbuild directory in the user's default working directory.
In the rpmbuild working directory, you will find the following subdirectories:
$ ls ~/rpmbuild
BUILD BUILDROOT RPMS SOURCES SPECS SRPMS
tips:
SOURCES
stores the source codeSPECS
stores the SPEC files used for the buildRPMS
stores rpm packages.
dnf install -y patch automake autoconf libtool cmake make libcap libcap-devel libselinux libselinux-devel libseccomp libseccomp-devel git libcgroup tar python3 python3-pip libcurl-devel zlib-devel glibc-headers openssl-devel gcc gcc-c++ systemd-devel systemd-libs golang libtar && \
dnf --enablerepo=powertools install -y yajl-devel device-mapper-devel && \
dnf install -y epel-release && \
dnf --enablerepo=powertools install libuv-devel &&\
dnf install libwebsockets-devel
dnf --enablerepo=powertools install -y docbook2X doxygen && \
dnf install -y bash-completion chrpath rsync
First download the lxc source code:
git clone https://gitee.com/src-openeuler/lxc.git
Put the source code, patch, and spec into the rpmbuild working directory:
export RPM=~/rpmbuild
cd lxc
cp *.patch *.tar.gz $RPM/SOURCES/ && \
cp *.spec $RPM/SPECS/
cd ~/rpmbuild/SPECS
rpmbuild -ba lxc.spec
After the build is successful, the rpm package will be placed in the RPM directory. You can find the corresponding rpm package and install it with the rpm -Uvh
.
cd ~/rpmbuild/RPMS/x86_64
rpm -Uvh lxc-libs-4.0.3-2022080901.x86_64.rpm
rpm -Uvh lxc-4.0.3-2022080901.x86_64.rpm
rpm -Uvh lxc-devel-4.0.3-2022080901.x86_64.rpm
dnf --enablerepo=powertools install -y gtest-devel
Note: lxc must be installed before installing lcr.
First download the lcr source code:
git clone https://gitee.com/openeuler/lcr
Then package the source code:
export RPM=~/rpmbuild
cd lcr
tar -zcvf lcr-2.0.tar.gz *
Finally put the required source code, patch, and spec into the rpmbuild working directory:
cp lcr-2.0.tar.gz $RPM/SOURCES/
cp *.spec $RPM/SPECS/
cd ~/rpmbuild/SPECS
rpmbuild -ba lcr.spec
rpm -Uvh lcr-2.1.0-2.x86_64.rpm
rpm -Uvh lcr-devel-2.1.0-2.x86_64.rpm
dnf --enablerepo=powertools install -y gmock-devel
First download the clibcni source code:
git clone https://gitee.com/openeuler/clibcni
Then package the source code:
cd clicni
tar -zcvf clibcni-2.0.tar.gz *
Finally put the required source code, patch, and spec into the rpmbuild working directory:
cp clibcni-2.0.tar.gz $RPM/SOURCES/
cp *.spec $RPM/SPECS/
cd ~/rpmbuild/SPECS
rpmbuild -ba clibcni.spec
After the build is successful, the rpm package will be placed in the RPM directory . You can find the corresponding rpm package and install it with the rpm -Uvh
.
yum install -y emacs.x86_64
First download the protobuf source code, Then package the source code, Finally put the required source code, patch, and spec into the rpmbuild working directory:
git clone https://gitee.com/src-openeuler/protobuf
cd protobuf
git checkout openEuler-20.03-LTS
cp *.tar.gz *.el *.patch $RPM/SOURCES/ && cp *.spec $RPM/SPECS/
Since isulad does not need to build protobuf for java and python, you can modify the first 5 lines of the spec file to avoid installing related dependencies:
cd ~/rpmbuild/SPECS
vim protobuf.spec
%bcond_with python
%bcond_with java
rpmbuild -ba protobuf.spec
rpm -Uvh protobuf-3.14.0-4.x86_64.rpm
dnf install -y emacs-26.1-7.el8.x86_64
rpm -Uvh protobuf-compiler-3.14.0-4.x86_64.rpm
rpm -Uvh protobuf-devel-3.14.0-4.x86_64.rpm
yum install -y emacs.x86_64 openssl-devel.x86_64
dnf --enablerepo=powertools install gflags-devel python3-Cython python3-devel
dnf install -y abseil-cpp-devel gperftools-devel re2-devel
git clone https://gitee.com/src-openeuler/grpc
cd grpc
git checkout openEuler-20.03-LTS
cp *.tar.gz $RPM/SOURCES/ && cp *.spec $RPM/SPECS/
rpmbuild -ba grpc.spec
dnf install -y epel-release.noarch c-ares-1.13.0-5.el8.x86_64 gperftools-libs-2.7-9.el8.x86_64
dnf --enablerepo=powertools install gflags-devel
rpm -Uvh grpc-1.31.0-1.x86_64.rpm
dnf install -y openssl-devel.x86_64
rpm -Uvh grpc-devel-1.31.0-1.x86_64.rpm
dnf install -y bzip2-devel e2fsprogs-devel libattr-devel libxml2-devel lz4-devel lzo-devel sharutils libacl-devel
dnf --enablerepo=powertools install sharutils
git clone https://gitee.com/src-openeuler/libarchive
cd libarchive
git checkout openEuler-20.03-LTS
cp *.tar.gz *.patch $RPM/SOURCES/ && cp *.spec $RPM/SPECS/
rpmbuild -ba libarchive.spec
rpm -Uvh libarchive-3.4.3-4.x86_64.rpm
rpm -Uvh libarchive-devel-3.4.3-4.x86_64.rpm
dnf install -y sqlite-devel
git clone https://gitee.com/openeuler/iSulad
cd iSulad/
tar -zcvf iSulad-2.1.tar.gz *
cp iSulad-2.1.tar.gz $RPM/SOURCES/
cp *.spec $RPM/SPECS/
rpmbuild -ba iSulad.spec
First, you should install libwebsockets:
dnf install -y epel-release
dnf --enablerepo=powertools install libuv-devel
dnf install libwebsockets-devel
then, you can install iSulad
dnf install -y sqlite-devel.x86_64
rpm -Uvh iSulad-2.1.0-1.x86_64.rpm