Multilib Middle-Ground
Toshio Kuratomi
a.badger at gmail.com
Thu May 1 23:20:34 UTC 2008
Denis Leroy wrote:
> Rahul Sundaram wrote:
>> Les Mikesell wrote:
>>> Paul Howarth wrote:
>>
>>>> Stripping of pathname-based and package-name based dependencies I
>>>> can understand, but not the library deps.
>>>
>>> Are they the same across all RPM based systems?
>>
>> Yes, they are and the third party packages have no excuse if they are
>> deliberately disabling the automatic dependency mechanisms.
>
> It's not that simple. VMware does this for a simple reason: they want a
> single RPM that works on *all* distros. Essentially it's like static
> linking (except they don't, they just ship their own dependencies).
> VMware would otherwise have fairly complex dependencies (gtkmm comes to
> mind) that would force them to provide probably a different RPM for each
> <distro,version> pair... There's simply no easy way to distribute
> closed-source softare for Linux, as we all know.
>
Isn't this the basic algorithm that's needed to solve the library
dependency problem?
#!/usr/bin/python
import os
import sys
app = 'PROPRIETARY_APP'
missingLibs = []
if os.exists('/usr/lib64/%s' % app):
libdir = '/usr/lib64/%s' % app
elif os.exists('/usr/lib/%s' % app):
libdir = '/usr/lib/%s' % app
else:
print 'Warning: Cannot find private app dir.'
# Attempt to start the app. The OS might provide all the necessary
# libraries.
sys.exit(os.system(app))
libToPrivateDir = {'libfoo.so.1': '%s/libfoo1' % libdir,
'libbar.so.2': '%s/libbar2' % libdir}
for line in os.popen(['ldd', os.path.join('/usr/bin',app)]):
tokens = line.split()
if '=>' not in tokens:
continue
if ['not', 'found'] == tokens[-2:]:
missingLibs.append(tokens[0])
path = [libToPrivateDir[lib] for lib in missingLibs]
current_path = os.environ('LD_LIBRARY_PATH')
if current_path:
path.insert(0, current_path)
if path:
os.environ['LD_LIBRARY_PATH'] = ':'.join(path)
sys.exit(os.system(app))
More information about the fedora-devel-list
mailing list