Sophie

Sophie

distrib > Mageia > 3 > i586 > by-pkgid > be8f631a9ac57247e724763d035b1703 > files > 9

nspluginwrapper-1.4.4-4.mga3.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 4

#%%define _provides_exceptions xpcom

# list of plugins to be wrapped by default ex: libflashplayer,nppdf
# these are wrapped by default on 32->64 use only
%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
# fixes build, submitted:
# https://github.com/davidben/nspluginwrapper/issues/43
Patch8:		nspluginwrapper-glib-includes.patch
# from upstream, fixes build
Patch9:		nspluginwrapper-link-dl.patch
# fixes build, similar patch submitted upstream:
# https://www.redhat.com/archives/nspluginwrapper-devel-list/2011-November/msg00000.html
Patch10:	nspluginwrapper-link-gthread.patch
# (tv) fix build with newer glib:
Patch11:		nspluginwrapper-glib-thread.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"
# 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 $RPM_BUILD_ROOT

make -C objs install DESTDIR=$RPM_BUILD_ROOT

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

touch $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/nspluginwrapper

ln -s %{pkglibdir}/%{_arch}/%{_os}/npwrapper.so $RPM_BUILD_ROOT%{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 $RPM_BUILD_ROOT

%post
if [ ! -f %{_sysconfdir}/sysconfig/nspluginwrapper ]; then
    cat > %{_sysconfdir}/sysconfig/nspluginwrapper <<EOF
USE_NSPLUGINWRAPPER=yes
MGA_PLUGINS="%{nspw_plugins}"
USER_PLUGINS=""
EOF
else
    if ! grep -q ^MGA_PLUGINS= %{_sysconfdir}/sysconfig/nspluginwrapper; then
        echo "MGA_PLUGINS=\"%{nspw_plugins}\"" >> %{_sysconfdir}/sysconfig/nspluginwrapper
    else
        sed -i "s/MGA_PLUGINS=.*/MGA_PLUGINS=\"%{nspw_plugins}\"/" \
            %{_sysconfdir}/sysconfig/nspluginwrapper
    fi
fi

%{_var}/lib/rpm/filetriggers/nspluginwrapper.script || :

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

# Only use for these when on 64-bit
%if %{build_biarch}

# 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

%endif

%files
%defattr(-,root,root)
%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}
%defattr(-,root,root)
%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

* Wed Oct 24 2012 tv <tv> 1.4.4-4.mga3
+ Revision: 309536
- patch 11: fix build with newer glib
- loseteup requires is dup

  + anssi <anssi>
    - fix build (link-gthread.patch, link-dl.patch, glib-includes.patch)
    - use nspluginwrapper.script in %%post instead of wrapping all plugins
      which conflicts with nspluginwrapper.script
    - fix use of MDV_PLUGINS in nspluginwrapper.script
    - fix %%post in case of non-existing $MGA_PLUGINS in
      /etc/sysconfig/nspluginwrapper
    - do not try to wrap 64-bit plugins as we don't build 64-bit npviewer
    - do not try to wrap 32-bit plugins on 32-bit systems as the browsers
      nowadays support running plugins in dedicated processes themselves

* Thu Sep 08 2011 tv <tv> 1.4.4-1.mga2
+ Revision: 141190
- new release
- fix source URL
- fix %%setup call
- use %%setup -c
- new release

* Wed Jun 15 2011 ahmad <ahmad> 1.4.2-1.mga2
+ Revision: 106372
- Update to 1.4.2
- Change the url(s) to the new upstream website
- Drop the old sparc and ppc bits (we don't have them at all now)
- Drop patch0,8 ; note needed any more
- Drop the buildroot declaration
- Adapt to the new configure options, and use disable-strip instread of touching
  config-host.mak
- Nit: S/MDV_PLUGINS/MGA_PLUGINS/
- Drop some old/unneeded Flash Player triggers
- Update the file list (no more xpcom, until upstream supports it)

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