rpm build from RPM source package

find .spec file in /usr/src/redhat/SPECS

rpm -bc xxx.spec : build stage
rpm -bi xxx.spec : install stage

rpm -bb xxx.spec : build binary package
rpm -bs xxx.spec : build source package
rpm -ba xxx.spec : build binary & source package

first install source rpm package using rpm command

goto /usr/src/SPECS folder

edit httpd.spec

for example you may want to edit configure part of the httpd.spec file

and then

You can create binary rpm package (redhat 8 & up)

rpmbuild -bb httpd.spec

compiled files will be written in /usr/src/BUILD folder

Then you can use rpm -ivh command to install it.

Read More