File steam-install+run.patch of Package steam

--- old/Makefile	2025-04-24 11:56:50.000000000 +0200
+++ new/Makefile	2025-05-11 19:10:23.791215006 +0200
@@ -1,79 +1,179 @@
 #! /bin/make -f
 
+#
+#########################
+#
+
+# Define VARIABLES of this Makefile
+#NAME        = Steam
+PACKAGE      = steam
+PACKAGE_ID   = com.valvesoftware.Steam
+PREFIX      ?= /usr/
+bindir       = $(PREFIX)/bin/
+#bindir     == /usr/bin/
+datadir      = $(PREFIX)/share/
+#datadir    == /usr/share/
+docdir       = $(datadir)/doc/
+#docdir     == /usr/share/doc/
+libdir       = $(PREFIX)/lib/
+#libdir     == /usr/lib/
+mandir       = $(datadir)/man/
+#mandir     == /usr/share/man/
+metainfodir  = $(datadir)/metainfo/
+#metainfodir ==/usr/share/metainfo/
+pkglibdir    = $(libdir)/$(PACKAGE)/
+#pkglibdir  == /usr/lib/steam/
+udevrulesdir = $(libdir)/udev/rules.d/
+#udevrulesdir==/usr/lib/udev/rules.d/
+PYTHON      ?= python3
+#
+
+#
+#########################
+#
+
+# Install all the essential files from SOURCE to SYSTEM
 all:
-	@echo 'Run steam with "./steam" or install it with "sudo make install"'
+	@echo "Run Steam with `./steam` or install it with `sudo make install`"
 
-install: install-bin install-docs install-icons install-bootstrap install-desktop install-appdata install-apt-source
+install:  install-bin  install-docs  install-icons  install-bootstrap  install-desktop  install-appdata  install-udev-rules  install-apt-source
 
 install-bin:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/bin/
-	install -d -m 755 $(DESTDIR)$(pkglibdir)/steam_launcher/
-	install -p -m 755 bin_steam.sh $(DESTDIR)$(pkglibdir)/
-	install -p -m 755 bin_steamdeps.py $(DESTDIR)$(pkglibdir)/
-	install -p -m 644 steam_launcher/__init__.py $(DESTDIR)$(pkglibdir)/steam_launcher/
-	install -p -m 644 steam_launcher/launcherutils.py $(DESTDIR)$(pkglibdir)/steam_launcher/
-	ln -fns $(pkglibdir)/bin_steam.sh $(DESTDIR)$(bindir)/$(PACKAGE)
-	ln -fns $(pkglibdir)/bin_steamdeps.py $(DESTDIR)$(bindir)/$(PACKAGE)deps
-
+	# Use install -Dpm to create directories and install files in one step
+	install -Dpm755 bin_$(PACKAGE).sh                    -t $(DESTDIR)/$(pkglibdir)/
+	install -d      $(DESTDIR)/$(bindir)/
+	ln      -fns    $(pkglibdir)/bin_$(PACKAGE).sh          $(DESTDIR)/$(bindir)/$(PACKAGE)
+	install -Dpm755 bin_steamdeps.py                     -t $(DESTDIR)/$(pkglibdir)/
+	# Create `steamdeps` SYMLINK only on Debian-based distributions
+	if [ -f /etc/debian_version ]; then \
+		ln -fns $(pkglibdir)/bin_steamdeps.py $(DESTDIR)/$(bindir)/steamdeps; \
+	fi
+	install -Dpm644 $(PACKAGE)_launcher/__init__.py      -t $(DESTDIR)/$(pkglibdir)/$(PACKAGE)_launcher/
+	install -Dpm644 $(PACKAGE)_launcher/launcherutils.py -t $(DESTDIR)/$(pkglibdir)/$(PACKAGE)_launcher/
+	#
 install-docs:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/doc/$(PACKAGE)/
