Skip to content

Instantly share code, notes, and snippets.

@myusuf3
Created December 2, 2011 22:45
Show Gist options
  • Save myusuf3/1425193 to your computer and use it in GitHub Desktop.
Save myusuf3/1425193 to your computer and use it in GitHub Desktop.
guide to building from source rpm

Getting the rpmbuild command

Your system may currently have the rpm command but not the rpmbuild command. (If the command "which rpmbuild" does not display anything, you don't have rpmbuild.) On Red Hat and Fedora systems, the rpmbuild command is provided by the rpm-build RPM package. (You can give the command "rpm -q rpm-build" to check if it is installed.)

Building from a source RPM (SRPM)

Install the .src.rpm file this way:

rpm -i somepackage-1.0-1.src.rpm This will create files in the SOURCES directory of your RPM building directory tree, and a .spec file in the SPECS directory.

Then go the SPECS directory and give the command to build the RPM:

cd /home/your_userid/rpm/SPECS rpmbuild -bb somepackage.spec Give the -ba option instead if you also want to build the SRPM. The binary RPM packages will typically be created in the RPMS/i386 directory (on a PC-based system).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment