E.4. Macros

This section describes the various macros used by RPM.

E.4.1. The %setup Macro

The %setup macro is used to unpack the original sources in preparation for the build. It is used in the %prep script:

%prep
%setup
        

See also: Section 13.4.1.

E.4.2. The %patch Macro

The %patch macro, as its name implies, is used to apply patches to the unpacked sources. With no additional options specified, it will apply the patch file specified by the Patch: (or Patch0:) tag.

%patch
        

When there is more than one Patch: tag line in a spec file, they can be specified by appending the number of the Patch: tag to the %patch macro name itself.

%patch2
        

See also: Section 13.4.2.