-	install -p -m 644 README steam_subscriber_agreement.txt $(DESTDIR)$(PREFIX)/share/doc/$(PACKAGE)/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/man/man6/
-	install -m 644 $(PACKAGE).6 $(DESTDIR)$(PREFIX)/share/man/man6/
-
+	# Combine directory creation and file installation
+	# Only for DEB-Based Linux Distributions as RPM-Based Linux Distributions handle this via RPM .SPEC file
+	if [ -f /etc/debian_version ]; then \
+		install -Dpm644 debian/changelog                    -t $(DESTDIR)/$(docdir)/$(PACKAGE)/; \
+		install -Dpm644 README                              -t $(DESTDIR)/$(docdir)/$(PACKAGE)/; \
+		install -Dpm644 $(PACKAGE)_subscriber_agreement.txt -t $(DESTDIR)/$(docdir)/$(PACKAGE)/; \
+	fi
+	install -Dpm644 $(PACKAGE).6                                -t $(DESTDIR)/$(mandir)/man6/
+	#
 install-icons:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
-	install -p -m 644 icons/16/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/
-	install -p -m 644 icons/24/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/icons/hicolor/24x24/apps/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
-	install -p -m 644 icons/256/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/
-	install -p -m 644 icons/32/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/icons/hicolor/32x32/apps/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
-	install -p -m 644 icons/48/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/pixmaps/
-	install -p -m 644 icons/48/$(PACKAGE).png $(DESTDIR)$(PREFIX)/share/pixmaps/
-	install -p -m 644 icons/48/steam_tray_mono.png $(DESTDIR)$(PREFIX)/share/pixmaps/$(PACKAGE)_tray_mono.png
-
+	# Install icons to various HiColor and PixMaps directories
+	install -Dpm644 icons/16/$(PACKAGE).png           -t $(DESTDIR)/$(PREFIX)/share/icons/hicolor/16x16/apps/
+	install -Dpm644 icons/24/$(PACKAGE).png           -t $(DESTDIR)/$(PREFIX)/share/icons/hicolor/24x24/apps/
+	install -Dpm644 icons/32/$(PACKAGE).png           -t $(DESTDIR)/$(PREFIX)/share/icons/hicolor/32x32/apps/
+	install -Dpm644 icons/48/$(PACKAGE).png           -t $(DESTDIR)/$(PREFIX)/share/icons/hicolor/48x48/apps/
+	install -Dpm644 icons/256/$(PACKAGE).png          -t $(DESTDIR)/$(PREFIX)/share/icons/hicolor/256x256/apps/
+	install -Dpm644 icons/48/$(PACKAGE).png           -t $(DESTDIR)/$(PREFIX)/share/pixmaps/
+	install -Dpm644 icons/48/$(PACKAGE)_tray_mono.png -t $(DESTDIR)/$(PREFIX)/share/pixmaps/
+	#
 install-bootstrap:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/lib/$(PACKAGE)/
-	install -p -m 644 bootstraplinux_ubuntu12_32.tar.xz $(DESTDIR)$(PREFIX)/lib/$(PACKAGE)/
-
+	# Install bootstrap archive containing LAUNCH Scripts and BINARIES
+	install -Dpm644 bootstraplinux_ubuntu12_32.tar.xz -t $(DESTDIR)/$(PREFIX)/lib/$(PACKAGE)/
+	#
 install-desktop:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/applications/
-	install -d -m 755 $(DESTDIR)$(pkglibdir)/
-	# If we create a desktop symlink in $(datadir)/applications/, the md5sum deb file
-	# will not contain an entry for it and appstream-generator will complain that
-	# the package is missing the desktop file. Instead we place the real file in
-	# $(datadir)/applications/ and create a symlink in $(pkglibdir)
-	install -p -m 644 $(PACKAGE).desktop $(DESTDIR)$(datadir)/applications/
-	ln -fns $(datadir)/applications/$(PACKAGE).desktop $(DESTDIR)$(pkglibdir)/
-
+	# Install desktop file and create SYMLINK back to Steam DATA location
+	install -Dpm644 $(PACKAGE).desktop                         -t $(DESTDIR)/$(datadir)/applications/
+	install -d      $(DESTDIR)/$(pkglibdir)/
+	ln      -fns    $(datadir)/applications/$(PACKAGE).desktop -t $(DESTDIR)/$(pkglibdir)/
+	#
 install-appdata:
