[nspluginwrapper/f17] Enable building on ARM, add patch to detect CPU

Peter Robinson pbrobinson at fedoraproject.org
Tue May 15 07:23:08 UTC 2012


commit e851765cb6ba1f96c57506a9a3931add352734bc
Author: Peter Robinson <pbrobinson at gmail.com>
Date:   Tue May 15 07:56:11 2012 +0100

    Enable building on ARM, add patch to detect CPU

 nspluginwrapper-arm.patch |   13 +++++++++++++
 nspluginwrapper.spec      |   38 +++++++++++++++++++++++++-------------
 2 files changed, 38 insertions(+), 13 deletions(-)
---
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..f5b9ab2 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:	9%{?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,18 @@ 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
 Patch100:	plugin-config-setuid.patch
 Patch101:	plugin-config-umask.patch
 Patch102:	plugin-config-print.patch
 Patch103:	plugin-config-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,7 +135,7 @@ 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
 
 # Plugin-config patches
 pushd %plugin_config_name
@@ -151,11 +161,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 +194,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 +222,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 +232,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 +261,9 @@ fi;
 
 
 %changelog
+* 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)
 


More information about the scm-commits mailing list