Creating an RPM packaging workspace¶
To create an RPM package, you must first create a separate directory for your RPM packaging workspace. An RPM package consists of an archive of source code and a spec file. The spec file contains project metadata and different sections that you use to define how to compile project source code.
Prerequisites
- A host machine that runs on CentOS Stream, Fedora, or RHEL
Procedure
-
Install the tools required to build RPM packages, as well as dependencies required by the sample application:
-
From your
home
directory, run therpmdev-setuptree
utility to create a file structure for the RPM packaging workspace: -
Verify that
rpmdev-setuptree
created the required directories:
The required directories each serve a unique purpose:
BUILD
: The location of various%buildroot
directories. These are useful for investigating a failed build if the log output is inconclusive.RPMS
: The location of your binary RPM packages. This directory contains subdirectories for different architectures.SOURCES
: The location of your source code. Package your source code in atar
archive and copy it to theSOURCES
directory. At build time, therpmbuild
build tool extracts your software from this directory.SPECS
: The location of your spec files.SRPMS
: The location of your SRPM packages.
Next steps