rpms/nspluginwrapper/F-9 nspluginwrapper-1.1.2-build.patch, NONE, 1.1 .cvsignore, 1.8, 1.9 nspluginwrapper.spec, 1.57, 1.58 sources, 1.10, 1.11 nspluginwrapper-1.1.0-build.patch, 1.5, NONE nspluginwrapper-1.1.0-visual-id.patch, 1.3, NONE

Martin Stransky stransky at fedoraproject.org
Thu Oct 16 11:53:24 UTC 2008


Author: stransky

Update of /cvs/pkgs/rpms/nspluginwrapper/F-9
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11097

Modified Files:
	.cvsignore nspluginwrapper.spec sources 
Added Files:
	nspluginwrapper-1.1.2-build.patch 
Removed Files:
	nspluginwrapper-1.1.0-build.patch 
	nspluginwrapper-1.1.0-visual-id.patch 
Log Message:
* Thu Oct 16 2008 Martin Stransky <stransky at redhat.com> 1.1.2-1
- updated to 1.1.12
- added librhythmbox* to ignored plugins (#467187)
- removed debug prints (#467090)



nspluginwrapper-1.1.2-build.patch:

--- NEW FILE nspluginwrapper-1.1.2-build.patch ---
diff -up nspluginwrapper-1.1.2/Makefile.build nspluginwrapper-1.1.2/Makefile
--- nspluginwrapper-1.1.2/Makefile.build	2008-10-12 18:10:13.000000000 +0200
+++ nspluginwrapper-1.1.2/Makefile	2008-10-16 12:08:01.000000000 +0200
@@ -76,23 +76,6 @@ ifneq (,$(findstring $(OS),netbsd dragon
 X_LDFLAGS += -Wl,--rpath,$(x11prefix)/$(lib64)
 endif
 
-ARCH_32 = $(ARCH)
-ifeq ($(biarch), yes)
-ARCH_32 = $(TARGET_ARCH)
-LSB_LIBS = $(LSB_OBJ_DIR)/libc.so $(LSB_OBJ_DIR)/libgcc_s_32.so
-LSB_LIBS += $(LSB_CORE_STUBS:%=$(LSB_OBJ_DIR)/%.so)
-LSB_LIBS += $(LSB_CORE_STATIC_STUBS:%=$(LSB_OBJ_DIR)/%.a)
-LSB_LIBS += $(LSB_DESKTOP_STUBS:%=$(LSB_OBJ_DIR)/%.so)
-endif
-
-LSB_TOP_DIR = $(SRC_PATH)/lsb-build
-LSB_INC_DIR = $(LSB_TOP_DIR)/headers
-LSB_SRC_DIR = $(LSB_TOP_DIR)/stub_libs
-LSB_OBJ_DIR = lsb-build-$(ARCH_32)
-LSB_CORE_STUBS = $(shell cat $(LSB_SRC_DIR)/core_filelist)
-LSB_CORE_STATIC_STUBS = $(shell cat $(LSB_SRC_DIR)/core_static_filelist)
-LSB_DESKTOP_STUBS = $(shell cat $(LSB_SRC_DIR)/desktop_filelist)
-
 ifeq (i386,$(TARGET_ARCH))
 TARGET_ELF_ARCH = elf32-i386
 endif
@@ -100,45 +83,32 @@ ifeq (ppc,$(TARGET_ARCH))
 TARGET_ELF_ARCH = elf32-powerpc
 endif
 
-MOZILLA_CFLAGS = -I$(SRC_PATH)/npapi -I$(SRC_PATH)/npapi/nspr
+MOZILLA_CFLAGS = $(GECKO_CFLAGS)
+MOZILLA_LDFLAGS = $(GECKO_LDFLAGS)
 
 npwrapper_LIBRARY = npwrapper.so
-npwrapper_RAWSRCS = npw-wrapper.c npw-rpc.c rpc.c debug.c utils.c npruntime.c
+npwrapper_RAWSRCS = npw-wrapper.c npw-rpc.c rpc.c debug.c utils.c npruntime.c npw-dir.c
 npwrapper_SOURCES = $(npwrapper_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
 npwrapper_OBJECTS = $(npwrapper_RAWSRCS:%.c=npwrapper-%.os)
 npwrapper_CFLAGS  = $(CFLAGS) $(X_CFLAGS) $(MOZILLA_CFLAGS) $(GLIB_CFLAGS)
-npwrapper_LDFLAGS = $(X_LDFLAGS) $(libpthread_LDFLAGS) $(libsocket_LDFLAGS)
+npwrapper_LDFLAGS = $(LDFLAGS) $(X_LDFLAGS) $(libpthread_LDFLAGS) $(libsocket_LDFLAGS) $(MOZILLA_LDFLAGS)
 npwrapper_LDFLAGS += $(GLIB_LDFLAGS)
 
 npviewer_PROGRAM = npviewer.bin
 npviewer_RAWSRCS = npw-viewer.c npw-rpc.c rpc.c debug.c utils.c npruntime.c
 npviewer_SOURCES = $(npviewer_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
 npviewer_OBJECTS = $(npviewer_RAWSRCS:%.c=npviewer-%.o)
-ifeq ($(biarch),yes)
-npviewer_CFLAGS  = $(CFLAGS_32)
-npviewer_CFLAGS += -I$(LSB_INC_DIR)
-npviewer_CFLAGS += -I$(LSB_INC_DIR)/glib-2.0
-npviewer_CFLAGS += -I$(LSB_INC_DIR)/gtk-2.0
-npviewer_LDFLAGS = $(LDFLAGS_32) -L$(LSB_OBJ_DIR)
-npviewer_LDFLAGS += -lgtk-x11-2.0 -lgdk-x11-2.0 -lgobject-2.0 -ldl -lglib-2.0 -lX11 -lXt
-else
-npviewer_CFLAGS += $(GTK_CFLAGS)
-npviewer_LDFLAGS = $(GTK_LDFLAGS) $(X_LDFLAGS)
-endif
-npviewer_CFLAGS  += $(MOZILLA_CFLAGS)
-npviewer_LDFLAGS += $(libdl_LDFLAGS) $(libpthread_LDFLAGS) -lgthread-2.0
-ifeq ($(TARGET_OS):$(TARGET_ARCH),linux:i386)
+npviewer_CFLAGS  = $(CFLAGS) $(GTK_CFLAGS) $(MOZILLA_CFLAGS)
+npviewer_LDFLAGS = $(LDFLAGS) $(GTK_LDFLAGS) $(X_LDFLAGS) $(libdl_LDFLAGS) $(libpthread_LDFLAGS) $(MOZILLA_LDFLAGS)
+
 npviewer_MAPFILE = $(SRC_PATH)/src/npw-viewer.map
-endif
 ifneq ($(npviewer_MAPFILE),)
 npviewer_LDFLAGS += -Wl,--export-dynamic
 npviewer_LDFLAGS += -Wl,--version-script,$(npviewer_MAPFILE)
 endif
-ifeq ($(TARGET_OS):$(TARGET_ARCH),linux:i386)
 npviewer_SOURCES += $(SRC_PATH)/src/cxxabi-compat.cpp
 npviewer_OBJECTS += npviewer-cxxabi-compat.o
 npviewer_LDFLAGS += -lsupc++
-endif
 ifeq ($(TARGET_OS):$(TARGET_ARCH),solaris:i386)
 npviewer_LDFLAGS += $(libsocket_LDFLAGS)
 endif
@@ -150,16 +120,6 @@ npplayer_CFLAGS   = $(GTK_CFLAGS) $(MOZI
 npplayer_LDFLAGS  = $(GTK_LDFLAGS) $(CURL_LDFLAGS) $(X_LDFLAGS)
 npplayer_LDFLAGS += -lgthread-2.0 $(libpthread_LDFLAGS) $(libsocket_LDFLAGS)
 
-libxpcom_LIBRARY = libxpcom.so
-libxpcom_RAWSRCS = libxpcom.c debug.c
-libxpcom_SOURCES = $(libxpcom_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
-libxpcom_OBJECTS = $(libxpcom_RAWSRCS:%.c=libxpcom-%.o)
-libxpcom_CFLAGS  = $(PIC_CFLAGS)
-ifeq ($(biarch),yes)
-libxpcom_CFLAGS += -I$(LSB_INC_DIR)
-libxpcom_LDFLAGS = $(LDFLAGS_32) -L$(LSB_OBJ_DIR)
-endif
-
 libnoxshm_LIBRARY = libnoxshm.so
 libnoxshm_RAWSRCS = libnoxshm.c
 libnoxshm_SOURCES = $(libnoxshm_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
@@ -171,10 +131,11 @@ libnoxshm_LDFLAGS = $(LDFLAGS_32) -L$(LS
 endif
 
 npconfig_PROGRAM = npconfig
-npconfig_RAWSRCS = npw-config.c
+npconfig_RAWSRCS = npw-config.c npw-dir.c
 npconfig_SOURCES = $(npconfig_RAWSRCS:%.c=$(SRC_PATH)/src/%.c)
 npconfig_OBJECTS = $(npconfig_RAWSRCS:%.c=npconfig-%.o)
-npconfig_LDFLAGS = $(libdl_LDFLAGS)
+npconfig_CFLAGS  = $(CFLAGS) $(MOZILLA_CFLAGS)
+npconfig_LDFLAGS = $(LDFLAGS) $(libdl_LDFLAGS) $(MOZILLA_LDFLAGS)
 ifneq (,$(findstring $(OS),netbsd dragonfly))
 # We will try to dlopen() the native plugin library. If that lib is
 # linked against libpthread, then so must our program too.
@@ -202,11 +163,8 @@ CPPFLAGS	= -I. -I$(SRC_PATH)
 TARGETS		= $(npconfig_PROGRAM)
 TARGETS		+= $(nploader_PROGRAM)
 TARGETS		+= $(npwrapper_LIBRARY)
-ifeq ($(build_viewer),yes)
 TARGETS		+= $(npviewer_PROGRAM)
-TARGETS		+= $(libxpcom_LIBRARY)
 TARGETS		+= $(libnoxshm_LIBRARY)
-endif
 ifeq ($(build_player),yes)
 TARGETS		+= $(npplayer_PROGRAM)
 endif
@@ -265,10 +223,6 @@ uninstall.wrapper:
 uninstall.viewer:
 	rm -f $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(npviewer_PROGRAM)
 	rm -f $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(npviewer_PROGRAM:%.bin=%)
-uninstall.libxpcom:
-	rm -f $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(libxpcom_LIBRARY)
-uninstall.libnoxshm:
-	rm -f $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(libnoxshm_LIBRARY)
 uninstall.loader:
 	rm -f $(DESTDIR)$(pkglibdir)/noarch/$(nploader_PROGRAM)
 uninstall.config:
@@ -277,55 +231,25 @@ uninstall.config:
 uninstall.mkruntime:
 	rm -f $(DESTDIR)$(pkglibdir)/noarch/mkruntime
 
-install: install.dirs install.player install.wrapper install.viewer install.libxpcom install.libnoxshm install.loader install.config install.mkruntime
+install: install.dirs install.player install.wrapper install.viewer install.loader install.config
 install.dirs:
-	mkdir -p $(DESTDIR)$(pkglibdir)/noarch
-	mkdir -p $(DESTDIR)$(pkglibdir)/$(ARCH)
-	mkdir -p $(DESTDIR)$(pkglibdir)/$(ARCH)/$(OS)
-ifneq ($(ARCH),$(ARCH_32))
-	mkdir -p $(DESTDIR)$(pkglibdir)/$(ARCH_32)
-	mkdir -p $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)
-endif
+	mkdir -p $(DESTDIR)$(pkglibdir)
 ifeq ($(build_player),yes)
 install.player: $(npplayer_PROGRAM)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(npplayer_PROGRAM) $(DESTDIR)$(pkglibdir)/$(ARCH)/$(OS)/$(npplayer_PROGRAM)
+	install -m 755 $(STRIP_OPT) $(npplayer_PROGRAM) $(DESTDIR)$(pkglibdir)/$(npplayer_PROGRAM)
 	mkdir -p $(DESTDIR)$(bindir)
-	$(LN_S) $(pkglibdir)/$(ARCH)/$(OS)/$(npplayer_PROGRAM) $(DESTDIR)$(bindir)/nspluginplayer
 else
 install.player:
 endif
 install.wrapper: $(npwrapper_LIBRARY)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(npwrapper_LIBRARY) $(DESTDIR)$(pkglibdir)/$(ARCH)/$(OS)/$(npwrapper_LIBRARY)
-ifeq ($(build_viewer),yes)
-install.viewer: install.viewer.bin install.viewer.glue
-install.libxpcom: do.install.libxpcom
-install.libnoxshm: do.install.libnoxshm
-else
-install.viewer:
-install.libxpcom:
-install.libnoxshm:
-endif
+	install -m 755 $(STRIP_OPT) $(npwrapper_LIBRARY) $(DESTDIR)$(pkglibdir)/$(npwrapper_LIBRARY)
+install.viewer: install.viewer.bin
 install.viewer.bin: $(npviewer_PROGRAM)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(npviewer_PROGRAM) $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(npviewer_PROGRAM)
-install.viewer.glue::
-	p=$(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(npviewer_PROGRAM:%.bin=%);	\
-	echo "#!/bin/sh" > $$p;								\
-	echo "TARGET_OS=$(TARGET_OS)" >> $$p;						\
-	echo "TARGET_ARCH=$(TARGET_ARCH)" >> $$p;					\
-	echo ". $(pkglibdir)/noarch/$(nploader_PROGRAM)" >> $$p;			\
-	chmod 755 $$p
-do.install.libxpcom: $(libxpcom_LIBRARY)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(libxpcom_LIBRARY) $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(libxpcom_LIBRARY)
-do.install.libnoxshm: $(libnoxshm_LIBRARY)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(libnoxshm_LIBRARY) $(DESTDIR)$(pkglibdir)/$(ARCH_32)/$(TARGET_OS)/$(libnoxshm_LIBRARY)
+	install -m 755 $(STRIP_OPT) $(npviewer_PROGRAM) $(DESTDIR)$(pkglibdir)/$(npviewer_PROGRAM)
 install.config: $(npconfig_PROGRAM)
-	$(INSTALL) -m 755 $(STRIP_OPT) $(npconfig_PROGRAM) $(DESTDIR)$(pkglibdir)/$(ARCH)/$(OS)/$(npconfig_PROGRAM)
-	mkdir -p $(DESTDIR)$(bindir)
-	$(LN_S) $(pkglibdir)/$(ARCH)/$(OS)/$(npconfig_PROGRAM) $(DESTDIR)$(bindir)/nspluginwrapper
+	install -m 755 $(STRIP_OPT) $(npconfig_PROGRAM) $(DESTDIR)$(pkglibdir)/$(npconfig_PROGRAM)
 install.loader: $(nploader_PROGRAM)
-	$(INSTALL) -m 755 $(nploader_PROGRAM) $(DESTDIR)$(pkglibdir)/noarch/$(nploader_PROGRAM)
-install.mkruntime: $(SRC_PATH)/utils/mkruntime.sh
-	$(INSTALL) -m 755 $< $(DESTDIR)$(pkglibdir)/noarch/mkruntime
+	install -m 755 $(nploader_PROGRAM) $(DESTDIR)$(pkglibdir)/$(nploader_PROGRAM)
 
 $(archivedir)::
 	[ -d $(archivedir) ] || mkdir $(archivedir) > /dev/null 2>&1
@@ -374,13 +298,13 @@ npwrapper-%.os: $(SRC_PATH)/src/%.c
 	$(CC) -o $@ -c $< $(PIC_CFLAGS) $(CPPFLAGS) $(npwrapper_CFLAGS) -DBUILD_WRAPPER
 
 $(npviewer_PROGRAM): $(npviewer_OBJECTS) $(npviewer_MAPFILE) $(LSB_OBJ_DIR) $(LSB_LIBS)
-	$(CC) $(LDFLAGS_32) -o $@ $(npviewer_OBJECTS) $(npviewer_LDFLAGS)
+	$(CC) -o $@ $(npviewer_OBJECTS) $(npviewer_LDFLAGS)
 
 npviewer-%.o: $(SRC_PATH)/src/%.c
-	$(CC) $(CFLAGS_32) -o $@ -c $< $(CPPFLAGS) $(npviewer_CFLAGS) -DBUILD_VIEWER
+	$(CC) -o $@ -c $< $(CPPFLAGS) $(npviewer_CFLAGS) -DBUILD_VIEWER
 
 npviewer-%.o: $(SRC_PATH)/src/%.cpp
-	$(CXX) $(CFLAGS_32) -o $@ -c $< $(CPPFLAGS) $(npviewer_CFLAGS) -DBUILD_VIEWER
+	$(CXX) -o $@ -c $< $(CPPFLAGS) $(npviewer_CFLAGS) -DBUILD_VIEWER
 
 $(npplayer_PROGRAM): $(npplayer_OBJECTS) $(npplayer_MAPFILE) $(LSB_OBJ_DIR) $(LSB_LIBS)
 	$(CC) $(LDFLAGS) -o $@ $(npplayer_OBJECTS) $(npplayer_LDFLAGS)
@@ -390,12 +314,6 @@ npplayer-%.o: $(SRC_PATH)/src/%.c
 npplayer-%.o: $(SRC_PATH)/src/tidy/%.c
 	$(CC) $(CFLAGS) -o $@ -c $< $(CPPFLAGS) $(npplayer_CFLAGS) -DBUILD_PLAYER
 
-$(libxpcom_LIBRARY): $(libxpcom_OBJECTS) $(LSB_OBJ_DIR) $(LSB_LIBS)
-	$(CC) $(LDFLAGS_32) $(DSO_LDFLAGS) -o $@ $(libxpcom_OBJECTS) $(libxpcom_LDFLAGS) -Wl,$(LD_soname),libxpcom.so
-
-libxpcom-%.o: $(SRC_PATH)/src/%.c
-	$(CC) $(CFLAGS_32) -o $@ -c $< $(CPPFLAGS) $(libxpcom_CFLAGS) -DBUILD_XPCOM
-
 $(libnoxshm_LIBRARY): $(libnoxshm_OBJECTS) $(LSB_OBJ_DIR) $(LSB_LIBS)
 	$(CC) $(LDFLAGS_32) $(DSO_LDFLAGS) -o $@ $(libnoxshm_OBJECTS) $(libnoxshm_LDFLAGS) -Wl,$(LD_soname),libnoxshm.so
 
@@ -406,17 +324,23 @@ $(npconfig_PROGRAM): $(npconfig_OBJECTS)
 	$(CC) -o $@ $(npconfig_OBJECTS) $(npconfig_LDFLAGS)
 
 npconfig-%.o: $(SRC_PATH)/src/%.c
-	$(CC) -o $@ -c $< $(CPPFLAGS) $(CFLAGS)
+	$(CC) -o $@ -c $< $(CPPFLAGS) $(npconfig_CFLAGS)
 
 $(nploader_PROGRAM): $(nploader_SOURCES)
-	sed -e "s|%NPW_LIBDIR%|$(pkglibdir)|" $< > $@
+	sed -e "s|%NPW_PREFIX%|$(prefix)|"      \
+          -e "s|%NPW_LIB32%|$(lib32)|"        \
+          -e "s|%NPW_LIB64%|$(lib64)|"        \
+          -e "s|%TARGET_OS%|$(TARGET_OS)|"    \
+          -e "s|%TARGET_ARCH%|$(TARGET_ARCH)|" \
+          -e "s|%GECKO_LIBDIR%|$(GECKO_LIBDIR)|" \
+          -e "s|%NPW_DIR%|$(pkgdir)|" $< > $@
 	chmod 755 $@
 
 $(LSB_OBJ_DIR)::
 	@[ -d $(LSB_OBJ_DIR) ] || mkdir $(LSB_OBJ_DIR) > /dev/null 2>&1
 
 $(LSB_OBJ_DIR)/%.o: $(LSB_SRC_DIR)/%.c
-	$(CC) $(CFLAGS_32) -nostdinc -fno-builtin -I. -I$(LSB_INC_DIR) -c $< -o $@
+	$(CC) $(CFLAGS) -nostdinc -fno-builtin -I. -I$(LSB_INC_DIR) -c $< -o $@
 
 $(LSB_OBJ_DIR)/%.a: $(LSB_OBJ_DIR)/%.o
 	$(AR) rc $@ $<
@@ -429,7 +353,7 @@ $(LSB_OBJ_DIR)/libgcc_s_32.so: $(LSB_OBJ
 	$(LN_S) libgcc_s.so $@
 
 $(LSB_OBJ_DIR)/%.so: $(LSB_OBJ_DIR)/%.o
-	$(CC) $(LDFLAGS_32) -nostdlib $(DSO_LDFLAGS) $< -o $@ \
+	$(CC) $(LDFLAGS) -nostdlib $(DSO_LDFLAGS) $< -o $@ \
 		-Wl,--version-script,$(patsubst $(LSB_OBJ_DIR)/%.o,$(LSB_SRC_DIR)/%.Version,$<) \
 		-Wl,-soname,`grep "$(patsubst $(LSB_OBJ_DIR)/%.o,%,$<) " $(LSB_SRC_DIR)/LibNameMap.txt | cut -f2 -d' '`
 
diff -up nspluginwrapper-1.1.2/configure.build nspluginwrapper-1.1.2/configure
--- nspluginwrapper-1.1.2/configure.build	2008-10-12 17:06:28.000000000 +0200
+++ nspluginwrapper-1.1.2/configure	2008-10-16 11:37:40.000000000 +0200
@@ -3,6 +3,8 @@
 #  nspluginwrapper configure script (C) 2005-2008 Gwenole Beauchesne
 #  derived from qemu configure script, (C) 2003 Fabrice Bellard
 #
+#set -x
+
 PACKAGE=nspluginwrapper
 
 # set temporary file name
@@ -23,11 +25,14 @@ TMPS="${TMPDIR1}/npw-conf-${RANDOM}-$$-$
 prefix="/usr"
 lib32=""
 lib64=""
-x_base_dirs=""
-biarch="guess"
-build_viewer="guess"
+base_lib=""
+base_libdir=""
+pkglibdir=""
+x_base_dir=""
+biarch="no"
+build_viewer="no"
 build_player="yes"
-linux_only="guess"
+linux_only="yes"
 strip="no"
 cc="gcc"
 cxx="g++"
@@ -36,6 +41,8 @@ host_cpu=`uname -m`
 target_os="linux"
 target_cpu="i386"
 rpc_init_timeout=5
+with_xpcom="no"
+with_gecko="mozilla"
 case "$host_cpu" in
 arm*)
     host_cpu="arm"
@@ -87,6 +94,9 @@ case "$opt" in
 --prefix=*)
     prefix=`echo $opt | cut -d '=' -f 2`
     ;;
+--pkgdir=*)
+    pkgdir=`echo $opt | cut -d '=' -f 2`
+    ;;
 --pkglibdir=*)
     pkglibdir=`echo $opt | cut -d '=' -f 2`
     ;;
@@ -96,6 +106,12 @@ case "$opt" in
 --target-cpu=*)
     target_cpu=`echo $opt | cut -d '=' -f 2 | sed -e 's/^i.86$/i386/'`
     ;;
+--with-base-lib=*) 
+    base_lib=`echo $opt | cut -d '=' -f 2`
+    ;;
+--with-base-libdir=*)
+    base_libdir=`echo $opt | cut -d '=' -f 2`
+    ;;
 --enable-generic)
     linux_only="no"
     ;;
@@ -130,7 +146,7 @@ case "$opt" in
     lib64=`echo $opt | cut -d '=' -f 2`
     ;;
 --with-x11-prefix=*)
-    x_base_dirs=`echo $opt | cut -d '=' -f 2`
+    x_base_dir=`echo $opt | cut -d '=' -f 2`
     ;;
 --with-cc=*)
     cc=`echo $opt | cut -d '=' -f 2`
@@ -141,6 +157,12 @@ case "$opt" in
 --rpc-init-timeout=*)
     rpc_init_timeout=`echo $opt | cut -d '=' -f 2`
     ;;
+--with-xpcom=*)
+    with_xpcom=`echo $opt | cut -d '=' -f 2` 
+    ;;
+--with-gecko=*)
+    with_gecko=`echo $opt | cut -d '=' -f 2`
+    ;;
 esac
 done
 
@@ -393,8 +415,8 @@ rm -f $TMPC $TMPE
 # check for GTK+ 2.0 compile CFLAGS
 if test "$build_viewer" = "yes" -o "$build_player" = "yes"; then
     if $pkgconfig --exists gtk+-2.0; then
-	GTK_CFLAGS=`$pkgconfig --cflags gtk+-2.0`
-	GTK_LDFLAGS=`$pkgconfig --libs gtk+-2.0`
+	GTK_CFLAGS=`$pkgconfig --cflags gtk+-2.0 gthread-2.0`
+	GTK_LDFLAGS=`$pkgconfig --libs gtk+-2.0 gthread-2.0`
     else
 	echo "GTK+ 2.0 environment not found"
 	exit 1
@@ -444,25 +466,30 @@ EOF
     rm -f $TMPC $TMPE
 fi
 
-# check for X11 base dir
-if test -z "$x_base_dirs"; then
-    x_base_dirs="
-	/usr
-	/usr/X11R6
-	/usr/local/X11R6
-	$prefix
-    "
-fi
-for dir in $x_base_dirs; do
-    x_include_dir="$dir/include"
-    if test -f $x_include_dir/X11/Intrinsic.h; then
-	x_lib_dir="$dir/$lib64"
-	if test -f $x_lib_dir/libX11.so; then
-	    x_base_dir=$dir
-	    break
-	fi
+# check for Gecko compile CFLAGS
+if $pkgconfig --exists $with_gecko-plugin; then
+    GECKO_CFLAGS=`$pkgconfig --cflags $with_gecko-plugin`
+    GECKO_LDFLAGS=`$pkgconfig --libs $with_gecko-plugin`
+    GECKO_LIBDIR=""
+else
+    echo "gecko-devel not found"
+    exit 1
+fi
+
+
+# check for XPCOM compile CFLAGS
+if [ $with_xpcom == "yes" ]; then
+    if $pkgconfig --exists $with_gecko-xpcom; then
+	GECKO_CFLAGS="$GECKO_CFLAGS"`$pkgconfig --cflags $with_gecko-xpcom`
+        GECKO_LDFLAGS="$GECKO_LDFLAGS"`$pkgconfig --libs $with_gecko-xpcom`
+	GECKO_LIBDIR="$GECKO_LIBDIR"`$pkgconfig --libs-only-L $with_gecko-xpcom | sed -e "s|-L||" -e "s| ||g"`
+    else
+	echo "gecko-devel (XPCOM) not found"
+        exit 1
     fi
-done
+fi
+
+# check for X11 base dir
 if test -z "$x_base_dir"; then
     echo "X11 environment not found"
     exit 1
@@ -574,6 +601,7 @@ EOF
 echo "Standard options:"
 echo "  --help                      print this message"
 echo "  --prefix=PREFIX             install in PREFIX [$prefix]"
+echo "  --pkgdir=name               name of package directory [$pkgdir]"
 echo "  --pkglibdir=ROOT            install private files in ROOT [$pkglibdir]"
 echo "  --target-os=OS              build plugin support for target OS [$target_os]"
 echo "  --target-cpu=CPU            build plugin support for target CPU [$target_cpu]"
@@ -597,6 +625,7 @@ exit 1
 fi
 
 echo "Install prefix            $prefix"
+echo "nspluginwrapper dir       $pkgdir"
 echo "nspluginwrapper root dir  $pkglibdir"
 echo "Strip binaries            $strip"
 echo "Bi-arch build             $biarch"
@@ -613,6 +642,8 @@ echo "host CPU                  $host_cp
 echo "host big endian           $bigendian"
 echo "target OS                 $target_os"
 echo "target CPU                $target_cpu"
+echo "Gecko                     $with_gecko"
+echo "Gecko XPCOM support       $with_xpcom"
 echo "rpc init timeout          $rpc_init_timeout secs"
 
 config_mak="config-host.mak"
