Packages to install before we can create RPM packages:
# yum install rpm-build redhat-rpm-config
(The package redhat-rpm-config is for rpmbuild build macros and helper scripts needed to build SRPMs targeted on CentOS)
Other packages needed for compiling :
# yum install make gcc
Here are some good resources and tutorials:
- Rpmbuild Tutorial on wordpress blog is a detailed well-written tutorial on rpmbuild utilities.
- RPM.org User Documentation is also another good material to read on.
- RPM Guild an excellent document that covers all aspects of the Red Hat Package Management system
More references: