The basic procedure to build an RPM is as follows:
- Get the source code you are building the RPM for to build on your system.
- Make a patch of any changes you had to make to the sources to get them to build properly.
- Make a spec file for the package.
- Make sure everything is in its proper place.
- Build the package using RPM.