How to create RPM in RHEL5

I would like to package my developed application and deploy it using RPM to my users. Understand that RHEL5 has the following directories created:

  • /usr/src/redhat/BUILD
  • /usr/src/redhat/RPMS
  • /usr/src/redhat/SOURCES
  • /usr/src/redhat/SPECS
  • /usr/src/redhat/SRPMS

Using KDevelop as my development tool, it is able to create the .tar.gz of my source files.

In order to create the RPM file, do I need to do the following:

  1. Copy my .tar.gz to /usr/src/redhat/SOURCES directory?
  2. Copy my .spec file to /usr/src/redhat/SPECS directory and run rpmbuild -ba from there?

As these redhat directories are owned by ROOT, is there any way to specify other directories instead? :confused:

Also, if my application has some runtime library dependencies, like libboost_system.so, how do I indicate it in my .spec file? :confused: