I did the same thing as you are trying to, on OVS 321 as well.
I read somewhere that you need to run the actual kernel on which you are trying to build the rpm for. Meaning, if you are trying to generate kernel rpms (headers, devel, etc.) for kernel X, then you have to run on kernel X.
Install the required tools: rpm-build redhat-rpm-config make gcc m4 etc.
and run rpmbuild --rebuild kernel-uek-2.6.39-300.22.2.el5uek.src.rpm
You will need space on where you build this and for me it took several hours to build.
Considering you can get the exact same kernel, the source and tools with OL5.8, What I do to build modules/drivers is simply use the matching UEK kernel from Oracle Linux ; build the RPM and then install it on Oracle VM.
Thanks JB. It works like a charm. I earlier doubt the same, but real pain was to get gcc,rpm utils without ULN access. I used oel5_latest repo to get gcc and other supported utils. Everything works as expected.
Just for info to help others... Below are the list of package required.