LFCS · Question #842
When building an RPM package, which rpmbuild option is used to unpack sources and apply patches before proceeding with the next steps?
The correct answer is E. -bp. The rpmbuild -bp command is specifically used during RPM package creation to prepare the build environment by unpacking source files and applying any patches defined in the spec file.
Question
Options
- A-bb
- B-be
- C-bs
- D-ba
- E-bp
How the community answered
(58 responses)- B2% (1)
- C2% (1)
- D3% (2)
- E93% (54)
Why each option
The `rpmbuild -bp` command is specifically used during RPM package creation to prepare the build environment by unpacking source files and applying any patches defined in the spec file.
`rpmbuild -bb` (build binary) compiles the package and creates the binary RPM, skipping the prep phase if not already done.
`rpmbuild -be` (build execute) executes the `%build` section of the spec file, which typically involves compiling the source code.
`rpmbuild -bs` (build source) builds only the source RPM package, not unpacking or patching the sources.
`rpmbuild -ba` (build all) performs a complete build, creating both source and binary RPMs, but `-bp` specifically targets the prep stage.
E is correct because `rpmbuild -bp` (build prep) executes the `%prep` section of the RPM spec file, which includes unpacking the source tarball and applying any specified patches, making it ready for the compilation phase. This step is crucial for preparing the source code before compilation or other build stages.
Concept tested: RPM package build stages
Source: https://rpm.org/documentation/build_system/rpmbuild.html
Topics
Community Discussion
No community discussion yet for this question.