File acroread.patch of Package acroread

--- acroread.orig	2010-08-26 19:06:01.000000000 +0800
+++ acroread	2010-08-26 19:08:31.000000000 +0800
@@ -12,13 +12,42 @@
     exit
 fi
 
+# Workaround for http://bugzilla.novell.com/show_bug.cgi?id=370330
+if [ "$GTK_IM_MODULE" == "xim" ] ; then
+    for lc in LANG LC_ALL LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION
+    do
+      eval val="\$$lc"
+      case "$val" in
+          *.UTF-8*)
+              eval $lc=\${val%%[.@]*}
+	      ;;
+	  *)
+	      ;;
+      esac
+    done
+fi
+
+# Workaround for http://bugzilla.novell.com/show_bug.cgi?id=358438 comment #31 - #33
+# (acroread doesn't start when the theme from the gtk-qt-engine is used under VNC
+if [ "$(xdpyinfo | grep XInputExtension)" == "" ] ; then
+    # there is no XInputExtension in the VNC X-servers
+    unset GTK2_RC_FILES
+fi
+
+# use fontconfig, see http://bugzilla.novell.com/show_bug.cgi?id=275088
+ACRO_ENABLE_FONT_CONFIG=1
+export ACRO_ENABLE_FONT_CONFIG
 
 LaunchBinary()
 {
 #    We are not LSB compliant yet, so let's not use ld-lsb.so.3 as loader.
 #    if [ "`uname -s`" = "Linux" ] && [ ! -x /lib/ld-lsb.so.3 ]; then
+         # Workaround for http://bugzilla.novell.com/show_bug.cgi?id=375551
+#        export LD_PRELOAD=$ACRO_INSTALL_DIR/intellinux/lib/suse-do-not-grab-server.so
 #        exec /lib/ld-linux.so.2 ${1+"$@"}
 #    else
+        # Workaround for http://bugzilla.novell.com/show_bug.cgi?id=375551
+        export LD_PRELOAD=$ACRO_INSTALL_DIR/intellinux/lib/suse-do-not-grab-server.so
         exec ${1+"$@"}
 #    fi
 }
@@ -501,32 +530,68 @@
   TestCmdOption="-f"
 fi
 
-greConfigFile="${HOME}/.adobe/Acrobat/$majorRelease/Preferences/acrogre.conf"
+# if MOZILLA_COMP_PATH is already set, use it (useful for debugging?)
+# if not, get it from the user config or search it in the system:
 
-if [ -f "$greConfigFile" ]; then
-    mozillaPath="`cat "$greConfigFile"`"
-    if [ -n "$mozillaPath" ]; then
-        MOZILLA_COMP_PATH="$mozillaPath"
-        export MOZILLA_COMP_PATH
+if [ -z "$MOZILLA_COMP_PATH" ]; then
+
+    # First try to get MOZILLA_COMP_PATH from the user config file.
+    # But use it only if it points to a location where libgtkembedmoz.so
+    # really exists:
+    greConfigFile="${HOME}/.adobe/Acrobat/$majorRelease/Preferences/acrogre.conf"
+    if [ -f "$greConfigFile" ]; then
+	mozillaPath="`cat "$greConfigFile"`"
+	if [ -x "$mozillaPath/libgtkembedmoz.so" ]; then
+	    MOZILLA_COMP_PATH="$mozillaPath"
+	    export MOZILLA_COMP_PATH
+	fi
     fi
-else
-    for i in /etc/gre.d/gre.conf /etc/gre.d/firefox.conf /etc/gre.d/mozilla.conf /etc/gre.d/*.conf /etc/gre.conf
-    do
-        if [ -f "$i" ]; then
-            mozillaPath="`grep "^GRE_PATH=" "$i" | cut -d= -f2 | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`"
-            if [ -n "$mozillaPath" ]; then
-                MOZILLA_COMP_PATH="$mozillaPath"
+    
+    if [ -z "$MOZILLA_COMP_PATH" ]; then
+    # There was either nothing in the user config file (first start ever
+    # of acroread?) or something invalid. Try to find
+    # libgtkembedmoz.so in the system:
+    # (the last match in the glob pattern will win. glob patterns
+    # are sorted alphabetically, i.e the symlink 
+    # /usr/lib/xulrunner-1.8.1 which points to the current version
+    # will win over any specific version /usr/lib/xulrunner-1.8.1.1x).
+        for lib in /usr/lib/seamonkey/libgtkembedmoz.so /usr/lib/xulrunner-*/libgtkembedmoz.so 
+        do
+            if [ -x $lib ]; then
+                MOZILLA_COMP_PATH="$(dirname $lib)"
                 export MOZILLA_COMP_PATH
-                break
-            fi
-        fi
-    done
+	    fi
+	done
+    fi
+fi
+# http://bugzilla.novell.com/show_bug.cgi?id=457928
+# As mozilla-xulrunner181 got dropped in openSUSE 11.1,
+# we don't have libgtkembedmoz.so anymore, only libmozgnome.so
+# from the mozilla-xulrunner190-gnomevfs package.
+# Therefore, MOZILLA_COMP_PATH will still be empty here on
+# openSUSE >= 11.1.
+# We can only use an ugly workaround here and duplicate
+# the xulrunner-1.9 directory in the home directory of the user:
+if [ -z "$MOZILLA_COMP_PATH" ]; then
+    if [ -f /usr/lib/xulrunner-1.9/components/libmozgnome.so ]; then
+        pushd /usr/lib > /dev/null
+        find xulrunner-1.9/ -mindepth 1 -type d -exec mkdir -p \
+            $HOME/.adobe/Acrobat/9.0/Resource/{} \;
+        find xulrunner-1.9/ -mindepth 1 -type f -exec ln -sf /usr/lib/{} \
+            $HOME/.adobe/Acrobat/9.0/Resource/{} \;
+        ln -sf /usr/lib/xulrunner-1.9/components/libmozgnome.so \
+            $HOME/.adobe/Acrobat/9.0/Resource/xulrunner-1.9/libgtkembedmoz.so
+        popd > /dev/null
+        MOZILLA_COMP_PATH=$HOME/.adobe/Acrobat/9.0/Resource/xulrunner-1.9/
+        export MOZILLA_COMP_PATH
+    fi
 fi
 
 if [ -z "$mozillaPath" ]; then
   MozPath="`gconftool-2 -g /desktop/gnome/url-handlers/http/command 2>/dev/null | cut -d ' ' -f1 2>/dev/null`"
   [ -x "${MozPath}" ] || MozPath="`Which "$MozPath"`"
-  mozillaPath="`readlink "$MozPath" | xargs dirname`"
+  # fix prints dirname error upon start, bnc#574580, bili@novell.com
+  [ -n ${MozPath} ] || mozillaPath="`readlink "$MozPath" | xargs dirname`"
   if [ -n "$mozillaPath" ] &&  $TestCmd $TestCmdOption "$mozillaPath/libgtkembedmoz.so" || $TestCmd $TestCmdOption "$mozillaPath/libxul.so" ; then
     MOZILLA_COMP_PATH="$mozillaPath"
     export MOZILLA_COMP_PATH
openSUSE Build Service is sponsored by