@@ -625,18 +656,18 @@ echo "COMPILER=$compiler" >> $config_mak
 echo "CC=$cc" >> $config_mak
 echo "CXX=$cxx" >> $config_mak
 echo "CFLAGS=$CFLAGS" >> $config_mak
+echo "LDFLAGS=$LDFLAGS" >> $config_mak
 echo "GLIB_CFLAGS=$GLIB_CFLAGS" >> $config_mak
 echo "GLIB_LDFLAGS=$GLIB_LDFLAGS" >> $config_mak
 echo "GTK_CFLAGS=$GTK_CFLAGS" >> $config_mak
 echo "GTK_LDFLAGS=$GTK_LDFLAGS" >> $config_mak
 echo "CURL_CFLAGS=$CURL_CFLAGS" >> $config_mak
 echo "CURL_LDFLAGS=$CURL_LDFLAGS" >> $config_mak
-if test "$biarch" = "yes"; then
-echo "LDFLAGS_32=-m32" >> $config_mak
-echo "CFLAGS_32=$CFLAGS_32" >> $config_mak
-else
-echo 'CFLAGS_32=$(CFLAGS)' >> $config_mak
-fi
+echo "GECKO_CFLAGS=$GECKO_CFLAGS" >> $config_mak 
+echo "GECKO_LDFLAGS=$GECKO_LDFLAGS" >> $config_mak 
+echo "GECKO_LIBDIR=$GECKO_LIBDIR" >> $config_mak 
+
+host_os=$target_os
 if test "$host_os" = "linux"; then
     echo "OS=linux" >> $config_mak
     echo "#define HOST_LINUX 1" >> $config_h
@@ -661,6 +692,8 @@ else
     echo "Unsupported OS"
     exit 1
 fi
+
+host_cpu=$target_cpu
 if test "$host_cpu" = "i386" ; then
     echo "ARCH=i386" >> $config_mak
     echo "#define HOST_I386 1" >> $config_h
@@ -705,21 +738,24 @@ if test -n "$fbigendian" ; then
     echo "#define FLOAT_WORDS_BIGENDIAN $fbigendian" >> $config_h
 fi
 
-echo "SRC_PATH=$source_path" >> $config_mak
-echo "build_viewer=$build_viewer" >> $config_mak
 echo "build_player=$build_player" >> $config_mak
-echo "biarch=$biarch" >> $config_mak
+echo "SRC_PATH=$source_path" >> $config_mak
 echo "lib32=$lib32" >> $config_mak
 echo "lib64=$lib64" >> $config_mak
 echo "prefix=$prefix" >> $config_mak
 echo "bindir=$prefix/bin" >> $config_mak
-libdir="$prefix/$lib64"
-echo "libdir=$libdir" >> $config_mak
-echo "#define LIB \"$lib64\"" >> $config_h
-echo "#define LIBDIR \"$libdir\"" >> $config_h
+echo "base_libdir=$base_libdir" >> $config_mak
+echo "#define LIB \"$base_lib\"" >> $config_h
+echo "#define LIBDIR \"$base_libdir\"" >> $config_h
 echo "x11prefix=$x_base_dir" >> $config_mak
 echo "ALLOW_STRIP=$strip" >> $config_mak
 
+if [ $with_xpcom == "yes" ]; then
+ echo "#define USE_XPCOM 1" >> $config_h
+else
+ echo "#define USE_XPCOM 0" >> $config_h
+fi
+
 VERSION=`sed < $source_path/$PACKAGE.spec -n '/^\%define version[	]*/s///p'`
 RELEASE=`sed < $source_path/$PACKAGE.spec -n '/^\%define release[	]*/s///p'`
 SVNDATE=`sed < $source_path/$PACKAGE.spec -n '/^\%define svndate[ 	]*/s///p'`
@@ -740,8 +776,14 @@ else
     echo "#define NPW_VERSION \"$VERSION\"" >> $config_h
 fi
 
+echo "#define NPW_PREFIX \"$prefix\"" >> $config_h
+echo "#define NPW_LIB32 \"$lib32\"" >> $config_h
+echo "#define NPW_LIB64 \"$lib64\"" >> $config_h
+
+echo "pkgdir=$pkgdir" >> $config_mak
+echo "#define NPW_DIR \"$pkgdir\"" >> $config_h
+
 echo "pkglibdir=$pkglibdir" >> $config_mak
-echo "#define NPW_LIBDIR \"$pkglibdir\"" >> $config_h
 
 echo "#define RPC_INIT_TIMEOUT $rpc_init_timeout" >> $config_h
 
@@ -776,9 +818,8 @@ config_h="config.h"
 echo "/* Automatically generated by configure - do not modify */" > $config_h
 echo "#include \"config-host.h\"" >> $config_h
 
-if test "$linux_only" = "yes"; then
-    echo "#define BUILD_LINUX_ONLY 1" >> $config_h
-fi
+# Linux only by default
+echo "#define BUILD_LINUX_ONLY 1" >> $config_h
 
 if test "$target_os" = "linux"; then
     echo "TARGET_OS=linux" >> $config_mak
@@ -819,3 +860,7 @@ if test "$source_path_used" = "yes" ; th
     esac
     ln -sf $source_path/Makefile Makefile
 fi
