RPMBUILD(1) General Commands Manual RPMBUILD(1) (NAME) rpmbuild - RPM (SYNOPSIS) rpmbuild -bSTAGE [options] SPEC_FILE ... rpmbuild -rSTAGE [options] SOURCE_PACKAGE ... rpmbuild -tSTAGE [options] TAR_ARCHIVE ... rpmbuild {--rebuild|--recompile} [options] SOURCE_PACKAGE ... (DESCRIPTION) rpmbuild RPM . . . : . (OPERATIONS) -bSTAGE STAGE spec. -rSTAGE STAGE RPM. -tSTAGE STAGE tar(5). --rebuild, --recompile -ra. : (parse) (build) (assembly) (cleanup). (stages) . STAGE ( ) . (Assembly stages) rpmbuild . . a . b s <<>> . . b . . r . %prep %generate_buildrequires . (DYNAMIC BUILD DEPENDENCIES) . s . . (Build stages) buildroot . spec %prep %build %install . RPM / . spec . p (%prep) . d (%generate_buildrequires) buildreqs.nosrc.rpm. . f (%conf) . ./configure . c (%build) . make . i (%install and %check) (build root). make install make check . l << >> (list check) - %files spec . %install . (ARGUMENTS) SPEC_FILE spec RPM. SOURCE_PACKAGE RPM ( .src.rpm). TAR_ARCHIVE tar(5) . rpmbuild spec Specfile .spec . (OPTIONS) --build-in-place . %setup %builddir/%buildsubdir . %prep . --clean (). --nobuild . spec . --nocheck %check spec. --noclean %clean spec. --nodebuginfo debuginfo. --nodeps . --noprep %prep spec. rpmbuild %prep . --rmsource ( rpmbuild --rmsource foo.spec). NoSource NoPatch . --rmspec spec ( rpmbuild --rmspec foo.spec). --rpmfcdebug . --scm=SCM SCM %autosetup spec . SCM patch () gendiff git quilt %autosetup -pN . --short-circuit ( ). -bc -bi -bb . . . --with OPTION OPTION . --without OPTION OPTION . rpm-common(8) . (DYNAMIC BUILD DEPENDENCIES) %generate_buildrequires BuildRequires rpmbuild buildreqs.nosrc.rpm BuildRequires 11 . dnf-builddep(8) . spec BuildRequires BuildRequires . -br buildreqs.nosrc.rpm rpmbuild 11 . -br --nodeps 11 buildreqs.nosrc.rpm . (ENVIRONMENT) RPM_BUILD_NCPUS (CPU) . (EXIT STATUS) 0 . %generate_buildrequires (DYNAMIC BUILD DEPENDENCIES) 11 . (EXAMPLES) rpmbuild --rebuild hello-1.0-1.src.rpm hello-1.0-1.src.rpm. rpmbuild -bb --nocheck --with openssl hello.spec spec hello.spec %check openssl ( spec ). rpmbuild -ta hello-2.0.tar.gz hello-2.0.tar.gz spec ( TAR_ARCHIVE ). rpmbuild -bc hello.spec hello.spec %build . rpmbuild -bi --short-circuit hello.spec %install hello.spec . %build . %files . (FILES) rpm-common(8) . (SEE ALSO) gendiff(1), popt(3), rpm(8), rpm-common(8), rpmbuild-config(5), rpm2cpio(1), rpmkeys(8), rpmspec(1), rpmsign(1), rpm-setup-autosign(1) rpm-macros(7) http://www.rpm.org RPM 6.0.1 2026-03-06 RPMBUILD(1)