I created a user on my machine for this process called rpmbuilder.
Create a folder for development and create the layout for developing rpms
mkdir rpmdevenv; cd rpmdevenv
mkdir BUILD RPMS SOURCES SPECS SRPMS
Create the file ~/.rpmmacros with
%packager High Fructose Corn Syrup
%_topdir /home/rpmbuilder/rpmdevenv
%_rpmtopdir %{_topdir}
%_builddir %{_rpmtopdir}/BUILD
%_rpmdir %{_rpmtopdir}/RPMS
%_sourcedir %{_rpmtopdir}/SOURCES
%_specdir %{_rpmtopdir}/SPECS
%_srcrpmdir %{_rpmtopdir}/SRPMS
Add source code to SOURCES
Add .spec file to SPECS
Build the rpm from the SPEC
rpmbuild -ba SPECS/something.spec
Some good references