+
+# Don't strip binaries
+echo "DONT_STRIP=yes" >> $config_mak
+
diff -up nspluginwrapper-1.1.2/src/npw-wrapper.c.build nspluginwrapper-1.1.2/src/npw-wrapper.c
--- nspluginwrapper-1.1.2/src/npw-wrapper.c.build	2008-10-12 17:03:08.000000000 +0200
+++ nspluginwrapper-1.1.2/src/npw-wrapper.c	2008-10-16 11:31:00.000000000 +0200
@@ -44,6 +44,7 @@
 
 #include "rpc.h"
 #include "npw-rpc.h"
+#include "npw-dir.h"
 #include "utils.h"
 
 #define XP_UNIX 1
@@ -286,7 +287,7 @@ g_NPN_GetValue(NPP instance, NPNVariable
   if (mozilla_funcs.getvalue == NULL)
 	return NPERR_INVALID_FUNCTABLE_ERROR;
 
-  D(bug("NPN_GetValue instance=%p, variable=%d\n", instance, variable));
+  D(bug("NPN_GetValue instance=%p, variable=%d\n", instance, variable & 0xffff));
   NPError ret = mozilla_funcs.getvalue(instance, variable, value);
   D(bug(" return: %d [%s]\n", ret, string_of_NPError(ret)));
   return ret;
@@ -330,6 +331,7 @@ static int handle_NPN_GetValue(rpc_conne
 	}
   }
 
+  D(bug("NPN_GetValue() - Unknown type of variable %d\n",variable & 0xffff));
   abort();
 }
 
@@ -1650,8 +1652,9 @@ invoke_NPP_URLNotify(PluginInstance *plu
 
   error = rpc_method_wait_for_reply(plugin->connection, RPC_TYPE_INVALID);
   
-  if (error != RPC_ERROR_NO_ERROR)
+  if (error != RPC_ERROR_NO_ERROR) {
 	npw_perror("NPP_URLNotify() wait for reply", error);
+	}
 }
 
 static void
@@ -2689,9 +2692,9 @@ static void plugin_init(int is_NP_Initia
   static int init_count = 0;
   ++init_count;
   char viewer_path[PATH_MAX];
-  sprintf(viewer_path, "%s/%s/%s/%s", NPW_LIBDIR, NPW_Plugin.target_arch, NPW_Plugin.target_os, NPW_VIEWER);
+  get_viewer(viewer_path,PATH_MAX,NPW_Plugin.target_arch,NPW_VIEWER);
   char connection_path[128];
-  sprintf(connection_path, "%s/%s/%d-%d", NPW_CONNECTION_PATH, plugin_file_name, getpid(), init_count);
+  get_connection_path(connection_path, 128, plugin_file_name, init_count);  
 
   // Cache MIME info and plugin name/description
   if (g_plugin.name == NULL && g_plugin.description == NULL && g_plugin.formats == NULL) {
diff -up /dev/null nspluginwrapper-1.1.2/src/npw-dir.c
--- /dev/null	2008-10-16 11:31:01.154001141 +0200
+++ nspluginwrapper-1.1.2/src/npw-dir.c	2008-10-16 11:31:00.000000000 +0200
@@ -0,0 +1,97 @@
+/*
+ *  npw-dir.h - Directory management for nspluginwrapper
+ *
+ *  by Martin Stransky <stransky at redhat.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "sysdeps.h"
+#include "npw-dir.h"
+
+#include <assert.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+/*
+Expect defined:
+#define NPW_PREFIX  (/usr)
+#define NPW_LIB32   (lib)
+#define NPW_LIB64   (lib64)
+#define NPW_DIR     (nspluginwrapper)
+*/
+
+char * get_plugin_path(char *p_path, int max_path, const char *p_arch)
+{
+  char *p_arch_lib = NULL;
+  
+  if(!strcmp(p_arch, "i386")) {    
+    p_arch_lib = NPW_LIB32;
+  }
+  else if(!strcmp(p_arch, "x86_64")) {
+    p_arch_lib = NPW_LIB64;
+  } 
+  else {
+    assert(0);
+  }    
+  snprintf(p_path,max_path,"%s/%s/%s",NPW_PREFIX,p_arch_lib,NPW_DIR);
+  return(p_path); 
+}
+
+char * get_plugin(char *p_path, int max_path, const char *p_arch, const char *p_plugin)
+{
+  char *p_arch_lib = NULL;
+  
+  if(!strcmp(p_arch, "i386")) {    
+    p_arch_lib = NPW_LIB32;
+  }
+  else if(!strcmp(p_arch, "x86_64")) {
+    p_arch_lib = NPW_LIB64;
+  } 
+  else {
+    assert(0);
+  }    
+  snprintf(p_path,max_path,"%s/%s/%s/%s",NPW_PREFIX,p_arch_lib,NPW_DIR,p_plugin);
+  return(p_path);  
+}
+
+//#define NPW_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" HOST_OS "/" NPW_WRAPPER
+char * get_default_plugin(char *p_path, int max_path)
+{
+  snprintf(p_path,max_path,"%s/%s/%s",LIBDIR,NPW_DIR,NPW_WRAPPER);
+  return(p_path);
+}
+
+//#define NPW_OLD_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" NPW_WRAPPER
+char * get_old_default_plugin(char *p_path, int max_path)
+{
+  return(get_default_plugin(p_path, max_path));
+}
+
+char * get_viewer_path(char *p_path, int max_path, const char *p_arch)
+{
+  return(get_plugin_path(p_path, max_path, p_arch));
+}
+
+char * get_viewer(char *p_path, int max_path, const char *p_arch, const char *p_viewer)
+{
+  return(get_plugin(p_path, max_path, p_arch, p_viewer));
+}
+
+char * get_connection_path(char *p_path, int max_path, const char *p_plugin, int init_count)
+{
+  snprintf(p_path, max_path, "%s/%s/%d-%d", NPW_CONNECTION_PATH, p_plugin, getpid(), init_count);
+  return(p_path);
+}
diff -up nspluginwrapper-1.1.2/src/npw-viewer.sh.build nspluginwrapper-1.1.2/src/npw-viewer.sh
--- nspluginwrapper-1.1.2/src/npw-viewer.sh.build	2008-10-12 17:06:28.000000000 +0200
+++ nspluginwrapper-1.1.2/src/npw-viewer.sh	2008-10-16 11:31:00.000000000 +0200
@@ -4,7 +4,13 @@
 #
 OS="`uname -s`"
 ARCH="`uname -m`"
-NPW_LIBDIR="%NPW_LIBDIR%"
+NPW_PREFIX="%NPW_PREFIX%"
+NPW_LIB32="%NPW_LIB32%"
+NPW_LIB64="%NPW_LIB64%"
+TARGET_OS="%TARGET_OS%"
+TARGET_ARCH="%TARGET_ARCH%"
+NPW_DIR="%NPW_DIR%"
+GECKO_LIBDIR="%GECKO_LIBDIR%"
 
 if test -z "$TARGET_OS"; then
     echo "*** NSPlugin Viewer *** error, TARGET_OS not initialized"
@@ -16,11 +22,6 @@ if test -z "$TARGET_ARCH"; then
     exit 1
 fi
 
-NPW_VIEWER_DIR=$NPW_LIBDIR/$TARGET_ARCH/$TARGET_OS
-
-# Set a new LD_LIBRARY_PATH that is TARGET specific
-export LD_LIBRARY_PATH=$NPW_VIEWER_DIR
-
 # Note that a clever DBT will work at the function level and XShm
 # should be possible with a proper native replacement to emulated code
 # XXX: BTW, anything other than "yes" is interpreted as "no"
@@ -58,6 +59,9 @@ if test "$ARCH" != "$TARGET_ARCH"; then
 	    NPW_USE_XSHM=no
 	fi
 	;;
+    x86_64)
+	LOADER=""
+	;;
     ppc)
 	if test "$ARCH" = "ppc64"; then
 	    case "$OS" in
@@ -92,6 +96,25 @@ if test "$NPW_USE_XSHM" != "yes"; then
     fi
 fi
 
+# Set NPW_VIEWER_DIR (TARGET specific)
+case $TARGET_ARCH in
+      i386)
+      NPW_VIEWER_DIR=$NPW_PREFIX/$NPW_LIB32/$NPW_DIR
+      ;;
+      x86_64)
+      NPW_VIEWER_DIR=$NPW_PREFIX/$NPW_LIB64/$NPW_DIR
+      ;;
+      ppc)
+      NPW_VIEWER_DIR=$NPW_PREFIX/$NPW_LIB32/$NPW_DIR
+      ;;
+      ppc64) 
+      NPW_VIEWER_DIR=$NPW_PREFIX/$NPW_LIB64/$NPW_DIR
+      ;;
+esac
+
+# Set a new LD_LIBRARY_PATH that is TARGET specific
+export LD_LIBRARY_PATH=$NPW_VIEWER_DIR:$GECKO_LIBDIR
+
 # Expand PATH for RealPlayer package on NetBSD (realplay)
 if test "$OS" = "NetBSD"; then
     REALPLAYER_HOME="/usr/pkg/lib/RealPlayer"
