[nspluginwrapper/f16] Sync with rawhide

Martin Stransky stransky at fedoraproject.org
Mon Aug 13 14:51:15 UTC 2012


commit 6201031bbd2443761c76e398169e71181a43e84c
Author: Martin Stransky <stransky at redhat.com>
Date:   Mon Aug 13 16:50:18 2012 +0200

    Sync with rawhide
    
    * Mon Aug 13 2012 Martin Stransky <stransky at redhat.com> 1.4.4-11
    - Fixed bug #841798 - don't wrap plugins with the same arch
    
    * Wed Jul 18 2012 Martin Stransky <stransky at redhat.com> 1.4.4-10
    - Restart workaround for Adobe Reader plugin (rhbz#645599)
    
    * Tue May 15 2012 Peter Robinson <pbrobinson at fedoraproject.org> 1.4.4-9
    - Enable building on ARM, add patch to detect CPU

 nspluginwrapper-1.4.4-restart.patch |   77 +++++++++++++++++++++++++++++++++++
 nspluginwrapper-arm.patch           |   13 ++++++
 nspluginwrapper.spec                |   50 ++++++++++++++++-------
 plugin-config-native.patch          |   11 -----
 plugin-config-non-native.patch      |   16 +++++++
 5 files changed, 141 insertions(+), 26 deletions(-)
---
diff --git a/nspluginwrapper-1.4.4-restart.patch b/nspluginwrapper-1.4.4-restart.patch
new file mode 100644
index 0000000..e8fba47
--- /dev/null
+++ b/nspluginwrapper-1.4.4-restart.patch
@@ -0,0 +1,77 @@
+diff -up nspluginwrapper-1.4.4/src/npw-wrapper.c.restart nspluginwrapper-1.4.4/src/npw-wrapper.c
+--- nspluginwrapper-1.4.4/src/npw-wrapper.c.restart	2011-07-01 05:18:57.000000000 +0200
++++ nspluginwrapper-1.4.4/src/npw-wrapper.c	2012-07-18 15:49:11.329877655 +0200
+@@ -115,6 +115,7 @@ static void plugin_exit(void);
+ static void plugin_kill_cb(rpc_connection_t *connection, void *user_data);
+ static NPError plugin_start(void);
+ static NPError plugin_start_if_needed(void);
++static void plugin_kill(void);
+ static int plugin_killed = 0;
+ 
+ /*
+@@ -2104,31 +2105,44 @@ g_NPP_New(NPMIMEType mime_type, NPP inst
+ 		  uint16_t mode, int16_t argc, char *argn[], char *argv[],
+ 		  NPSavedData *saved)
+ {
++  NPError ret;
++  int attempt = 1;
++
+   if (instance == NULL)
+ 	return NPERR_INVALID_INSTANCE_ERROR;
+-	
+-  // Check if we need to restart the plug-in
+-  NPError ret = plugin_start_if_needed();
+-  if (ret != NPERR_NO_ERROR)
+-  	return ret;
+ 
+-  PluginInstance *plugin = npw_plugin_instance_new(&PluginInstanceClass);
+-  if (plugin == NULL)
+-	return NPERR_OUT_OF_MEMORY_ERROR;
+-  plugin->instance = instance;
+-  plugin->instance_id = id_create(plugin);
+-  plugin->connection = rpc_connection_ref(g_rpc_connection);
+-  instance->pdata = plugin;
++  do {
++    // Check if we need to restart the plug-in
++    NPError ret = plugin_start_if_needed();
++    if (ret != NPERR_NO_ERROR)
++      return ret;
++
++    PluginInstance *plugin = npw_plugin_instance_new(&PluginInstanceClass);
++    if (plugin == NULL)
++      return NPERR_OUT_OF_MEMORY_ERROR;
++    plugin->instance = instance;
++    plugin->instance_id = id_create(plugin);
++    plugin->connection = rpc_connection_ref(g_rpc_connection);
++    instance->pdata = plugin;
++
++    if (PLUGIN_DIRECT_EXEC) {
++      if ((plugin->native_instance = NPW_MemNew0(NPP_t, 1)) == NULL)
++        return NPERR_OUT_OF_MEMORY_ERROR;
++      plugin->native_instance->ndata = instance->ndata;
++    }
++
++    D(bugiI("NPP_New instance=%p\n", instance));
++    ret = invoke_NPP_New(plugin, mime_type, mode, argc, argn, argv, saved);
++    D(bugiD("NPP_New return: %d [%s]\n", ret, string_of_NPError(ret)));
++
++    // NPP_New was succesfull or we exhausted all our restart attempts
++    if(!ret || attempt == 0)
++      break;
+ 
+-  if (PLUGIN_DIRECT_EXEC) {
+-	if ((plugin->native_instance = NPW_MemNew0(NPP_t, 1)) == NULL)
+-	  return NPERR_OUT_OF_MEMORY_ERROR;
+-	plugin->native_instance->ndata = instance->ndata;
+-  }
+-
+-  D(bugiI("NPP_New instance=%p\n", instance));
+-  ret = invoke_NPP_New(plugin, mime_type, mode, argc, argn, argv, saved);
+-  D(bugiD("NPP_New return: %d [%s]\n", ret, string_of_NPError(ret)));
++    // kill the plugin
++    plugin_kill();
++    attempt--;
++  } while(1);
+ 
+   if (saved) {
+ 	if (saved->buf)
diff --git a/nspluginwrapper-arm.patch b/nspluginwrapper-arm.patch
new file mode 100644
index 0000000..020055a
--- /dev/null
+++ b/nspluginwrapper-arm.patch
@@ -0,0 +1,13 @@
+--- nspluginwrapper-1.4.4/configure.orig	2011-06-30 23:18:57.000000000 -0400
++++ nspluginwrapper-1.4.4/configure	2012-05-14 15:01:01.000000000 -0400
+@@ -985,6 +985,10 @@
+     echo "TARGET_ARCH=ppc" >> $config_mak
+     echo "#define TARGET_ARCH \"ppc\"" >> $config_h
+     echo "#define TARGET_PPC 1" >> $config_h
++elif test "$target_cpu" = "arm" ; then
++    echo "TARGET_ARCH=arm" >> $config_mak
++    echo "#define TARGET_ARCH \"arm\"" >> $config_h
++    echo "#define TARGET_ARM 1" >> $config_h
+ else
+     echo "Unsupported target CPU"
+     exit 1
diff --git a/nspluginwrapper.spec b/nspluginwrapper.spec
index 97c9d7f..30b1022 100644
--- a/nspluginwrapper.spec
+++ b/nspluginwrapper.spec
@@ -30,6 +30,14 @@
 %define target_bits	32
 %endif
 
+%if "%{_target_cpu}" == "armv5tel"
+%define target_bits	32
+%endif
+
+%if "%{_target_cpu}" == "armv7hl"
+%define target_bits	32
+%endif
+
 %if "%{_target_cpu}" == "x86_64"
 %define target_bits	64
 %endif
@@ -75,7 +83,12 @@
 Summary:	A compatibility layer for Netscape 4 plugins
 Name:		nspluginwrapper
 Version:	1.4.4
-Release:	8%{?dist}
+Release:	11%{?dist}
+License:	GPLv2+
+Group:		Applications/Internet
+Url:		http://gwenole.beauchesne.info/projects/nspluginwrapper/
+ExclusiveArch:	%{ix86} x86_64 ppc %{arm}
+
 Source0:	http://gwenole.beauchesne.info/projects/nspluginwrapper/files/%{name}-%{version}%{?svndate:-%{svndate}}.tar.gz
 Source1:	%{plugin_config_name}.tar.gz
 Source2:	plugin-config.sh.in
@@ -86,21 +99,19 @@ Patch6:		nspluginwrapper-1.3.0-compiz.patch
 Patch7:		nspluginwrapper-1.3.0-comp.patch
 Patch9:		nspluginwrapper-1.3.0-timeout.patch
 Patch10:	nspluginwrapper-pthread.patch
+Patch11:	nspluginwrapper-arm.patch
+Patch12:	nspluginwrapper-1.4.4-restart.patch
 Patch100:	plugin-config-setuid.patch
 Patch101:	plugin-config-umask.patch
 Patch102:	plugin-config-print.patch
-Patch103:	plugin-config-native.patch
+Patch103:	plugin-config-non-native.patch
 Patch104:	plugin-config-time-check.patch
-License:	GPLv2+
-Group:		Applications/Internet
-Url:		http://gwenole.beauchesne.info/projects/nspluginwrapper/
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
+
 Provides:	%{name} = %{version}-%{release}
 Requires:	mozilla-filesystem
 BuildRequires:	pkgconfig gtk2-devel glib2-devel nspr-devel
 BuildRequires:	libX11-devel libXt-devel cairo-devel pango-devel libcurl-devel
 BuildRequires:	gecko-devel
-ExclusiveArch:	%{ix86} x86_64 ppc
 
 %description
 nspluginwrapper makes it possible to use Netscape 4 compatible plugins
@@ -125,14 +136,15 @@ This package consists in:
 THREAD_LIBS=`pkg-config --libs gthread-2.0`
 sed -e "s/__PTHREAD_LIBS__/$THREAD_LIBS/" %{P:%%PATCH10} > pthread.patch
 %{__patch} -p1 -b --suffix .version --fuzz=0 < pthread.patch
-
+%patch11 -p1 -b .arm
+%patch12 -p1 -b .restart
 
 # Plugin-config patches
 pushd %plugin_config_name
 %patch100 -p2
 %patch101 -p2 -b .umask
 %patch102 -p2 -b .print
-%patch103 -p2 -b .native
+%patch103 -p2 -b .non-native
 %patch104 -p2 -b .time
 popd
 
@@ -151,11 +163,15 @@ popd
 %endif
 
 # set the propper built options
+%ifnarch %{arm}
 %if "%{target_bits}" == "64"
     export LDFLAGS="-m64 -L%{libdir64} -ldl" 
 %else
     export LDFLAGS="-m32 -L%{libdir32} -ldl"
 %endif
+%else
+    export LDFLAGS="-L%{libdir32} -ldl"
+%endif
 
 mkdir %{build_dir}
 pushd %{build_dir}
@@ -180,8 +196,6 @@ make
 popd
 
 %install
-rm -rf $RPM_BUILD_ROOT
-
 mkdir -p $RPM_BUILD_ROOT%{_bindir}
 mkdir -p $RPM_BUILD_ROOT%{plugindir}
 mkdir -p $RPM_BUILD_ROOT%{pluginsourcedir}
@@ -210,7 +224,7 @@ cat %{SOURCE3} | %{__sed} -e "s|EXCLUDE_LIST|%{exclude_list}|g" \
 chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/%{name}
 
 # set up nsplugin player starting script
-%{__cat} > $RPM_BUILD_ROOT%{pkgdir}/nspluginplayer << EOF
+cat > $RPM_BUILD_ROOT%{pkgdir}/nspluginplayer << EOF
 export MOZ_PLUGIN_PATH=%{pluginsourcedir}
 %{pkgdir}/npplayer "\$@"
 EOF
@@ -220,9 +234,6 @@ chmod 755 $RPM_BUILD_ROOT%{pkgdir}/nspluginplayer
 rm -rf $RPM_BUILD_ROOT%{_bindir}/nspluginplayer
 rm -rf $RPM_BUILD_ROOT%{_bindir}/nspluginwrapper
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %post
 /usr/bin/mozilla-plugin-config -i -f > /dev/null 2>&1 || :
 
@@ -252,6 +263,15 @@ fi;
 
 
 %changelog
+* Mon Aug 13 2012 Martin Stransky <stransky at redhat.com> 1.4.4-11
+- Fixed bug #841798 - don't wrap plugins with the same arch
+
+* Wed Jul 18 2012 Martin Stransky <stransky at redhat.com> 1.4.4-10
+- Restart workaround for Adobe Reader plugin (rhbz#645599)
+
+* Tue May 15 2012 Peter Robinson <pbrobinson at fedoraproject.org> 1.4.4-9
+- Enable building on ARM, add patch to detect CPU
+
 * Mon May 7 2012 Martin Stransky <stransky at redhat.com> 1.4.4-8
 - fixed crash in nspluginplayer script (#819479)
 
diff --git a/plugin-config-non-native.patch b/plugin-config-non-native.patch
new file mode 100644
index 0000000..24b9ea5
--- /dev/null
+++ b/plugin-config-non-native.patch
@@ -0,0 +1,16 @@
+diff -up nspluginwrapper-1.4.4/plugin-config-1.9/src/plugin-config.c.non-native nspluginwrapper-1.4.4/plugin-config-1.9/src/plugin-config.c
+--- nspluginwrapper-1.4.4/plugin-config-1.9/src/plugin-config.c.non-native	2012-08-13 15:33:19.000000000 +0200
++++ nspluginwrapper-1.4.4/plugin-config-1.9/src/plugin-config.c	2012-08-13 15:37:02.660811240 +0200
+@@ -373,12 +373,6 @@ int get_wrap_config(WRAP_PLUGIN *p_plugi
+ {
+   int wrap = FALSE;
+ 
+-  if(p_plugin->t_bits == BITS_32 && p_plugin->s_bits == p_plugin->t_bits) {
+-    wrap = cfg.wrapper_32b;
+-  }
+-  if(p_plugin->t_bits == BITS_64 && p_plugin->s_bits == p_plugin->t_bits) {
+-    wrap = cfg.wrapper_64b;
+-  }
+   if(p_plugin->t_bits == BITS_64 && p_plugin->s_bits == BITS_32) {
+     wrap = cfg.wrapper_64b && cfg.wrapper_32b;
+   }   


More information about the scm-commits mailing list