RPM failed dependencies

I'm trying to package the latest Oracle JDK (1.7.0_51) into an RPM. Packaging works fine but when i try to install via rpm -Uvh xxx.rpm, i get the following:

#sudo rpm -ivh Sun_JDK7-1.7.0-51.x86_64.rpm 
error: Failed dependencies:
libavcodec.so.52()(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavcodec.so.52(LIBAVCODEC_52)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavcodec.so.53()(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavcodec.so.53(LIBAVCODEC_53)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavformat.so.52()(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavformat.so.52(LIBAVFORMAT_52)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavformat.so.53()(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libavformat.so.53(LIBAVFORMAT_53)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libc.so.6(GLIBC_2.11)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libc.so.6(GLIBC_2.7)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libc.so.6(GLIBC_2.8)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libgio-2.0.so.0()(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libstdc++.so.6(GLIBCXX_3.4.11)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libstdc++.so.6(GLIBCXX_3.4.9)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxml2.so.2(LIBXML2_2.4.30)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxml2.so.2(LIBXML2_2.6.0)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxml2.so.2(LIBXML2_2.6.6)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxslt.so.1(LIBXML2_1.0.11)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxslt.so.1(LIBXML2_1.0.22)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxslt.so.1(LIBXML2_1.0.24)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64
libxslt.so.1(LIBXML2_1.1.9)(64bit) is needed by Sun_JDK7-1.7.0-51.x86_64

now if i include AuthReqProv:no in my spec file, i don't run into this issue when installing. the other workaround is that i just install with the --nodeps option.

not sure why this is happening or if it is an issue. how does a package build properly but not install properly? is it worse to set AuthReqProv:no during the rpm build or not to set it and install the rpm with --nodeps?

any ideas on how to resolve these dependencies?

thanks in advance

When you built the RPM did you specify the dependencies in the .spec file?

no, i did not. this seems to be rpm trying to resolve shared lib dependencies on its own.

You'll need to add some 'Requires:' lines, just before the %description (atm on Windows, so shoot me for incorrect namings):

In the like of:

Requires:  PACKAGE_that_provies_libavcodec.so.52
..
%Description

To figure out which package provides that libavcodec, try:

yum provides *libavcodec.so.52*

Hope this helps