Product SiteDocumentation Site

9.7.2. Spec file-specific macros

Most of the pre-defined RPM macros hold directory paths or architecture information. RPM also includes a set of useful macros that you can use to help debug problematic spec files and well as perform common tasks in spec files. Table 10-5 lists these debugging and special spec file macros.
Table 10-5 Special spec-file macros
Prints out macro values
Prints message to stderr
Prints message to stderr and returns BADSPEC
Like eval, expands expression
Expands file_exp to a file name
%global name value
Defines a global macro
Expands patch_exp to a patch file name
Expands source_exp to a source file name
Toggles the printing of debugging information
Tests if file filename is compressed. If so, uncompresses and includes in the given context. If not compressed, calls cat to include file in given context.
%undefine macro
Undefines the given macro
Prints message to stderr
To see the current list of macros, put a %dump at the start of your spec file.