Skip to main content

This tag is for questions about rpmbuild, a tool for building RPM packages.

rpmbuild prepares RPM packages (see the tag) from scenarios also known as spec-files. spec-files provide information to rpmbuild about necessary steps which should be executed to produce RPM packages.

In general, RPM preparing routine consists of the following steps:

  1. Creating of building environment:

    mkdir ~/rpmbuild
    mkdir ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
    # Directories summary:
    #
    # BUILD     in this directory source code will be built
    # BUILDROOT in this directory software will be installed before packing in the package
    # RPMS      this directory contains completed (binary) RPM packages
    # SOURCES   where you should put the sources for the application
    # SPECS     where you should place the spec file(s)
    # SRPMS     this directory contains completed source RPM packages
    
  2. Putting source files into the ~/rpmbuild/SOURCES directory.

  3. Putting spec-files into the ~/rpmbuild/SPECS directory.
  4. Running rpmbuild options /path/to/spec/file.

See also the rpmbuild(8) man page and detailed instructions in the Fedora RPM Guide.