rpmbuild compiles and installs to make rpm packages

What is rpm package?
rpm is equivalent to the installation file in windows, it will automatically handle the dependencies between packages.

Advantages of rpm:
The package management system is simple, and packages can be installed, upgraded, and uninstalled through a few commands.
The installation speed is much faster than the source package.
Disadvantages:
After compilation, the source code cannot be seen, and the function selection is not as flexible as the source code. Strong dependence.
Let me talk about the process first:
the things needed to make an rpm package include source code, spec file (script to make an rpm package), and rpmbuild tool.

1. Install rpmbuild
 

$yum install rpmbuild
$yum install rpmdevtools 
$rpmdev-setuptree

At this point rpmbuild has been installed, you can check it

3. Organize the source code

After the rpmbuild installation is complete, we need to put our source code in the SOURCE folder. Our source code may be a tar.gz package, or several files.

The name format of the tar.gz source package should be helloword-1.0.0.tar.gz (actually name-version number.tar.gz)

4. Write the spec file

Create a new xxx.spec packaging script under the SPECS folder, which is actually a process of compiling and packaging our source code into rpm.

vi  xxx.spec 

Name:           hellorpm           #名字为源码tar.gz 包

Guess you like

Origin blog.csdn.net/qq_33468857/article/details/131052436