File opera-gx.spec of Package opera-gx
# spec file for package opera-gx
#
# Copyright (c) 2026 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 __provides_exclude_from ^%{_libdir}/opera-gx/.*\\.so.*$
# libffmpeg.so*, libfreetype.so* and libGLESv2.so* are currently bundled.
%global __requires_exclude ^lib(ffmpeg|freetype|GLESv2)\\.so.*$
Name: opera-gx
Version: 128.0.5807.97
Release: 0
Summary: Proprietary gaming web browser
License: NonFree
Group: Productivity/Networking/Web/Browsers
URL: https://opera.com/gx
Source: opera-gx-stable_%{version}_amd64.rpm
Source1: opera-gx.sh.in
Source2: com.opera.opera-gx.appdata.xml
# https://legal.opera.com/eula/computers/eula.html
Source3: eula.html
BuildRequires: fdupes
BuildRequires: hicolor-icon-theme
BuildRequires: xz
Recommends: ffmpeg
ExclusiveArch: x86_64
%description
Opera GX is a special version of the Opera browser built specifically to
complement gaming. It includes unique features like CPU, RAM and Network
limiters, Twitch integration, Razer Chroma support, and a gaming-inspired
design.
%prep
rpm2cpio %{SOURCE0} | cpio -i -d
cp -f %{SOURCE2} com.opera.opera-gx.appdata.xml
cp -f %{SOURCE3} eula.html
# Find the actual opera-gx directory (it might be opera, opera-gx, etc.)
OPERADIR=$(find .%{_libdir} -maxdepth 1 -type d -name "*opera*" | head -n1)
if [ -n "$OPERADIR" ]; then
echo "Found Opera directory: $OPERADIR"
# Rename to opera-gx if it's different
if [ "$OPERADIR" != ".%{_libdir}/opera-gx" ]; then
mv "$OPERADIR" .%{_libdir}/opera-gx
fi
else
echo "Error: Opera GX directory not found"
exit 1
fi
# Fix sandbox permissions
find .%{_libdir}/opera-gx -name "*sandbox*" -type f -exec chmod -s {} \; 2>/dev/null || true
# Fix desktop file - find any opera desktop file
DESKTOP_FILE=$(find .%{_datadir}/applications -name "*opera*.desktop" | head -n1)
if [ -n "$DESKTOP_FILE" ]; then
sed -i 's/^\(TargetEnvironment\)/X-\1/' "$DESKTOP_FILE"
# Rename to opera-gx.desktop if needed
if [ "$(basename "$DESKTOP_FILE")" != "opera-gx.desktop" ]; then
mv "$DESKTOP_FILE" .%{_datadir}/applications/opera-gx.desktop
fi
fi
# Create wrapper script from template
sed \
-e 's|__LIBDIR__|%{_libdir}|g' \
-e 's|__SYSCONFDIR__|%{_sysconfdir}|g' \
%{SOURCE1} > opera-gx.sh
cat > opera-gx.conf << EOF
# Default settings for opera-gx. This file is sourced by /usr/bin/opera-gx.
# Options to pass to opera-gx.
OPERA_GX_FLAGS=""
EOF
%build
# Nothing to build.
%install
mkdir -p %{buildroot}%{_libdir}/
# Check if opera-gx directory exists
if [ -d .%{_libdir}/opera-gx ]; then
cp -a .%{_libdir}/opera-gx %{buildroot}%{_libdir}/opera-gx
else
echo "Error: opera-gx directory not found in build root"
exit 1
fi
install -Dpm 0755 opera-gx.sh %{buildroot}%{_bindir}/opera-gx
# Install desktop file
DESKTOP_FILE=$(find .%{_datadir}/applications -name "*opera*.desktop" | head -n1)
if [ -n "$DESKTOP_FILE" ]; then
install -Dpm 0644 "$DESKTOP_FILE" \
%{buildroot}%{_datadir}/applications/com.opera.opera-gx.desktop
fi
# Install icons
if [ -d .%{_datadir}/icons/ ]; then
cp -a .%{_datadir}/icons/ %{buildroot}%{_datadir}/
fi
install -Dpm 0644 opera-gx.conf %{buildroot}%{_sysconfdir}/default/opera-gx
# https://en.opensuse.org/openSUSE:AppStore
install -Dpm 0644 com.opera.opera-gx.appdata.xml \
%{buildroot}%{_datadir}/metainfo/com.opera.opera-gx.appdata.xml
# Remove non-executable-script setup_repo.sh -- we do not want to create a repo
rm -f %{buildroot}%{_libdir}/opera-gx/setup_repo.sh
%fdupes %{buildroot}%{_libdir}/
%files
%license eula.html
%config(noreplace) %{_sysconfdir}/default/opera-gx
%{_bindir}/opera-gx
%{_libdir}/opera-gx/
%{_datadir}/applications/com.opera.opera-gx.desktop
%{_datadir}/icons/hicolor/*/apps/*
%dir %{_datadir}/metainfo/
%{_datadir}/metainfo/com.opera.opera-gx.appdata.xml
%changelog
* Sun Mar 22 2026 Alex S.Shubin aka Sylar <renard.corp@hotmail.com> - 128.0.5807.97-0
- Initial package for Opera GX