Setup RPM Build ENV

Install required packages

sudo yum install rpm-build redhat-rpm-config yum-utils

Setup build environment

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros

Download src rpm and save it to ~/rpmbuild/SRPMS/

Install build dependencies for package

sudo yum-builddep <package>

Build package

rpmbuild --rebuild <package>.src.rpm

 Share!