From 41d9c982e535b64ee3910ae26d5f1c6b08448ae24924bfdd3e778337055aed03 Mon Sep 17 00:00:00 2001 From: Dirk Stoecker Date: Fri, 18 May 2018 17:04:59 +0000 Subject: [PATCH] Accepting request 607695 from home:theMarix:Games I would like to add to and maintain the gamemode package in Factory and use games:tools as a development project. I am aware that this package is currently not suited for inclusion in Factory as is, as it contains two suppressed lintian errors: 1. It adds a D-Bus service 2. It adds a new Polkit rule Both of these will require audit bugs to be filed to the security team which I plan to do once the package is in games:tools. OBS-URL: https://build.opensuse.org/request/show/607695 OBS-URL: https://build.opensuse.org/package/show/games:tools/gamemode?expand=0&rev=1 --- .gitattributes | 23 ++++++++ .gitignore | 1 + README.openSUSE | 20 +++++++ _service | 15 ++++++ _servicedata | 4 ++ gamemode-1.1.tar.xz | 3 ++ gamemode-rpmlintrc | 9 ++++ gamemode.changes | 28 ++++++++++ gamemode.spec | 129 ++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 232 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 README.openSUSE create mode 100644 _service create mode 100644 _servicedata create mode 100644 gamemode-1.1.tar.xz create mode 100644 gamemode-rpmlintrc create mode 100644 gamemode.changes create mode 100644 gamemode.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/README.openSUSE b/README.openSUSE new file mode 100644 index 0000000..1923fa1 --- /dev/null +++ b/README.openSUSE @@ -0,0 +1,20 @@ +Launching the GameMode Daemon +============================= + +The GameMode daemon is configured as a D-Bus daemon and will launch +automatically on access by the first client. This is different from the set-up +documented in the source repository which requires the user to enable and start +a Systemd unit shipped with the daemon. + +Reloading the GameMode configuration file +========================================= + +As the daemon is started as a D-Bus service no explicit reload command is +available. To force the daemon to reload the configuration it must be stopped +for which there are two main options. + +1. Logout of your current session. +2. Request the daemon to exit by running `killall gamemoded`. + +On next use the daemon will be restarted by D-Bus and read any updated +configuration. diff --git a/_service b/_service new file mode 100644 index 0000000..cbf6e24 --- /dev/null +++ b/_service @@ -0,0 +1,15 @@ + + + https://github.com/FeralInteractive/gamemode.git + git + 1.1 + @PARENT_TAG@ + enable + + + + *.tar + xz + + + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..0fc8ea5 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/FeralInteractive/gamemode.git + 8b9f4b9ac8bb1ac97c2f4e769da17315c4658503 \ No newline at end of file diff --git a/gamemode-1.1.tar.xz b/gamemode-1.1.tar.xz new file mode 100644 index 0000000..2b50aea --- /dev/null +++ b/gamemode-1.1.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df5d3b214dea66f5260f3d86049227857c6622b1ee23969463c0ece4b35e67a1 +size 35160 diff --git a/gamemode-rpmlintrc b/gamemode-rpmlintrc new file mode 100644 index 0000000..85b3424 --- /dev/null +++ b/gamemode-rpmlintrc @@ -0,0 +1,9 @@ +# The PolicyKit priviledge escalation is desired. It does not make sense to open a bug for this while not requesting Factory inclusion, yet. +addFilter('gamemoded.* polkit-unauthorized-privilege.*') +setBadness('polkit-unauthorized-privilege', 0) + +# We have a Systemd macro in postun which is currently empty, but might not be forever. +addFilter('gamemoded.* empty-%postun') + +# Libgamemodeauto loads the dependency via dlopen, so it cannot be picked up automatically. +addFilter('libgamemodeauto.* explicit-lib-dependency libgamemode') diff --git a/gamemode.changes b/gamemode.changes new file mode 100644 index 0000000..466999e --- /dev/null +++ b/gamemode.changes @@ -0,0 +1,28 @@ +------------------------------------------------------------------- +Tue May 15 19:38:57 UTC 2018 - marix@marix.org + +- Add Documentation files: + + License + + Sample configuration file + + README.openSUSE documenting how to apply configuration + +------------------------------------------------------------------- +Tue May 15 17:37:33 UTC 2018 - marix@marix.org + +- Replace Systemd unit by a D-Bus service. + + The Systemd unit does not work on openSUSE as it lacks access + to D-Bus. + + The D-Bus service is zero configuration for the user. + +------------------------------------------------------------------- +Sat May 12 19:47:14 UTC 2018 - marix@marix.org + +- Work around Leap 42.3's default compiler being to old. + +------------------------------------------------------------------- +Sat May 12 19:41:07 UTC 2018 - marix@marix.org + +- Initial experimental package version. + + Provides the GameMode daemon + + Provides the auto-GameMode library + + Provides a devel package with the GameMode client header diff --git a/gamemode.spec b/gamemode.spec new file mode 100644 index 0000000..893b0d5 --- /dev/null +++ b/gamemode.spec @@ -0,0 +1,129 @@ +# +# spec file for package gamemode +# +# Copyright (c) 2018 Matthias Bach . +# +# 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 http://bugs.opensuse.org/ +# + +Name: gamemode +Version:1.1 +Release: 0 +Summary: Optimise Linux system performance on demand +License: BSD-3-Clause +Group: Amusements/Games/Other +Url: https://github.com/FeralInteractive/gamemode +Source0: gamemode-%{version}.tar.xz +Source1: gamemode-rpmlintrc +Source2: README.openSUSE +BuildRequires: meson +BuildRequires: ninja +BuildRequires: pkg-config +BuildRequires: polkit-devel +BuildRequires: systemd-devel +%if 0%{?sle_version} == 120300 && 0%{?is_opensuse} +BuildRequires: gcc5 +%endif +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +%description +GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +GameMode was designed primarily as a stop-gap solution to problems with the Intel and AMD CPU powersave or ondemand governors, but is now able to launch custom user defined plugins, and is intended to be expanded further, as there are a wealth of automation tasks one might want to apply. + +%package -n gamemoded +Summary: The GameMode daemon required by GameMode enabled games +Recommends: libgamemode +Suggests: libgamemodeauto + +%description -n gamemoded +GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +The GameMode daemon is installed as a D-Bus Service and will start automatically on first access by a client. + +%package -n libgamemode +Summary: GameMode client library +Requires: gamemoded + +%description -n libgamemode +GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +Libgamemode is the client library used by games or libgamemodeauto to talk to the GameMode daemon. + + +%package -n libgamemodeauto +Summary: Helper library allowing to equip any game with GameMode support +Requires: libgamemode + +%description -n libgamemodeauto +GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +Libgamemodeauto allows you to use GameMode with any Game by preloading it into the game. + + LD_PRELOAD=%{_libdir}/libgamemodeauto.so ./game + +For Steam games this can be done by editing the launch options: + + LD_PRELOAD=$LD_PRELOAD:%{_libdir}/libgamemodeauto.so %%command%% + + +%package -n libgamemode-devel +Summary: Headers for compiling games using GameMode +Group: Development/Libraries/C and C++ +Requires: libgamemode + +%description -n libgamemode-devel +GameMode is a daemon/lib combo for Linux that allows games to request a set of optimisations be temporarily applied to the host OS. + +This package contains the headers required to compile games with built-in GameMode support. + +%prep +%setup -q +cp %{SOURCE2} . + +%build +%if 0%{?sle_version} == 120300 && 0%{?is_opensuse} +export CC=gcc-5 # gcc4.8 does not work because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58016 +%endif +%meson -Dwith-systemd=false +%meson_build + +%check +%meson_test + +%install +%meson_install + +%files -n gamemoded +%defattr(-,root,root) +%{_bindir}/gamemoded +%{_libexecdir}/cpugovctl +%{_datadir}/polkit-1/actions/com.feralinteractive.GameMode.policy +%{_datadir}/dbus-1/services/com.feralinteractive.GameMode.service +%{_mandir}/*/* +%doc example/gamemode.ini README.openSUSE +%license LICENSE.txt + +%files -n libgamemode +%defattr(-,root,root) +%{_libdir}/libgamemode.so + +%files -n libgamemodeauto +%defattr(-,root,root) +%{_libdir}/libgamemodeauto.so + +%files -n libgamemode-devel +%defattr(-,root,root) +%{_includedir}/gamemode_client.h +%license LICENSE.txt + +%changelog