File steam.spec of Package steam

#
# spec file for package steam
#
# Copyright (c) 2024 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/
#


%define dependency() \
%ifarch %{ix86} \
Requires: %{1} \
%else \
Requires: %{1}-32bit \
%endif \
%{nil}
%define booldependency() \
%ifarch x86_64 \
Requires: (%{1}-32bit if %{1}) \
%endif \
%{nil}
%define nvidia_dependency() \
%ifarch x86_64 \
%booldependency %{1}G04 \
%booldependency %{1}G05 \
%booldependency %{1}G06 \
%endif \
%{nil}
Name:           steam
Version:        1.0.0.79
Release:        0
Summary:        Installer for Valve's digital software distribution service
# "Limited Installation License"
License:        SUSE-Freeware
Group:          Amusements/Games/Other
URL:            https://www.steampowered.com/
Source0:        https://repo.steampowered.com/steam/pool/steam/s/steam/steam_%{version}.tar.gz
Source2:        %{name}-streaming.xml
# PATCH-FIX-OPENSUSE steam-path-fix.patch bnc#1025841
Patch0:         steam-path-fix.patch
Patch1:         gpu-offload.patch
BuildRequires:  fdupes
BuildRequires:  firewall-macros
BuildRequires:  hicolor-icon-theme
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
# from steamdeps.txt which uses Debian package syntax
Requires:       curl
Requires:       libz.so.1
# for Steam Hardware Survey
Requires:       lsb-release
Requires:       openal-soft
# Proton Requirements
Requires:       python3
Requires:       tar
Requires:       xz
Requires:       zenity
Recommends:     bubblewrap
ExclusiveArch:  %{ix86} x86_64
%nvidia_dependency x11-video-nvidia
%nvidia_dependency nvidia-compute
%nvidia_dependency nvidia-gl
%booldependency  Mesa-libGL1
%booldependency  libvulkan_intel
%booldependency  libvulkan_radeon
%dependency  libvulkan1
%dependency  dbus-1-glib
%dependency  gtk2-engine-oxygen
%dependency  libSDL-1_2-0
%dependency  libX11-6
%dependency  libXdmcp6
%dependency  libXext6
%dependency  libXfixes3
%dependency  libXi6
%dependency  libXrandr2
%dependency  libXrender1
%dependency  libatk-1_0-0
%dependency  libcairo2
%dependency  libcurl4
%dependency  libdbus-1-3
%dependency  libfreetype6
%dependency  libgcrypt20
%dependency  libgdk_pixbuf-2_0-0
%dependency  libglib-2_0-0
%dependency  libgmodule-2_0-0
%dependency  libgobject-2_0-0
%dependency  libgtk-2_0-0
%dependency  libogg0
%dependency  libpango-1_0-0
%dependency  libpixman-1-0
%dependency  libpng12-0
%dependency  libpulse0
%dependency  libtheora0
%dependency  libvorbis0
%dependency  mozilla-nspr
%dependency  mozilla-nss
%dependency  libcups2
%dependency  fontconfig
%dependency  glibc
%dependency  libgcc_s1
%dependency  libopenal1
%dependency  libstdc++6
%dependency  libcrypt1
%dependency  glibc-locale-base
%dependency  libudev1
%dependency  libxcb-dri2-0
%dependency  libxcb-glx0
%dependency  libdrm2
%dependency  libXtst6
%dependency  libva2
%dependency  libva-drm2
%dependency  libva-x11-2
%dependency  libva-glx2
%dependency  libvdpau1
%dependency  libICE6
%dependency  libSM6
%dependency  libusb-1_0-0
%booldependency  libgbm1
%if 0%{?suse_version} >= 1550
%booldependency  libnm0
%endif
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150300
%dependency  libpipewire-0_3-0
%endif

%description
Steam is a software distribution service with an online store, automated
installation, automatic updates, achievements, SteamCloud synchronized
savegame and screenshot functionality, and many social features.

This package will fetch and install the Steam bootstrap. Start Steam to
complete the installation of the client for the current user.

%prep
%setup -q -n steam-launcher
%if 0%{?suse_version} < 1550
%patch0 -p1
%endif
%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150400
%patch1 -p1
%endif


%build
true

%install
make DESTDIR=%{buildroot} install-bin install-docs install-icons install-bootstrap install-desktop install-appdata

%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
install -Dm0644 %{SOURCE2} %{buildroot}%{_prefix}/lib/firewalld/services/steam-streaming.xml
%endif
find %{buildroot} -type f -exec sed -i 's|#!%{_bindir}/env |#!%{_bindir}/|g' {} \;
# Remove steamdeps as it is apt specific
rm -f %{buildroot}%{_bindir}/%{name}deps

%fdupes -s %{buildroot}

%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
%post
%firewalld_reload
%endif

%files
%{_bindir}/*
%{_prefix}/lib/%{name}
%{_datadir}/pixmaps/%{name}_tray_mono.png
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/apps/%{name}.png
%dir %{_datadir}/doc/%{name}
%doc %{_datadir}/doc/%{name}/steam_subscriber_agreement.txt
%doc %{_datadir}/doc/%{name}/README
%doc debian/changelog
%{_mandir}/man6/%{name}.6%{?ext_man}
%{_datadir}/metainfo/*
%if 0%{?suse_version} < 1550 && 0%{?sle_version} < 150300
%dir %{_prefix}/lib/firewalld
%dir %{_prefix}/lib/firewalld/services
%{_prefix}/lib/firewalld/services/steam-streaming.xml
%endif

%changelog
openSUSE Build Service is sponsored by