-	install -d -m 755 $(DESTDIR)$(PREFIX)/share/metainfo/
-	install -p -m 644 $(PACKAGE_ID).metainfo.xml $(DESTDIR)$(PREFIX)/share/metainfo/
-
+	# Install AppStream Metadata file
+	install -Dpm644 $(PACKAGE_ID).metainfo.xml -t $(DESTDIR)/$(metainfodir)/
+	#
+install-udev-rules:
+	# Install Steam Devices uDev Rules
+	install -Dpm644 subprojects/$(PACKAGE)-devices/60-$(PACKAGE)-input.rules \
+	        -t      $(DESTDIR)/$(udevrulesdir)/
+	install -Dpm644 subprojects/$(PACKAGE)-devices/60-$(PACKAGE)-vr.rules \
+	        -t      $(DESTDIR)/$(udevrulesdir)/
+	#
+# For DEB-Based Linux Distributions only
 install-apt-source:
 	if [ -d /etc/apt ]; then \
-		install -d -m 755 $(DESTDIR)/etc/apt/sources.list.d/; \
-		install -p -m 644 steam-stable.list $(DESTDIR)/etc/apt/sources.list.d/; \
-		install -p -m 644 steam-beta.list $(DESTDIR)/etc/apt/sources.list.d/; \
-		install -d -m 755 $(DESTDIR)/usr/share/keyrings/; \
-		install -p -m 644 steam.gpg $(DESTDIR)/usr/share/keyrings/; \
+		install -Dpm644 $(PACKAGE)-stable.list -t $(DESTDIR)/etc/apt/sources.list.d/; \
+		install -Dpm644 $(PACKAGE)-beta.list   -t $(DESTDIR)/etc/apt/sources.list.d/; \
+		install -Dpm644 $(PACKAGE).gpg         -t $(DESTDIR)/usr/share/keyrings/; \
 	fi
+#
+#
 
+#
 #########################
+#
 
