RPMs are usually built from source, not the binaries.
You need to write the spec file that covers how to configure and compile your application; also, which files to include in your RPM.
A quick glance at the manual shows that most of what you need is covered in Chapter 8 -- also, as most RPM-based distributions have sources available, there's literally a zillion of examples of different approaches you could look at.