File freshplayerplugin.spec of Package freshplayerplugin

# spec file for package freshplayerplugin
# Copyright (c) 2020 SUSE LLC
# 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

%bcond_with restricted
Name:           freshplayerplugin
Version:        0.3.11
Release:        0
Summary:        PPAPI2NPAPI compatibility layer
License:        MIT
Group:          Productivity/Networking/Web/Browsers
# PATCH-FIX-OPENSUSE freshplayerplugin-drop-angle.patch bsc#937244
Patch0:         freshplayerplugin-drop-angle.patch
# PATCH-FIX-UPSTREAM freshplayerplugin-fix-no-hwdec.patch -- Fix compilation with no hardware acceleration.
Patch1:         freshplayerplugin-fix-no-hwdec.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  pkgconfig
BuildRequires:  ragel-6
BuildRequires:  pkgconfig(alsa)
BuildRequires:  pkgconfig(cairo)
BuildRequires:  pkgconfig(freetype2)
BuildRequires:  pkgconfig(gio-2.0)
BuildRequires:  pkgconfig(gl)
BuildRequires:  pkgconfig(glesv2)
BuildRequires:  pkgconfig(glib-2.0)
BuildRequires:  pkgconfig(icu-uc)
BuildRequires:  pkgconfig(jack)
BuildRequires:  pkgconfig(libdrm)
BuildRequires:  pkgconfig(libevent)
BuildRequires:  pkgconfig(libevent_pthreads)
BuildRequires:  pkgconfig(libpulse)
BuildRequires:  pkgconfig(libv4l2)
BuildRequires:  pkgconfig(openssl)
BuildRequires:  pkgconfig(pango)
BuildRequires:  pkgconfig(pangocairo)
BuildRequires:  pkgconfig(pangoft2)
BuildRequires:  pkgconfig(soxr)
BuildRequires:  pkgconfig(x11)
BuildRequires:  pkgconfig(xcursor)
BuildRequires:  pkgconfig(xrandr)
BuildRequires:  pkgconfig(xrender)
Supplements:    (browser(npapi) and flash-player-ppapi)
Conflicts:      flash-player
%if 0%{with restricted}
# Hardware accelerated decoding.
BuildRequires:  pkgconfig(libavcodec)
BuildRequires:  pkgconfig(libavutil)
BuildRequires:  pkgconfig(libva)
BuildRequires:  pkgconfig(libva-x11)
BuildRequires:  pkgconfig(vdpau)
Requires:       flash-player-ppapi
Provides:       flash-plugin
Recommends:     flash-player-ppapi
%ifarch armv6l || armv6hl
BuildRequires:  Mesa-libEGL-devel
BuildRequires:  Mesa-libEGL1
BuildRequires:  Mesa-libGLESv1_CM-devel
BuildRequires:  Mesa-libGLESv1_CM1
BuildRequires:  Mesa-libGLESv2-2
BuildRequires:  Mesa-libGLESv2-devel

The main goal of this project is to get PPAPI (Pepper) Flash player
working in Firefox. This wrapper implements some kind of adapter
which will look like browser to PPAPI plugin and look like NPAPI
plugin for browser.

%autosetup -p1

# Enable hardware accelerated decoding for PMBS.
%if %{with restricted}
sed -i 's|^\(enable_hwdec = \)0|\11|' data/freshwrapper.conf.example

%cmake \
  -DMOZPLUGIN_INSTALL_DIR=%{_libdir}/browser-plugins \
%if %{with restricted}

install -Dpm 0644 data/freshwrapper.conf.example \

# A tweak for Plasma 5.
if [ ! -f "%{_bindir}/plasmashell" ]; then
    sed -i 's|^\(quirk_plasma5_screensaver = \)0$|\11|' %{_sysconfdir}/freshwrapper.conf

%postun -p /sbin/ldconfig

%doc ChangeLog
%config %{_sysconfdir}/freshwrapper.conf