Questo contenuto non è disponibile nella lingua selezionata.
Chapter 1. Getting started with RPM packaging
The following section introduces the concept of RPM packaging and its main advantages.
1.1. Introduction to RPM packaging Copia collegamentoCollegamento copiato negli appunti!
The RPM Package Manager (RPM) is a package management system that runs on RHEL, CentOS, and Fedora. You can use RPM to distribute, manage, and update software that you create for any of the operating systems mentioned above.
1.2. RPM advantages Copia collegamentoCollegamento copiato negli appunti!
The RPM package management system brings several advantages over distribution of software in conventional archive files.
RPM enables you to:
- Install, reinstall, remove, upgrade and verify packages with standard package management tools, such as Yum or PackageKit.
- Use a database of installed packages to query and verify packages.
- Use metadata to describe packages, their installation instructions, and other package parameters.
- Package software sources, patches and complete build instructions into source and binary packages.
-
Add packages to
Yum
repositories. - Digitally sign your packages by using GNU Privacy Guard (GPG) signing keys.
1.3. Creating your first rpm package Copia collegamentoCollegamento copiato negli appunti!
Creating an RPM package can be complicated. Here is a complete, working RPM Spec file with several things skipped and simplified.
Save this file as hello-world.spec
.
Now use these commands:
rpmdev-setuptree rpmbuild -ba hello-world.spec
$ rpmdev-setuptree
$ rpmbuild -ba hello-world.spec
The command rpmdev-setuptree
creates several working directories. As those directories are stored permanently in $HOME, this command does not need to be used again.
The command rpmbuild
creates the actual rpm package. The output of this command can be similar to:
The file /home/<username>/rpmbuild/RPMS/x86_64/hello-world-1-1.x86_64.rpm
is your first RPM package. It can be installed in the system and tested.