Bug 420471

Summary: nspluginwrapper relies on a specific version of firefox and this breaks
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: nspluginwrapperAssignee: Martin Stransky <stransky>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: caillon
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-11 20:49:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michal Jaegermann 2007-12-11 20:41:38 UTC
Description of problem:

nspluginwrapper has an explicit dependency on gecko-libs and
'rpm -q --whatprovides gecko-libs' responds with firefox only
so that means firefox.  Is that right?  Because if only
libgtkembedmoz.so then that this can be provided by other packages
too.  But this is a side issue.

The real trouble is that /usr/bin/mozilla-plugin-config has the
following code:

##
## Detect a gecko-lib instalation if it's requested
##
if [ "0" -eq "1" ]; then
    if [ ! -x $MOZ_LIB_DIR/firefox-2.0.0.9/firefox-bin ]; then
        if [ ! -x $SECONDARY_LIB_DIR/firefox-2.0.0.9/firefox-bin ]; then
            echo "Error: $MOZ_LIB_DIR/firefox-2.0.0.9/firefox-bin not found"
            if [ -d $SECONDARY_LIB_DIR ]; then
                echo "       $SECONDARY_LIB_DIR/firefox-2.0.0.9/firefox-bin not
found"            fi
            exit 1
        fi
        MOZ_LIB_DIR="$SECONDARY_LIB_DIR"
    fi
    export LD_LIBRARY_PATH=$MOZ_LIB_DIR/firefox-2.0.0.9
fi

This obviously breaks if a firefox version changes - like right now
as firefox-2.0.0.9 was replaced. Instead a code like that could
be used:

##
## Detect a gecko-libs instalation if it's requested
##

set_library_path () {
    [ $? -eq 0 ] || exit 1 # gecko-libs are missing
    if [ "$2" = x86_64 ] ; then
        export LD_LIBRARY_PATH="/usr/lib64/$1"
    else
        export LD_LIBRARY_PATH="/usr/lib/$1"
    fi
}

set_library_path $(rpm -q --whatprovides gecko-libs \
    --qf '%{name}-%{version} %{arch}\n')

Does that means that with a new firefox plugins have to be
rewrapped?  If yes then some triggers are needed.

Version-Release number of selected component (if applicable):
nspluginwrapper-0.9.91.5-12.fc8

Comment 1 Martin Stransky 2007-12-11 20:49:16 UTC
Check this code:

[snip]

 if [ "0" -eq "1" ]; then

[snip]

nspluginwrapper uses gecko-libs run-time only if it's compiled with XPCOM
support. And XPCOM support is turned off in Fedora 8.



Comment 2 Michal Jaegermann 2007-12-11 21:18:58 UTC
Ok, but if and when  XPCOM support will be turned on will you
remember that you have a brewing trouble on your hands?

So I should look more carefuly at the original code and
in a replacement it should be

   if [ "$2" = x86_64 -o "$2" = ia64 -o "$2" = s390 ] ; then
   ....

and possibly MOZ_LIB_DIR and SECONDARY_LIB_DIR adjusted as they
are currently not derived from an architecture of a package
but these are easy to adjust