rtkit/rtkit.spec
Zbigniew Jędrzejewski-Szmek fe9531dc3a Convert to rpmautospec
2022-04-22 11:15:08 +02:00

86 lines
2.7 KiB
RPMSpec

Name: rtkit
Version: 0.11
Release: %autorelease
Summary: Realtime Policy and Watchdog Daemon
# The daemon itself is GPLv3+, the reference implementation for the client BSD
License: GPLv3+ and BSD
URL: http://git.0pointer.net/rtkit.git/
Requires: dbus
Requires: polkit
BuildRequires: make
BuildRequires: systemd-devel
BuildRequires: dbus-devel >= 1.2
BuildRequires: libcap-devel
BuildRequires: polkit-devel
BuildRequires: autoconf automake libtool
Source0: http://0pointer.de/public/%{name}-%{version}.tar.xz
Patch1: rtkit-mq_getattr.patch
Patch2: 0001-SECURITY-Pass-uid-of-caller-to-polkit.patch
Patch3: rtkit-controlgroup.patch
# Temporarily disable -Werror=format-security since it breaks the build
Patch4: format-security.patch
Patch5: 0001-Fix-borked-error-check.patch
Patch6: 0001-systemd-update-sd-daemon.-ch.patch
Patch7: 0002-Remove-bundled-copy-of-sd-daemon.-ch.patch
%description
RealtimeKit is a D-Bus system service that changes the
scheduling policy of user processes/threads to SCHED_RR (i.e. realtime
scheduling mode) on request. It is intended to be used as a secure
mechanism to allow real-time scheduling to be used by normal user
processes.
%prep
%autosetup -p1
%build
autoreconf -fvi
%configure --with-systemdsystemunitdir=%{_unitdir}
%make_build
./rtkit-daemon --introspect > org.freedesktop.RealtimeKit1.xml
%install
%make_install
install -Dm0644 org.freedesktop.RealtimeKit1.xml %{buildroot}%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml
%pre
getent group rtkit >/dev/null 2>&1 || groupadd \
-r \
-g 172 \
rtkit
getent passwd rtkit >/dev/null 2>&1 || useradd \
-r -l \
-u 172 \
-g rtkit \
-d /proc \
-s /sbin/nologin \
-c "RealtimeKit" \
rtkit
:;
%post
%systemd_post rtkit-daemon.service
dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
%preun
%systemd_preun rtkit-daemon.service
%postun
%systemd_postun_with_restart rtkit-daemon.service
%files
%doc README GPL LICENSE rtkit.c rtkit.h
%attr(0755,root,root) %{_sbindir}/rtkitctl
%attr(0755,root,root) %{_libexecdir}/rtkit-daemon
%{_datadir}/dbus-1/system-services/org.freedesktop.RealtimeKit1.service
%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml
%{_datadir}/polkit-1/actions/org.freedesktop.RealtimeKit1.policy
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf
%{_prefix}/lib/systemd/system/rtkit-daemon.service
%{_mandir}/man8/*
%changelog
%autochangelog