Product SiteDocumentation Site

Appendix A. Spec File Reference

Spec files are text files that contain RPM directives and macro definitions, which are used to build an RPM package. The RPM directives and macros are divided into a number of sections. Each of these sections is delimited with a % marker. For example, the build section starts with %build.
A typical spec file consists of approximately five sections:
Preamble
The preamble describes the basic information on the package, for example name, version, license, and so on.
Build section
The build section includes instructions, which are used to build and prepare the package for installation.
Scriptlets
The scriptlets define commands used to install, upgrade, or uninstall the package.
Manifest
The manifest section includes a list of packaged files and their permissions.
Changelog
The changelog section consists of a list of changes made to the package.

A.1. Spec File Directives

Directives in a spec file are defined using a simple syntax of a tag name, a colon, and a value:
TagName: value 
For example, the following directive sets the package version to 1.15:
Version: 1.15 
The name of the item is not case sensitive, so tag names of version, Version, or VERSION all set the same value. This syntax works for most settings, including Name, Release, and so on.