File nspluginwrapper.spec of Package nspluginwrapper

#
# spec file for package nspluginwrapper
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           nspluginwrapper
Version:        1.4.4.0.15
Release:        0.2
Group:          Productivity/Networking/Web/Utilities
Summary:        Compatibility Layer for Netscape 4 Plug-Ins
License:        GPLv2+
Url:            http://nspluginwrapper.org/
#Source:         %{name}-%{version}.tar.bz2
Source:         %{name}-git6bd99e4.tar.bz2
Patch1:         makefile-glibs-evergreen112.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  curl-devel glib2-devel gtk2-devel
BuildRequires:  gcc-c++
%ifarch x86_64
BuildRequires:  libstdc++44 glibc-devel
BuildRequires:  libstdc++44-32bit
BuildRequires:  libstdc++44-devel-32bit
BuildRequires:  glibc-devel-32bit
BuildRequires:  gcc-32bit
%endif
ExcludeArch:    s390 s390x
Supplements:    acroread flash-player
# Name of platform split package, never used in openSUSE:
Provides:       %{name}-%{_arch} = %{version}-%{release}
# Name of platform split package, used in openSUSE BS before 11.0:
Provides:       %{name}-i386 = %{version}-%{release}
Obsoletes:      %{name}-i386

%description
nspluginwrapper is an Open Source compatibility plugin for Netscape 4
(NPAPI) plugins. It enables you to use plugins on platforms they were
not built for. For example, you can use the plugins compiled for i386
in Mozilla on Linux/x86_64 or other architectures. This package
consists of:

* npviewer: the plug-in viewer

* npwrapper.so: the browser-side plug-in

* nspluginwrapper: a tool to manage plug-ins installation and update



Authors:
--------
    Gwenole Beauchesne <gb.public@free.fr>
    David Benjamin <davidben@mit.edu>

%prep
#%setup -q
%setup -q -n %{name}

%if 0%{?suse_version} <= 1120
%patch1 -p1
%endif

%build
# This package failed when testing with -Wl,-as-needed being default.
# So we disable it here, if you want to retest, just delete this comment and the line below.
export SUSE_ASNEEDED=0
#
# TODO:
# There are three ways to compile 32 bit stuff. Decide, what is better:
# 1) As is: Use stub libraries from stub_libs.
# 2) Create gtk2-devel-32bit and all needed stuff and cross compile
#    using cross-compilation-headers.
# 3) Let 32-bit platform compile it, then use -32bit package.
#
%ifarch x86_64
# FIXME: more undefined references to `__stack_chk_fail' follow
# More correct would be probably adding stack checking code to
# lsb-build/stub_libs/libc_main.c
export CFLAGS_32="-m32 ${RPM_OPT_FLAGS/-fstack-protector}"
%endif
export CFLAGS="${CFLAGS:-%optflags}"
./configure\
	--prefix=%{_prefix}
#sed -i "s/CC=.*/& $RPM_OPT_FLAGS/" config-host.mak
make %{?jobs:-j%jobs}

%install
%makeinstall DONT_STRIP=yes
mkdir -p $RPM_BUILD_ROOT%{_libdir}/browser-plugins
ln -s %{_prefix}/lib/%{name}/%{_arch}/%{_os}/npwrapper.so $RPM_BUILD_ROOT%{_libdir}/browser-plugins/npwrapper.so

%clean
rm -rf $RPM_BUILD_ROOT
# Trigger on packages that don't have x86_64 equivalent or its
# equivalent has less features.
# mplayerplug-in is a common name of third party package that may be
# affected, too.

%triggerin -- RealPlayer acroread acroread_ja flash-player mplayerplug-in
# suppress "wrong ELF class" messages
%ifarch %ix86
%{_bindir}/%{name} -a -i -n 2>&1 | grep -v "wrong ELF class" >&2 || :
%else
%{_bindir}/%{name} -a -i 2>&1 | grep -v "wrong ELF class" >&2 || :
%endif

%triggerpostun -- RealPlayer acroread acroread_ja flash-player mplayerplug-in
# suppress "wrong ELF class" messages
%ifarch %ix86
%{_bindir}/%{name} -a -u -n 2>&1 | grep -v "wrong ELF class" >&2 || :
%else
%{_bindir}/%{name} -a -u 2>&1 | grep -v "wrong ELF class" >&2 || :
%endif

%post
# suppress "wrong ELF class" messages
%ifarch %ix86
%{_bindir}/%{name} -a -i -n 2>&1 | grep -v "wrong ELF class" >&2 || :
%else
%{_bindir}/%{name} -a -i 2>&1 | grep -v "wrong ELF class" >&2 || :
%endif

%preun
if [ $1 = 0 ]; then
# suppress "wrong ELF class" messages
%ifarch %ix86
  %{_bindir}/%{name} -a -r -n 2>&1 | grep -v "wrong ELF class" >&2 || :
%else
  %{_bindir}/%{name} -a -r 2>&1 | grep -v "wrong ELF class" >&2 || :
%endif
fi

%files
%defattr(-,root,root)
%doc ChangeLog.pre-1-4 COPYING NEWS README TODO
%{_bindir}/nspluginplayer
%{_bindir}/%{name}
%{_libdir}/browser-plugins/npwrapper.so
%{_prefix}/lib/%{name}

%changelog
openSUSE Build Service is sponsored by