-PACKAGE=steam
-PACKAGE_ID=com.valvesoftware.Steam
-PREFIX?=/usr
-bindir = $(PREFIX)/bin
-datadir = $(PREFIX)/share
-pkglibdir = $(PREFIX)/lib/$(PACKAGE)
-PYTHON ?= python3
+# Uninstall all files installed to SYSTEM
+uninstall:  uninstall-bin  uninstall-docs  uninstall-icons  uninstall-bootstrap  uninstall-desktop  uninstall-appdata  uninstall-udev-rules  uninstall-apt-source
+	# Attempt to remove Steam-specific directories if empty
+	-rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(pkglibdir)/$(PACKAGE)_launcher
+	-rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(pkglibdir)
+	-rmdir --ignore-fail-on-non-empty $(DESTDIR)/$(docdir)/$(PACKAGE)
+	#
+uninstall-bin:
+	# Remove binaries and symbolic links
+	rm -f $(DESTDIR)/$(pkglibdir)/bin_$(PACKAGE).sh
+	rm -f $(DESTDIR)/$(bindir)/$(PACKAGE)
+	rm -f $(DESTDIR)/$(pkglibdir)/bin_steamdeps.py
+	# Remove `steamdeps` SYMLINK only on Debian-based distributions
+	if [ -f /etc/debian_version ]; then \
+		rm -f $(DESTDIR)/$(bindir)/steamdeps; \
+	fi
+	rm -f $(DESTDIR)/$(pkglibdir)/$(PACKAGE)_launcher/__init__.py
+	rm -f $(DESTDIR)/$(pkglibdir)/$(PACKAGE)_launcher/launcherutils.py
+	#
+uninstall-docs:
+	# Remove documentation and man pages
+	rm -f $(DESTDIR)/$(docdir)/$(PACKAGE)/README
+	rm -f $(DESTDIR)/$(docdir)/$(PACKAGE)/steam_subscriber_agreement.txt
+	rm -f $(DESTDIR)/$(mandir)/man6/$(PACKAGE).6*
+	#
+uninstall-icons:
+	# Remove icons from HiColor and PixMaps directories
+	rm -f $(DESTDIR)/$(PREFIX)/share/icons/hicolor/16x16/apps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/icons/hicolor/24x24/apps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/icons/hicolor/32x32/apps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/icons/hicolor/48x48/apps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/icons/hicolor/256x256/apps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/pixmaps/$(PACKAGE).png
+	rm -f $(DESTDIR)/$(PREFIX)/share/pixmaps/$(PACKAGE)_tray_mono.png
+	#
+uninstall-bootstrap:
+	# Remove bootstrap archive
+	rm -f $(DESTDIR)/$(pkglibdir)/bootstraplinux_ubuntu12_32.tar.xz
+	#
+uninstall-desktop:
+	# Remove desktop file and symbolic link
+	rm -f $(DESTDIR)/$(datadir)/applications/$(PACKAGE).desktop
+	rm -f $(DESTDIR)/$(pkglibdir)/$(PACKAGE).desktop
+	#
+uninstall-appdata:
+	# Remove AppStream Metadata file
+	rm -f $(DESTDIR)/$(metainfodir)/$(PACKAGE_ID).metainfo.xml
+	#
+uninstall-udev-rules:
+	# Uninstall Steam Devices uDev Rules
+	rm -f $(DESTDIR)/$(udevrulesdir)/60-$(PACKAGE)-input.rules
+	rm -f $(DESTDIR)/$(udevrulesdir)/60-$(PACKAGE)-vr.rules
+	#
+# For DEB-Based Linux Distributions only
+uninstall-apt-source:
+	# Remove APT source files if /etc/apt exists
+	if [ -d /etc/apt ]; then \
+		rm -f $(DESTDIR)/etc/apt/sources.list.d/$(PACKAGE)-stable.list; \
+		rm -f $(DESTDIR)/etc/apt/sources.list.d/$(PACKAGE)-beta.list; \
+		rm -f $(DESTDIR)/usr/share/keyrings/$(PACKAGE).gpg; \
+	fi
+	#
+#
+#########################
+#
 
-.PHONY: all install install-bin install-docs install-icons install-bootstrap install-desktop install-appdata install-apt-source
+.PHONY: all  install  install-bin  install-docs  install-icons  install-bootstrap  install-desktop  install-appdata  install-udev-rules  install-apt-source \
+        uninstall  uninstall-bin  uninstall-docs  uninstall-icons  uninstall-bootstrap  uninstall-desktop  uninstall-appdata  uninstall-udev-rules  uninstall-apt-source
 
 check:
 	prove -v tests/*.sh
@@ -82,5 +182,5 @@
 clean:
 	rm -fr .mypy_cache
 	rm -fr buildutils/__pycache__
-	rm -fr steam-launcher/__pycache__
+	rm -fr $(PACKAGE)-launcher/__pycache__
 .PHONY: clean


--- old/bin_steam.sh	2025-04-24 12:04:15.000000000 +0200
+++ new/bin_steam.sh	2025-05-11 11:26:33.166669749 +0200
@@ -311,3 +311,19 @@
 cd "$LAUNCHSTEAMDIR"
 
 exec "$LAUNCHSTEAMDIR/$STEAMBOOTSTRAP" ${log_opened+-srt-logger-opened} "$@"
+
+
+# Improved interactions between the Steam runtime and host distribution
+# libraries, which should let Steam work out of the box with open-source
+# graphics drivers on modern distributions. If using an older distribution or
+# running into problems, set variable at 0 to revert to the previous behavior.
+export STEAM_RUNTIME_PREFER_HOST_LIBRARIES=1
+
+# Unify close-to-tray behavior with other platforms. If using a distribution
+# that doesn't have proper compatible tray support set variable at 0.
+export STEAM_FRAME_FORCE_CLOSE=1
+
+# Do not minimize main Steam window after losing focus (i.e. exiting a game in
+# Steam Remote Play.
+# https://github.com/ValveSoftware/steam-for-linux/issues/4611
+export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0
openSUSE Build Service is sponsored by