Defining Spec File Macros

The RPM system defines a lot of handy macros so that your spec files can work regardless of where system directories are located. You simply use the macro, such as %_bindir, in place of hard-coded paths. The %_bindir macro, for example, identifies the default directory for binary executables, /usr/bin.

Use these macros wherever possible to avoid hard-coded paths and settings.

Built-in macros

RPM includes a host of built-in macros, including the following useful directories: