next up previous contents index
Next: The %files List Up: Concise Spec File Reference Previous: Scripts   Contents   Index

Subsections

Macros

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 [*], page [*]

The -n <name> Option

The -n option is used to set the name of the software's build directory. This is necessary only when the source archive unpacks into a directory named other than <name>-<version>.

%setup -n cd-player

See also: Section [*], page [*]

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: Section [*], page [*]

The -D Option

The -D option is used to direct %setup to not delete the build directory prior to unpacking the sources. This option is used when more than one source archive is to be unpacked into the build directory, normally with the -b or -a options.

%setup -D -T -b 3

See also: Section [*], page [*]

The -T Option

The -T option is used to direct %setup to not perform the default unpacking of the source archive specified by the first source tag. It is used with the -a or -b options.

%setup -D -T -a 1

See also: Section [*], page [*]

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: Section [*], page [*]

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: Section [*], page [*]

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 [*], page [*]

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: Section [*], page [*]

The -p<#> Option

The -p option is sent directly to the patch command. It is followed by a number which specifies the number of leading slashes (and the directories in between) to strip from any filenames present in the patch file.

%patch -p2

See also: Section [*], page [*]

The -b <name> Option

When the patch command is used to apply a patch, unmodified copies of the files patched are renamed to end with the extension .orig. The -b option is used to change the extension used by patch.

%patch -b .fsstnd

See also: Section [*], page [*]

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: Section [*], page [*]


next up previous contents index
Next: The %files List Up: Concise Spec File Reference Previous: Scripts   Contents   Index
converted to HTML by Tim Riker