Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 9f4a785799562ccf60cf1fe14b281226 > files > 5

nspluginwrapper-1.4.4-1.mga1.src.rpm

# NOTE: this is a Linux-specific package, don't use the embedded
# viewer on non-Linux platforms.
%define name	nspluginwrapper
%define version	1.4.4
%define release	%mkrel 1

#%%define _provides_exceptions xpcom

# list of plugins to be wrapped by default ex: libflashplayer,nppdf
%define nspw_plugins flashplayer,nppdf,rpnp,nphelix

# define 32-bit arch of multiarch platforms
%define arch_32 %{nil}
%ifarch x86_64
%define arch_32 i386
%endif

# define to build a biarch package
%define build_biarch		0
%if "%{_arch}:%{arch_32}" == "x86_64:i386"
%define build_biarch		1
%endif

%{expand: %{?_with_biarch:	%%global build_biarch 1}}
%{expand: %{?_without_biarch:	%%global build_biarch 0}}

# define target architecture of plugins we want to support
%define target_arch i386

# define target operating system of plugins we want to support
%define target_os linux

# define nspluginswrapper libdir (invariant, including libdir)
%define pkglibdir %{_prefix}/lib/%{name}

# define mozilla plugin dir
%define plugindir %{_libdir}/mozilla/plugins

Summary:	A compatibility layer for Netscape 4 plugins
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	GPLv2+
Group:		Networking/WWW
URL:		http://nspluginwrapper.davidben.net/
Source0:	http://nspluginwrapper.davidben.net/download/nspluginwrapper-%{version}.tar.gz
Source1:	nspluginwrapper.filter
Source2:	nspluginwrapper.script
Source3:	update-nspluginwrapper
Patch7:         nspluginwrapper-enable-v4l1compat.patch

BuildRequires:	curl-devel
BuildRequires:	gtk+2-devel
BuildRequires:	libxt-devel
Provides:	%{name}-%{_arch} = %{version}-%{release}
Requires(post):	 %{name}-%{target_arch} = %{version}-%{release}
Requires(preun): %{name}-%{target_arch} = %{version}-%{release}
ExcludeArch:	%mips %arm

%description
nspluginwrapper makes it possible to use Netscape 4 compatible plugins
compiled for %{target_os}/%{target_arch} into Mozilla for another architecture, e.g. x86_64.

This package consists in:
  * npviewer: the plugin viewer
  * npwrapper.so: the browser-side plugin
  * nspluginwrapper: a tool to manage plugins installation and update

%if %{build_biarch}
%package %{target_arch}
Summary:	A viewer for %{target_os}/%{target_arch} compiled Netscape 4 plugins
Group:		Networking/WWW
%if "%{target_arch}" == "i386"
Requires:	linux32
# Flash 10 now requires 32 bit libcurl, libnss3.so 
# but Adobe's RPM package does not require them...
# http://blogs.adobe.com/penguin.swf/2008/08/curl_tradeoffs.html
Suggests:       libcurl.so.4
Suggests:	libnss3.so
%endif

%description %{target_arch}
nspluginwrapper makes it possible to use Netscape 4 compatible plugins
compiled for %{target_os}/%{target_arch} into Mozilla for another architecture,
e.g. x86_64.

This package consists in:
  * npviewer: the plugin viewer
  * npwrapper.so: the browser-side plugin
  * nspluginwrapper: a tool to manage plugins installation and update

This package provides the npviewer program for %{target_os}/%{target_arch}.
%endif

%prep

%setup -q
%apply_patches

%build
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS"

%if %{build_biarch}
biarch="--enable-biarch"
%else
biarch="--disable-biarch"
%endif
mkdir objs
pushd objs
../configure \
	--prefix=%{_prefix} \
	--target-cpu=%{target_arch} \
	--enable-viewer \
	$biarch \
	--target-os=linux --disable-strip
%make
popd

%install
rm -rf %{buildroot}

make -C objs install DESTDIR=%{buildroot}

mkdir -p %{buildroot}%{plugindir}
mkdir -p %{buildroot}%{_sbindir}
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/nspluginwrapper

touch %{buildroot}%{_sysconfdir}/sysconfig/nspluginwrapper

ln -s %{pkglibdir}/%{_arch}/%{_os}/npwrapper.so %{buildroot}%{plugindir}/npwrapper.so

install -d -m 0755 %{buildroot}%{_var}/lib/rpm/filetriggers
install -m 0644 %{SOURCE1} %{buildroot}%{_var}/lib/rpm/filetriggers
install -m 0755 %{SOURCE2} %{buildroot}%{_var}/lib/rpm/filetriggers
install -m 0755 %{SOURCE3} %{buildroot}%{_sbindir}

%clean
rm -rf %{buildroot}

%post
if [ $1 = 1 ]; then
  %{_bindir}/%{name} -v -a -i
else
  %{_bindir}/%{name} -v -a -u
    if [ -f /usr/lib/mozilla/plugins/libflashplayer.so ] && [ ! -f %{plugindir}/npwrapper.libflashplayer.so ]; then
      %{_bindir}/%{name} -v -i /usr/lib/mozilla/plugins/libflashplayer.so
    fi
