First, if possible use a source RPM (srpm) provided by your distribution, if possible. You can even use that if you need a newer version not yet available through your repositories.
To create a RPM from a SRPM, use the
rpmbuild tool. What this, basically, does is automate the whole configure-make-(make test)-make install sequence, and packs it into an archive, plus some installation/configuration scripts.
Best would be to install a SRPM (rpm -i file.rpm), and check the packaged specification file in /usr/src/packages/SPECS/.