Goal is to identify a package version across distros RPM based Fedora, CentOS, RedHat etc. Can I rely on upstream version to be same on all the distros? If yes then how can I retrieve (RPM or DEB) upstream version number from command line?
Can't post this as an aswer -->
These dependencies that are listed in rpm -qp -requires .rpm are virtual packages if automatic dependencies is specified in .spec file. These virtual packages are NOT library soname but rather just virtual package names (even though they look like soname).
e.g. on Fedora 27, this works
$ rpm -q --whatprovides "libQt5Core.so.5()(64bit)" qt5-qtbase-5.9.2-5.fc27.x86_64
but this doesn't
$ rpm -q --whatprovides libQt5Core.so.5 no package provides libQt5Core.so.5 $ rpm -q --whatprovides libQt5Core no package provides libQt5Core $ rpm -q --whatprovides Qt5Core no package provides Qt5Core
If your own .rpm itself bundles the libraries (i.e. provides these virtual packages) then RPM will not complain if these virtual packages are not installed on the system since they are supplied with your package.