fi
if [ ! -f %{_sysconfdir}/sysconfig/nspluginwrapper ]; then
    cat > %{_sysconfdir}/sysconfig/nspluginwrapper <<EOF
USE_NSPLUGINWRAPPER=yes
MGA_PLUGINS="%{nspw_plugins}"
USER_PLUGINS=""
EOF
else
    sed -i "s/MGA_PLUGINS=.*/MGA_PLUGINS=\"%{nspw_plugins}\"/" \
        %{_sysconfdir}/sysconfig/nspluginwrapper
fi

%preun
if [ $1 = 0 ]; then
  %{_bindir}/%{name} -v -a -r
fi

# Flash Player
%triggerin -- flash-plugin
if [ -f %{plugindir}/npwrapper.libflashplayer.so ]; then
  %{_bindir}/%{name} -v -u %{plugindir}/npwrapper.libflashplayer.so
else
  %{_bindir}/%{name} -v -i /usr/lib/flash-plugin/libflashplayer.so
fi

%triggerpostun -- flash-plugin
if [ ! -f /usr/lib/flash-plugin/libflashplayer.so ]; then
  %{_bindir}/%{name} -v -r %{plugindir}/npwrapper.libflashplayer.so
fi

# Acrobat Reader
%triggerin -- acroread5-nppdf, acroread-nppdf
if [ -f %{plugindir}/npwrapper.nppdf.so ]; then
  %{_bindir}/%{name} -v -u %{plugindir}/npwrapper.nppdf.so
else
  %{_bindir}/%{name} -v -i /usr/lib/mozilla/plugins/nppdf.so
fi

%triggerpostun -- acroread5-nppdf, acroread-nppdf
if [ ! -f /usr/lib/mozilla/plugins/nppdf.so ]; then
  %{_bindir}/%{name} -v -r %{plugindir}/npwrapper.nppdf.so
fi

# Real Player 8
%triggerin -- RealPlayer-rpnp < 10
if [ -f %{plugindir}/npwrapper.rpnp.so ]; then
  %{_bindir}/%{name} -v -u %{plugindir}/npwrapper.rpnp.so
else
  %{_bindir}/%{name} -v -i /usr/lib/mozilla/plugins/rpnp.so
fi

%triggerpostun -- RealPlayer-rpnp < 10
if [ ! -f /usr/lib/mozilla/plugins/rpnp.so ]; then
  %{_bindir}/%{name} -v -r %{plugindir}/npwrapper.rpnp.so
fi

# Real Player 10
%triggerin -- RealPlayer-rpnp >= 10
if [ -f %{plugindir}/npwrapper.nphelix.so ]; then
  %{_bindir}/%{name} -v -u %{plugindir}/npwrapper.nphelix.so
else
  %{_bindir}/%{name} -v -i /usr/lib/mozilla/plugins/nphelix.so
fi

%triggerpostun -- RealPlayer-rpnp >= 10
if [ ! -f /usr/lib/mozilla/plugins/nphelix.so ]; then
  %{_bindir}/%{name} -v -r %{plugindir}/npwrapper.nphelix.so
fi

%files
%doc NEWS README TODO
%{_bindir}/%{name}
%{_bindir}/nspluginplayer
%{_sbindir}/update-nspluginwrapper
%ghost %{_sysconfdir}/sysconfig/nspluginwrapper
%{plugindir}/npwrapper.so
%dir %{pkglibdir}
%dir %{pkglibdir}/noarch
%{pkglibdir}/noarch/npviewer.sh
%dir %{pkglibdir}/%{_arch}
%dir %{pkglibdir}/%{_arch}/%{_os}
%{pkglibdir}/%{_arch}/%{_os}/npconfig
%if ! %{build_biarch}
%{pkglibdir}/%{_arch}/%{_os}/npviewer
%{pkglibdir}/%{_arch}/%{_os}/npviewer.bin
# %{pkglibdir}/%{_arch}/%{_os}/libxpcom.so
%{pkglibdir}/%{_arch}/%{_os}/libnoxshm.so
%endif
%{pkglibdir}/%{_arch}/%{_os}/npplayer
%{pkglibdir}/%{_arch}/%{_os}/npwrapper.so
%{_var}/lib/rpm/filetriggers/nspluginwrapper.*

%if %{build_biarch}
%files %{target_arch}
%dir %{pkglibdir}/%{target_arch}
%dir %{pkglibdir}/%{target_arch}/%{target_os}
%{pkglibdir}/%{target_arch}/%{target_os}/npviewer
%{pkglibdir}/%{target_arch}/%{target_os}/npviewer.bin
# %{pkglibdir}/%{target_arch}/%{target_os}/libxpcom.so
%{pkglibdir}/%{target_arch}/%{target_os}/libnoxshm.so
%endif


%changelog

* Fri Nov 16 2012 luigiwalser <luigiwalser> 1.4.4-1.mga1
+ Revision: 318940
- sync 1.4.4 from mga2 to fix CVE-2011-2486
- add upstream patch to fix CVE-2011-2486

* Mon Apr 04 2011 tv <tv> 1.3.0-7.mga1
+ Revision: 80560
- clean up
- imported package nspluginwrapper