File opera-extras.spec of Package opera-extras

#
# spec file for package opera-extras
#
# Copyright (c) 2025 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 https://bugs.opensuse.org/
#


%global debug_package           %{nil}
%global __strip                "%{_bindir}/true"

%define source_name             nwjs-ffmpeg-prebuilt
%define platform                linux
%define architecture            x64

# Specify RELEASE CHANNEL:
%define release_channel         stable
#
# REQUIRES OPERA STABLE VERSION:
%define opera_version           129.0.5823.15
#
# REQUIRES CHROMIUM OLD-STABLE/STABLE VERSION:
%define opera_chromium_version  145.0.7632.117
#
# REQUIRES CHROMIUM MAJOR VERSION TO BE THE SAME:
%define ffmpeg_chromium_version 145.0.7632.76
#
# NOTE:
# Opera Chromium builds for Linux are built on top of EXTENDED / STABLE Chromium versions for Windows; more at:
# https://chromiumdash.appspot.com/releases?platform=Windows | https://chromiumdash.appspot.com/releases?platform=Linux
# Chromium source code commit: https://chromium.googlesource.com/chromium/src/+/4c03e725fa2c140a1606dad6fef5158687287c83
# NWJS Chromium versions: https://nwjs.io/versions.json
#

Name:           opera-extras
Version:        0.108.0
Release:        0
Summary:        Full-featured proprietary DRM playback support for Opera One and Chromium
License:        NonFree
URL:            https://chromium.googlesource.com/chromium/third_party/ffmpeg/
Source0:        https://github.com/%{source_name}/%{source_name}/releases/download/%{version}/%{version}-%{platform}-%{architecture}.zip#/%{name}-%{version}.zip
Source1:        COPYING
Source2:        LEGAL.html
Source3:        LICENSE

BuildRequires:  unzip

%if            "%{_vendor}" == "debbuild"
Requires:       opera-stable

%else
Requires:       (opera or opera-stable)

%endif

ExclusiveArch:  x86_64

%if            "%{_vendor}" == "debbuild"
Packager:       Martin Stibor <martin.von.reichenberg@proton.me>
Group:          Networking
%endif

%description
This PRE-BUILT BINARY codec/library enables proprietary video playback on Opera One
and other Chromium-based web browsers.

FFmpeg is a collection of libraries and tools to process multimedia content such as audio,
video, subtitles and related metadata.

FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux,
stream, filter and play pretty much anything that humans and machines have created.
It supports the most obscure ancient formats up to the cutting edge.
No matter if they were designed by some standards committee, the community or a corporation.
It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE
across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of
build environments, machine architectures, and configurations.

%prep
cp -a  %{_sourcedir}/* -t %{_builddir}/

unzip "%{_builddir}/%{name}-%{version}.zip" -d %{_builddir}/%{name}-%{version}/

%build
#
# Nothing to BUILD - This library is pre-compiled
#

%install
install -Dm755 "%{_builddir}/%{name}-%{version}/libffmpeg.so" -t "%{buildroot}/%{_libdir}/opera-%{release_channel}/lib_extra/"

%files
%license LICENSE "LEGAL.html" COPYING

%dir "%{_libdir}/opera-%{release_channel}/"
%dir "%{_libdir}/opera-%{release_channel}/lib_extra/"
     "%{_libdir}/opera-%{release_channel}/lib_extra/libffmpeg.so"

%changelog
openSUSE Build Service is sponsored by