I just found this great piece:
http://www.rpm.org/max-rpm/s1-rpm-query-parts.html
Have a look at the section "--requires: Display Capabilities Required by the Package" (around halfway down)
What about this: Write the output of "rpm -qa --provides" to file "a". In this file are now the capabilities of all packages. Write the output of "rpm -q --whatprovides "n-th line of fila "a"" to file "b" If list "a" has n entries, the above commad has to be run n-times. In file "b" are now all packages that other packages depend on. We have to delete entries that occur more than once. Now we have to generate a file "c" which contains all package names. Finally file "b" and "c" have to be compared. The packages that are in "c" but not in "b" are not needed for any dependency and can thus be uninstalled. After thess packages have been uninstalled the script has to be run again Sorry but I cannot write scripts. Fabian