3.3. Setting up RPM packaging workspace

This section describes how to set up a directory layout that is the RPM packaging workspace by using the rpmdev-setuptree utility.

Conditions préalables

  • You installed the rpmdevtools package, which provides several utilities for packaging RPMs:

    # dnf install rpmdevtools

Procédure

  • Run the rpmdev-setuptree utility:

    $ rpmdev-setuptree
    
    $ tree ~/rpmbuild/
    /home/user/rpmbuild/
    |-- BUILD
    |-- RPMS
    |-- SOURCES
    |-- SPECS
    `-- SRPMS
    
    5 directories, 0 files

The created directories serve the following purposes:

Annuaire

Objectif

BUILD

When packages are built, various %buildroot directories are created here. This is useful for investigating a failed build if the logs output do not provide enough information.

RPMS

Binary RPMs are created here, in subdirectories for different architectures, for example in subdirectories x86_64 and noarch.

SOURCES

Here, the packager puts compressed source code archives and patches. The rpmbuild command looks for them here.

SPECS

The packager puts SPEC files here.

SRPMS

When rpmbuild is used to build an SRPM instead of a binary RPM, the resulting SRPM is created here.