rpmbuild
also: rpm-build
rpmbuild is a command-line tool that compiles source code and creates RPM (Red Hat Package Manager) binary and source packages from a specification file (SPEC file).
rpmbuild automates the process of building installable RPM packages by reading instructions from a SPEC file that defines how to compile, test, and package software. It handles the entire build workflow including applying patches, configuring sources, compiling binaries, and creating distributable packages.
The tool uses a standardized directory structure (BUILD, RPMS, SOURCES, SPECS, SRPMS) to organize source code, compiled binaries, and metadata. A typical workflow involves defining build dependencies, compilation steps, and installation paths in the SPEC file, then running rpmbuild -ba specfile.spec to generate both binary RPMs (in RPMS/) and source RPMs (in SRPMS/).
Example: A developer creates a SPEC file that instructs rpmbuild to download source code, apply patches, compile with ./configure && make, and install files into the package root. Running rpmbuild -bb myapp.spec produces a ready-to-distribute binary RPM that end users can install with rpm -i or yum install.