RPM's are great. They let you keep track of what's installed, dependencies and manages the removal of packages. In 99% of cases the RPM works great. In 1% of cases you may run across a bug in the package where the widely accepted solution is to remove or add an extra compile flag to fix the issue.
- Stop any services using the rpm
- Uninstall the rpm
- Install the rpm but do not confirm.
In the rpm output before the confirm it will tell you which repo the package is at. - Read the baseurl from the appropriate repo config file in /etc/yum.repos.d
- Create a tmp/working directory
- Go to that baseurl and use wget to get the somepkg.src.rpm package
- rpm -i /path/to/src.rpm
- cd /usr/src/redhat/
- To edit config flags, modify /usr/src/redhat/SPECS/somepkg.spec
- Rebuild the rpm ( rpmbuild -bb /usr/src/redhat/SPECS/somepkg.spec) (You may need to install some *devel packages)
- The RPM will be located in /usr/src/redhat/RPMS/{arch} .. where {arch} is the architecture for your machine (usually i386)