diff -up /dev/null nspluginwrapper-1.1.2/src/npw-dir.h
--- /dev/null	2008-10-16 11:31:01.154001141 +0200
+++ nspluginwrapper-1.1.2/src/npw-dir.h	2008-10-16 11:31:00.000000000 +0200
@@ -0,0 +1,35 @@
+/*
+ *  npw-dir.h - Directory management for nspluginwrapper
+ *
+ *  by Martin Stransky <stransky at redhat.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef NPW_DIR_H
+#define NPW_DIR_H
+
+char * get_plugin_path(char *p_path, int max_path, const char *p_arch);
+char * get_plugin(char *p_path, int max_path, const char *p_arch, const char *p_plugin);
+
+char * get_viewer_path(char *p_path, int max_path, const char *p_arch);
+char * get_viewer(char *p_path, int max_path, const char *p_arch, const char *p_viewer);
+
+char * get_default_plugin(char *p_path, int max_path);
+char * get_old_default_plugin(char *p_path, int max_path);
+
+char * get_connection_path(char *p_path, int max_path, const char *p_plugin, int init_count);
+
+#endif
diff -up nspluginwrapper-1.1.2/src/sysdeps.h.build nspluginwrapper-1.1.2/src/sysdeps.h
--- nspluginwrapper-1.1.2/src/sysdeps.h.build	2008-10-12 17:03:08.000000000 +0200
+++ nspluginwrapper-1.1.2/src/sysdeps.h	2008-10-16 11:31:00.000000000 +0200
@@ -45,8 +45,8 @@
 #define NPW_VIEWER NPW_VIEWER_BASE
 #define NPW_WRAPPER_BASE "npwrapper"
 #define NPW_WRAPPER NPW_WRAPPER_BASE ".so"
-#define NPW_OLD_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" NPW_WRAPPER
-#define NPW_DEFAULT_PLUGIN_PATH NPW_LIBDIR "/" HOST_ARCH "/" HOST_OS "/" NPW_WRAPPER
+#define NPW_OLD_DEFAULT_PLUGIN_PATH LIBDIR "/" NPW_DIR "/" NPW_WRAPPER
+#define NPW_DEFAULT_PLUGIN_PATH LIBDIR "/" NPW_DIR "/" NPW_WRAPPER
 #define NPW_PLUGIN_IDENT "NPW:" NPW_VERSION
 #define NPW_PLUGIN_IDENT_SIZE 32
 typedef struct __attribute__((packed)) {
diff -up nspluginwrapper-1.1.2/src/debug.h.build nspluginwrapper-1.1.2/src/debug.h
--- nspluginwrapper-1.1.2/src/debug.h.build	2008-10-12 17:03:08.000000000 +0200
+++ nspluginwrapper-1.1.2/src/debug.h	2008-10-16 11:31:00.000000000 +0200
@@ -33,7 +33,7 @@ extern void npw_printf(const char *forma
 extern void npw_vprintf(const char *format, va_list args) attribute_hidden;
 
 #if DEBUG
-#define bug npw_dprintf
+#define bug npw_dprintf("%s:%d",__FILE__,__LINE__);npw_dprintf
 #define D(x) x
 #else
 #define D(x) ;
diff -up nspluginwrapper-1.1.2/src/npw-config.c.build nspluginwrapper-1.1.2/src/npw-config.c
--- nspluginwrapper-1.1.2/src/npw-config.c.build	2008-10-12 17:59:47.000000000 +0200
+++ nspluginwrapper-1.1.2/src/npw-config.c	2008-10-16 12:16:50.000000000 +0200
@@ -38,11 +38,15 @@
 #include <pwd.h>
 #include <dirent.h>
 
+#include <asm/types.h>
+#include "npw-dir.h"
 
 static bool g_auto = false;
 static bool g_verbose = false;
 static bool g_allow_native = false;
 static const char NPW_CONFIG[] = "nspluginwrapper";
+static char *p_plugin_dir = NULL;
+static char *p_plugin_prefix = NULL;
 
 static void error(const char *format, ...)
 {
@@ -489,81 +493,29 @@ enum {
   EXIT_VIEWER_NATIVE	= 20
 };
 
-static int detect_plugin_viewer(const char *filename, NPW_PluginInfo *out_plugin_info)
-{
-  static const char *target_arch_table[] = {
-	NULL,
-	"i386",
-	NULL
-  };
-  const int target_arch_table_size = sizeof(target_arch_table) / sizeof(target_arch_table[0]);
 
-  if (out_plugin_info && out_plugin_info->target_arch[0] != '\0')
-	target_arch_table[0] = out_plugin_info->target_arch;
-  else
-	target_arch_table[0] = NULL;
-
-  static const char *target_os_table[] = {
-	NULL,
-	"linux",
-	NULL
-  };
-  const int target_os_table_size = sizeof(target_os_table) / sizeof(target_os_table[0]);
+static int detect_plugin_viewer_fast(const char *filename, NPW_PluginInfo *out_plugin_info)
+{
+  char viewer_arch_path[PATH_MAX];
+  get_viewer_path(viewer_arch_path,PATH_MAX,out_plugin_info->target_arch);
+  if (access(viewer_arch_path, F_OK) != 0) {
+    return(EXIT_VIEWER_NOT_FOUND);
+  }
+  char viewer_path[PATH_MAX];
+  sprintf(viewer_path, "%s/%s", viewer_arch_path, NPW_VIEWER);
+  if (access(viewer_path, F_OK) != 0)
+      return(EXIT_VIEWER_NOT_FOUND);
+  return(EXIT_VIEWER_OK);
+}
 
-  if (out_plugin_info && out_plugin_info->target_os[0] != '\0')
-	target_os_table[0] = out_plugin_info->target_os;
-  else
-	target_os_table[0] = NULL;
-
-  // don't wrap plugins for host OS/ARCH
-  if (!g_allow_native
-	  && out_plugin_info
-	  && out_plugin_info->target_arch && strcmp(out_plugin_info->target_arch, HOST_ARCH) == 0
-	  && out_plugin_info->target_os && strcmp(out_plugin_info->target_os, HOST_OS) == 0)
-	return EXIT_VIEWER_NATIVE;
-
-  for (int i = 0; i < target_arch_table_size; i++) {
-	const char *target_arch = target_arch_table[i];
-	if (target_arch == NULL)
-	  continue;
-	char viewer_arch_path[PATH_MAX];
-	sprintf(viewer_arch_path, "%s/%s", NPW_LIBDIR, target_arch);
-	if (access(viewer_arch_path, F_OK) != 0) {
-	  target_arch_table[i] = NULL;		// this target ARCH is not available, skip it for good
-	  continue;
-	}
-	for (int j = 0; j < target_os_table_size; j++) {
-	  const char *target_os = target_os_table[j];
-	  if (target_os == NULL)
-		continue;
-	  char viewer_path[PATH_MAX];
-	  sprintf(viewer_path, "%s/%s/%s", viewer_arch_path, target_os, NPW_VIEWER);
-	  if (access(viewer_path, F_OK) != 0)
-		continue;
-	  int pid = fork();
-	  if (pid < 0)
-		continue;
-	  else if (pid == 0) {
-		execl(viewer_path, NPW_VIEWER, "--test", "--plugin", filename, NULL);
-		exit(1);
-	  }
-	  else {
-		int status;
-		while (waitpid(pid, &status, 0) != pid)
-		  ;
-		if (WIFEXITED(status)) {
-		  status = WEXITSTATUS(status);
-		  if (status == EXIT_VIEWER_OK && out_plugin_info) {
-			strcpy(out_plugin_info->target_arch, target_arch);
-			strcpy(out_plugin_info->target_os, target_os);
-		  }
-		  return status;
-		}
-		return EXIT_VIEWER_ERROR;
-	  }
-	}
+static int detect_plugin_viewer(const char *filename, NPW_PluginInfo *out_plugin_info)
+{
+  if(out_plugin_info && out_plugin_info->target_arch) {
+    return(detect_plugin_viewer_fast(filename, out_plugin_info));
+  } 
+  else {
+    return(EXIT_VIEWER_NOT_FOUND);
   }
-  return EXIT_VIEWER_NOT_FOUND;
 }
 
 static bool is_plugin_viewer_available(const char *filename, NPW_PluginInfo *out_plugin_info)
@@ -730,7 +682,9 @@ static int do_install_plugin(const char 
   plugin_base += 1;
 
   char d_plugin_path[PATH_MAX];
-  int n = snprintf(d_plugin_path, sizeof(d_plugin_path), "%s/%s.%s", plugin_dir, NPW_WRAPPER_BASE, plugin_base);
+  int n = snprintf(d_plugin_path, sizeof(d_plugin_path), 
+                   "%s/%s.%s", plugin_dir, p_plugin_prefix ? p_plugin_prefix : NPW_WRAPPER_BASE, 
+                   plugin_base);
   if (n < 0 || n >= sizeof(d_plugin_path))
 	return 3;
 
@@ -817,28 +771,32 @@ static int install_plugin(const char *pl
   if (g_verbose)
 	printf("Install plugin %s\n", plugin_path);
 
-  // don't install plugin system-wide if it is only accessible by root
-  if (!is_root_only_accessible_plugin(plugin_path)) {
-	ret = do_install_plugin(plugin_path, get_system_mozilla_plugin_dir(), plugin_info);
-	if (ret == 0)
-	  return 0;
+  if(p_plugin_dir) {
+	ret = do_install_plugin(plugin_path, p_plugin_dir, plugin_info);
   }
+  else {
+	// don't install plugin system-wide if it is only accessible by root
+	if (!is_root_only_accessible_plugin(plugin_path)) {
+		ret = do_install_plugin(plugin_path, get_system_mozilla_plugin_dir(), plugin_info);
+	if (ret == 0)
+	  	return 0;
+  	}
 
-  // don't install plugin in user home dir if already available system-wide
-  if (has_system_wide_wrapper_plugin(plugin_path, true)) {
-	if (g_verbose)
-	  printf(" ... already installed system-wide, skipping\n");
-	return 0;
+  	// don't install plugin in user home dir if already available system-wide
+  	if (has_system_wide_wrapper_plugin(plugin_path, true)) {
+		if (g_verbose)
+	  		printf(" ... already installed system-wide, skipping\n");
+		return 0;
+  	}
+
+  	const char *user_plugin_dir = get_user_mozilla_plugin_dir();
+  	if (access(user_plugin_dir, R_OK | W_OK) < 0 && mkdir_p(user_plugin_dir) < 0)
+		return 1;
+
+  	ret = do_install_plugin(plugin_path, user_plugin_dir, plugin_info);
+  	if (ret == 0)
+		return 0;
   }
-
-  const char *user_plugin_dir = get_user_mozilla_plugin_dir();
-  if (access(user_plugin_dir, R_OK | W_OK) < 0 && mkdir_p(user_plugin_dir) < 0)
-	return 1;
-
-  ret = do_install_plugin(plugin_path, user_plugin_dir, plugin_info);
-  if (ret == 0)
-	return 0;
-
   return ret;
 }
 
@@ -981,6 +939,8 @@ static void print_usage(void)
   printf("   -h --help               print this message\n");
   printf("   -v --verbose            flag: set verbose mode\n");
   printf("   -a --auto               flag: set automatic mode for plugins discovery\n");
+  printf("   -d --dir plugin-dir     flag: target plugin(s) directory\n");
+  printf("   -p --prefix prefix      flag: a prefix of wrapped plugin file\n");
   printf("   -n --native             flag: allow native plugin(s) to be wrapped\n");
   printf("   -l --list               list plugins currently installed\n");
   printf("   -u --update             update plugin(s) currently installed\n");
@@ -1013,6 +973,18 @@ static int process_native(int argc, char
   return 0;
 }
 
+static int process_dir(int argc, char *argv[])
+{ 
+  p_plugin_dir = argv[0];
+  return 0;
+}
+
+static int process_prefix(int argc, char *argv[])
+{ 
+  p_plugin_prefix = argv[0];
+  return 0;
+}
+
 static int process_list(int argvc, char *argv[])
 {
   const char **plugin_dirs = get_mozilla_plugin_dirs();
@@ -1068,8 +1040,6 @@ static int process_install(int argc, cha
 	  error("%s is not a valid NPAPI plugin", plugin_path);
 	ret = detect_plugin_viewer(plugin_path, &plugin_info);
 	if (ret != EXIT_VIEWER_OK) {
-	  if (ret == EXIT_VIEWER_NATIVE)
-		return 0; /* silently ignore exit status */
 	  error("no appropriate viewer found for %s", plugin_path);
 	}
 	ret = install_plugin(plugin_path, &plugin_info);
