Accepting request 943479 from Base:System

OBS-URL: https://build.opensuse.org/request/show/943479
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rtkit?expand=0&rev=32
This commit is contained in:
Dominique Leuenberger 2022-01-05 12:39:05 +00:00 committed by Git OBS Bridge
commit 09719a07c6
3 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Dec 31 13:12:17 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Change to using systemd-sysusers
-------------------------------------------------------------------
Tue Nov 16 10:49:44 UTC 2021 - Johannes Segitz <jsegitz@suse.com>

View File

@ -26,10 +26,12 @@ License: BSD-3-Clause AND GPL-3.0-or-later
Group: System/Base
URL: https://github.com/heftig/rtkit
Source: https://github.com/heftig/rtkit/releases/download/v%{version}/rtkit-%{version}.tar.xz
Source1: rtkit.sysusers
Patch0: harden_rtkit-daemon.service.patch
BuildRequires: automake
BuildRequires: libcap-devel
BuildRequires: pkg-config
BuildRequires: sysuser-tools
BuildRequires: systemd-rpm-macros
BuildRequires: vim
BuildRequires: xz
@ -39,6 +41,7 @@ BuildRequires: pkgconfig(polkit-agent-1)
BuildRequires: pkgconfig(polkit-gobject-1)
Requires: polkit
Requires(pre): dbus-1
%sysusers_requires
%description
RealtimeKit is a D-Bus system service that changes the scheduling policy of
@ -51,6 +54,7 @@ scheduling to be used by normal user processes.
%patch0 -p1
%build
%sysusers_generate_pre %{SOURCE1} rtkit rtkit.conf
autoreconf -fiv
export CFLAGS="%{optflags} -fPIE -Wno-format-nonliteral -Wno-format-security"
export LDFLAGS="-Wl,-z,relro,-z,now -pie"
@ -66,15 +70,12 @@ make %{?_smp_mflags}
make %{?_smp_mflags} DESTDIR=%{buildroot} install
ln -sv %{_sbindir}/service %{buildroot}%{_sbindir}/rcrtkit-daemon
install -D -m 0644 org.freedesktop.RealtimeKit1.xml %{buildroot}/%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml
install -Dm0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/rtkit.conf
%preun
%service_del_preun rtkit-daemon.service
%pre
groupadd -r rtkit >/dev/null 2>&1 || :
%{_bindir}/id rtkit >/dev/null 2>&1 || \
useradd -r -g rtkit -c 'RealtimeKit' -s /bin/false -d /var/lib/empty rtkit
%pre -f rtkit.pre
%service_add_pre rtkit-daemon.service
%post
@ -101,5 +102,6 @@ dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesk
%{_mandir}/man8/rtkitctl.8%{ext_man}
%{_sbindir}/rcrtkit-daemon
%{_unitdir}/rtkit-daemon.service
%{_sysusersdir}/rtkit.conf
%changelog

2
rtkit.sysusers Normal file
View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home directory Shell
u rtkit - 'RealtimeKit' /var/lib/empty -