Generally the two things you need to produce an RPM are the source code (with patches if appropriate) and the spec file. Producing the rpm build tree can be automated with little effort.
So if it's your software you're building an RPM package for, I'd add the .spec file to an appropriate spot in your tree, and enhance your build automation (e.g. Makefiles) to create the rpm build tree skeleton, populate it with your source, add the .spec file to the SPECS subdir, and issue the rpmbuild commands.
If the software for which you're building the RPM package comes from upstream, I'd check in the .spec file, the upstream tarball, patches, scripts, etc. Then either use their infrastructure for building the RPM, or do as above.