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
This commit is contained in:
Dirk Stoecker 2018-05-18 17:04:59 +00:00 committed by Git OBS Bridge
commit 41d9c982e5
9 changed files with 232 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -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

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

20
README.openSUSE Normal file
View File

@ -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.

15
_service Normal file
View File

@ -0,0 +1,15 @@
<services>
<service name="obs_scm" mode="disabled">
<param name="url">https://github.com/FeralInteractive/gamemode.git</param>
<param name="scm">git</param>
<param name="revision">1.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="changesgenerate">enable</param>
</service>
<service name="tar" mode="disabled" />
<service name="recompress" mode="disabled">
<param name="file">*.tar</param>
<param name="compression">xz</param>
</service>
<service name="set_version" mode="disabled" />
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/FeralInteractive/gamemode.git</param>
<param name="changesrevision">8b9f4b9ac8bb1ac97c2f4e769da17315c4658503</param></service></servicedata>

3
gamemode-1.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:df5d3b214dea66f5260f3d86049227857c6622b1ee23969463c0ece4b35e67a1
size 35160

9
gamemode-rpmlintrc Normal file
View File

@ -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')

28
gamemode.changes Normal file
View File

@ -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

129
gamemode.spec Normal file
View File

@ -0,0 +1,129 @@
#
# spec file for package gamemode
#
# Copyright (c) 2018 Matthias Bach <marix@marix.org>.
#
# 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