initCommon(); $template->displayHeader(); ?>

21.2. The rpmbuild Command

The rpmbuild command builds RPMs. Most of the options are duplicated. The options that begin with –b build from a spec file, and the options that begin with –t build from a compressed tar archive, commonly called a tarball.

21.2.1. Building from a spec file

Table A-8 lists the rpmbuild options for building RPMs from a spec file.

Table A-8 Options for building RPMs from a spec file

Option

Usage

-ba

Build all, both a binary and source RPM

-bb

Build a binary RPM

-bc

Build (compile) the program but do not make the full RPM, by executing the build commands through the %build section and stopping

-bp

Prepare for building a binary RPM, by executing the build commands through the %prep section and stopping

-bi

Execute the build commands through the %install section and stop

-bl

Check the listing of files for the RPM

-bs

Build a source RPM only

Each of these options requires the name of a spec file at the end of the command line.

21.2.2. Building from a compressed tar archive

Table A-9 lists the rpmbuild options for working with a compressed tar archive.

Table A-9 Options for building RPMs from a compressed tar archive

Option

Usage

-ta

Build all, both a binary and source RPM

-tb

Build a binary RPM

-tc

Build (compile) the program but do not make the full RPM, by executing the build commands through the %build section and stopping

-tp

Prepare for building a binary RPM, by executing the build commands through the %prep section and stopping

-ti

Execute the build commands through the %install section and stop

-tl

Check the listing of files for the RPM

-ts

Build a source RPM only

Each of these options requires the name of a compressed tar archive at the end of the command line. The tar archive must contain a valid spec file inside the archive.

21.2.3. Rebuilding RPMs from source RPMs

You can use the rpmbuild command to rebuild an RPM from a source RPM with the options listed in Table A-10.

Table A-10 Options for rebuilding RPMs from source RPMs

Option

Usage

--rebuild

Rebuild binary RPM from source RPM

--recompile

Recompile binary RPM from source RPM

Each of these options requires the name of a source RPM file on the end of the command line.

21.2.4. Customizing the build

You can customize the rpmbuild command with the options listed in Table A-11.

Table A-11 Extra build options for the rpmbuild command

Option

Usage

-?, --help

Print the popt help information for all the command-line options

--buildroot directory

Override the default root directory for building with directory.

--clean

Remove the build tree after building

-D, --define 'macro value'

Define the given macro to hold the given value

--dbpath path_to_rpm_db

Use the given directory for the RPM database instead of the default

-E, --eval expression

Print the evaluation of the given expression

--macros file:file:file

Read the given colon-separated files as the macro files to define RPM macros; only the first file must exist

--nobuild

Don't really build anything, which really tests the spec file

--pipe command

Pipe the output of the rpm command to the given command

--quiet

Provide less output, normally show only errors

--rcfile file:file:file

Read the given colon-separated files as the rc files to define RPM settings; only the first file must exist

--rmsource

Remove the sources after the build

--rmspec

Remove the spec file after the build

--root directory

Use directory as the top-level directory instead of /

--short-circuit

With the -bc or -bi options, jumps directly to the given stage and just executes that stage

--showrc

Print the rpmrc and macro configuration and exit

--sign

Sign the package with a GPG signature

--target platform

Build for the given platform. May not work if you don't have the other platform build commands, such as cross compilers, set up. Can work for Intel platforms with i386, i686, and so on.

-v, --verbose

Provide more verbose output

-vv

Provide even more verbose output, including debugging information

--version

Print the RPM version and exit

displayFooter('$Date: 2005/11/02 19:30:07 $'); ?>