C++ CSS HTML Java JavaScript MySQL Oracle PERL PHP SQL Unix VBScript XHTML XML Сети
Macros
 

Macros

This section describes the various macros used by RPM.

The %setup Macro

The %setup%prep script:
%prep
%setup
        

See also: the section called The %setup Macro in Chapter 13.

The -n <name> Option

The -n<name>- <version>.
%setup -n cd-player
          

See also: the section called -n <name> — Set Name of Build Directory in Chapter 13.

The -c Option

The -c option is used to direct %setup to create the top-level build directory before unpacking the sources.
%setup -c
          

See also: the section called -c — Create Directory (and change to it) Before Unpacking in Chapter 13.

The -D Option

The -D option is used to direct %setup the -b or -a options.
%setup -D -T -b 3
          

See also: the section called -D — Do Not Delete Directory Before Unpacking Sources in Chapter 13.

The -T Option

The -T option is used to direct %setupSource: tag. It is used with the -a or -b options.
%setup -D -T -a 1
          

See also: the section called -T — Do Not Perform Default Archive Unpacking in Chapter 13.

The -b <n> Option

The -b option is used to direct %setup to unpack the source archive specified on the nth Source: tag line before changing directory into the build directory.
%setup -D -T -b 2
          

See also: the section called -b <n> — Unpack The nth Sources Before Changing Directory in Chapter 13.

The -a <n> Option

The -a option is used to direct %setup to unpack the source archive specified on the nth Source: tag line after changing directory into the build directory.
%setup -D -T -a 5
          

See also: the section called -a <n> — Unpack The nth Sources After Changing Directory in Chapter 13.

The %patch Macro

The %patchPatch: (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: the section called The %patch Macro in Chapter 13.

The -P <n> Option

The -P option is another method of applying a specific patch. The number from the Patch: tag follows the -P option. The following %patch macros both apply the patch specified on the Patch2: tag line:
%patch -P 2

%patch2
          

See also: the section called Specifying Which patch Tag to Use in Chapter 13.

The -p<#> Option

The -p option is sent directly to the patch
%patch -p2
          

See also: the section called -p <#> — Strip <#> leading slashes and directories from patch filenames in Chapter 13.

The -b <name> Option

When the patch.orig. The -b option is used to change the extension used by patch.
%patch -b .fsstnd
          

See also: the section called -b <name> — Set the backup file extension to <name> in Chapter 13.

The %patch -E Option

The -E option is sent directly to the patch command. It is used to direct patch to remove any empty files after the patches have been applied.

See also: the section called -E — Remove Empty Output Files in Chapter 13.

Главная