@@ -1104,57 +1074,55 @@ static int process_remove(int argc, char
 
 int main(int argc, char *argv[])
 {
-  char **args;
-  int i, j, n_args;
-
-  n_args = argc - 1;
-  args = argv + 1;
+  int i, j;
 
-  if (n_args < 1) {
+  if (argc < 2) {
 	print_usage();
 	return 1;
   }
-
-  if (args[0][0] != '-') {
-	print_usage();
-	return 1;
+  
+  if (argv[1][0] != '-') {
+  	print_usage();
+  	return 1;
   }
-
+  
   static const struct option {
-	char short_option;
-	const char *long_option;
-	int (*process_callback)(int argc, char *argv[]);
-	bool terminal;
+	const char *short_option;
+  	const char *long_option;
+  	int (*process_callback)(int argc, char *argv[]);
+  	bool terminal;
+ 	int  extra_args;
   }
   options[] = {
-	{ 'h', "help",		process_help,		1 },
-	{ 'v', "verbose",	process_verbose,	0 },
-	{ 'a', "auto",		process_auto,		0 },
-	{ 'n', "native",	process_native,		0 },
-	{ 'l', "list",		process_list,		1 },
-	{ 'u', "update",	process_update,		1 },
-	{ 'i', "install",	process_install,	1 },
-	{ 'r', "remove",	process_remove,		1 },
-	{  0,   NULL,		NULL,				1 }
-  };
-
-  for (i = 0; i < n_args; i++) {
-	const char *arg = args[i];
+	{ "-h", "--help",          process_help,           1, 0 },
+        { "-v", "--verbose",       process_verbose,        0, 0 },
+        { "-a", "--auto",          process_auto,           0, 0 },
+        { "-d", "--dir",           process_dir,            0, 1 },
+        { "-p", "--prefix",        process_prefix,         0, 1 },
+        { "-l", "--list",          process_list,           1, 0 },
+        { "-u", "--update",        process_update,         1, 0 },
+        { "-i", "--install",       process_install,        1, 0 },
+        { "-r", "--remove",        process_remove,         1, 0 }
+   };
+ 
+   for (i = 1; i < argc; i++) {
 	const struct option *opt = NULL;
-	for (j = 0; opt == NULL && options[j].process_callback != NULL; j++) {
-	  if ((arg[0] == '-' && arg[1] == options[j].short_option && arg[2] == '\0') ||
-		  (arg[0] == '-' && arg[1] == '-' && strcmp(&arg[2], options[j].long_option) == 0))
-		opt = &options[j];
-	}
-	if (opt == NULL) {
-	  fprintf(stderr, "invalid option %s\n", arg);
-	  print_usage();
-	  return 1;
-	}
-	int ret = opt->process_callback(n_args - i - 1, args + i + 1);
-	if (opt->terminal)
-	  return ret;
+ 	for (j = 0; j < sizeof(options)/sizeof(options[0]); j++) {
+ 	  if (!strcmp(options[j].short_option,argv[i]) || !strcmp(options[j].long_option,argv[i])) {
+ 	     opt = &options[j];
+        	     break;
+ 	  }
+  	}
+  	if (opt == NULL) {
+ 	  fprintf(stderr, "invalid option %s\n", argv[i]);
+  	  print_usage();
+  	  return 1;
+  	}
+ 	int ret = opt->process_callback(argc - i - 1, argv + i + 1);
+  	if (opt->terminal)
+  	  return ret;
+ 	i += opt->extra_args;
   }
-
+  
   return 0;
 }
diff -up nspluginwrapper-1.1.2/src/npw-viewer.c.build nspluginwrapper-1.1.2/src/npw-viewer.c
--- nspluginwrapper-1.1.2/src/npw-viewer.c.build	2008-10-12 17:03:08.000000000 +0200
+++ nspluginwrapper-1.1.2/src/npw-viewer.c	2008-10-16 11:31:00.000000000 +0200
@@ -54,10 +54,6 @@
 #define DEBUG 1
 #include "debug.h"
 
-
-// [UNIMPLEMENTED] Define to use XPCOM emulation
-#define USE_XPCOM 0
-
 // Define to use XEMBED
 #define USE_XEMBED 1
 
@@ -687,11 +683,14 @@ invoke_NPN_GetValue(NPP instance, NPNVar
 	return NPERR_GENERIC_ERROR;
   }
 
+  D(bug("invoke_NPN_GetValue, variable = %d\n", variable & 0xffff)); 
+
   int32_t ret;
   switch (rpc_type_of_NPNVariable(variable)) {
   case RPC_TYPE_UINT32:
 	{
 	  uint32_t n = 0;
+          D(bug("invoke_NPN_GetValue, type = uint32\n"));
 	  error = rpc_method_wait_for_reply(g_rpc_connection, RPC_TYPE_INT32, &ret, RPC_TYPE_UINT32, &n, RPC_TYPE_INVALID);
 	  if (error != RPC_ERROR_NO_ERROR) {
 		npw_perror("NPN_GetValue() wait for reply", error);
@@ -704,6 +703,7 @@ invoke_NPN_GetValue(NPP instance, NPNVar
   case RPC_TYPE_BOOLEAN:
 	{
 	  uint32_t b = 0;
+          D(bug("invoke_NPN_GetValue, type = boolean\n"));
 	  error = rpc_method_wait_for_reply(g_rpc_connection, RPC_TYPE_INT32, &ret, RPC_TYPE_BOOLEAN, &b, RPC_TYPE_INVALID);
 	  if (error != RPC_ERROR_NO_ERROR) {
 		npw_perror("NPN_GetValue() wait for reply", error);
@@ -716,6 +716,7 @@ invoke_NPN_GetValue(NPP instance, NPNVar
   case RPC_TYPE_NP_OBJECT:
 	{
 	  NPObject *npobj = NULL;
+	  D(bug("invoke_NPN_GetValue, type = object\n"));
 	  error = rpc_method_wait_for_reply(g_rpc_connection, RPC_TYPE_INT32, &ret, RPC_TYPE_NP_OBJECT, &npobj, RPC_TYPE_INVALID);
 	  if (error != RPC_ERROR_NO_ERROR) {
 		npw_perror("NPN_GetValue() wait for reply", error);
@@ -725,8 +726,12 @@ invoke_NPN_GetValue(NPP instance, NPNVar
 	  *((NPObject **)value) = npobj;
 	  break;
 	}
+  default:
+	{
+    	  npw_printf("invoke_NPN_GetValue: WARNING: unhandled type variable %d\n", variable & 0xffff);
+    	  break;
+	}
   }
-
   return ret;
 }
 
@@ -759,11 +764,19 @@ g_NPN_GetValue(NPP instance, NPNVariable
   case NPNVserviceManager: {
 	nsIServiceManager *sm;
 	int ret = NS_GetServiceManager(&sm);
-	if (NS_FAILED(ret))
+	if (NS_FAILED(ret)) {
+          npw_printf("WARNING: NS_GetServiceManager failed\n");
 	  return NPERR_GENERIC_ERROR;
+	}
 	*(nsIServiceManager **)value = sm;
 	break;
   }
+  case NPNVDOMElement:
+    	npw_printf("WARNING: NPNVDOMElement is not supported by NPN_GetValue()\n");
+    	return NPERR_INVALID_PARAM;
+  case NPNVDOMWindow:
+    	npw_printf("WARNING: NPNVDOMWindow is not supported by NPN_GetValue()\n");
+	return NPERR_INVALID_PARAM;
 #endif
   case NPNVnetscapeWindow: {
 	PluginInstance *plugin = PLUGIN_INSTANCE(instance);
@@ -787,12 +800,13 @@ g_NPN_GetValue(NPP instance, NPNVariable
   case NPNVWindowNPObject:
   case NPNVPluginElementNPObject: {
 	int ret = invoke_NPN_GetValue(instance, variable, value);
-	if (ret == NPERR_NO_ERROR)
-	  return ret;
-	// fall-through
+	if(ret != NPERR_NO_ERROR)
+          npw_printf("WARNING: error %d returner for %d from NPN_GetValue()\n", ret, variable & 0xffff);
+        return ret;
+	
   }
   default:
-	npw_printf("WARNING: unhandled variable %d in NPN_GetValue()\n", variable);
+	npw_printf("WARNING: unhandled variable %d in NPN_GetValue()\n", variable & 0xffff);
 	return NPERR_INVALID_PARAM;
   }
 


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/F-9/.cvsignore,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- .cvsignore	8 Jul 2008 14:54:18 -0000	1.8
+++ .cvsignore	16 Oct 2008 11:52:53 -0000	1.9
@@ -5,3 +5,4 @@
 plugin-config-1.6.tar.gz
 plugin-config-1.9.tar.gz
 nspluginwrapper-1.1.0.tar.bz2
+nspluginwrapper-1.1.2.tar.bz2


Index: nspluginwrapper.spec
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/F-9/nspluginwrapper.spec,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- nspluginwrapper.spec	5 Oct 2008 14:27:50 -0000	1.57
+++ nspluginwrapper.spec	16 Oct 2008 11:52:54 -0000	1.58
@@ -14,7 +14,7 @@
 %define plugin_config_binary plugin-config
 
 # Excluded plugins (separated by ':')
-%define exclude_list 		"libtotem*:libjavaplugin*:gecko-mediaplayer*:mplayerplug-in*"
+%define exclude_list 		"libtotem*:libjavaplugin*:gecko-mediaplayer*:mplayerplug-in*:librhythmbox*"
 
 # Target defines
 %if "%{_target_cpu}" == "i386"
@@ -69,18 +69,17 @@
 
 Summary:	A compatibility layer for Netscape 4 plugins
 Name:		nspluginwrapper
-Version:	1.1.0
-Release:	10%{?dist}
+Version:	1.1.2
+Release:	1%{?dist}
 Source0:	%{name}-%{version}%{?svndate:-%{svndate}}.tar.bz2
 Source1:        %{plugin_config_name}.tar.gz 
 Source2:        plugin-config.sh.in
 Source3:        %{name}.sh.in
-Patch1:         nspluginwrapper-1.1.0-build.patch
+Patch1:         nspluginwrapper-1.1.2-build.patch
 Patch2:         nspluginwrapper-1.1.0-runtime-restart.patch
 Patch3:         nspluginwrapper-1.1.0-fork.patch
 Patch4:         nspluginwrapper-0.9.91.5-shutdown.patch
 Patch5:         nspluginwrapper-0.9.91.5-sleep.patch
-Patch6:         nspluginwrapper-1.1.0-visual-id.patch
 Patch100:       plugin-config-setuid.patch
 License:	GPLv2+
 Group:		Networking/WWW
@@ -110,7 +109,6 @@
 %patch3 -p1 -b .fork
 %patch4 -p1 -b .shutdown
 %patch5 -p1 -b .sleep
-%patch6 -p1 -b .visual_id
 
 pushd %plugin_config_name
 %patch100 -p2
@@ -241,6 +239,11 @@
 %config %{_sysconfdir}/sysconfig/%{name}
 
 %changelog
+* Thu Oct 16 2008 Martin Stransky <stransky at redhat.com> 1.1.2-1
+- updated to 1.1.12
+- added librhythmbox* to ignored plugins (#467187)
+- removed debug prints (#467090)
+
 * Fri Oct 03 2008 Warren Togami <wtogami at redhat.com> 1.1.0-10
 - Revert libcurl requires because it was done in an incorrect way
 - Revert patch from -7 because it made things worse


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/nspluginwrapper/F-9/sources,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- sources	8 Jul 2008 14:54:18 -0000	1.10
+++ sources	16 Oct 2008 11:52:54 -0000	1.11
@@ -1,2 +1,2 @@
 0a00e94ba608dfea365851af9deb20dc  plugin-config-1.9.tar.gz
-42d043f1b91cc311410c20f36665c6b3  nspluginwrapper-1.1.0.tar.bz2
+b381adcd7627b4680d081ab2f5823111  nspluginwrapper-1.1.2.tar.bz2


--- nspluginwrapper-1.1.0-build.patch DELETED ---


--- nspluginwrapper-1.1.0-visual-id.patch DELETED ---




More information about the fedora-extras-commits mailing list