From 864595404d4f85fe7f29d1b5669cae6f0081c679 Mon Sep 17 00:00:00 2001 From: "Kun(llfl)" Date: Mon, 10 Apr 2023 12:51:22 +0800 Subject: [PATCH] optimize spec file Signed-off-by: Kun(llfl) --- rtkit.spec | 57 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/rtkit.spec b/rtkit.spec index d859e96..712fadd 100644 --- a/rtkit.spec +++ b/rtkit.spec @@ -1,30 +1,32 @@ -%define anolis_release 2 +%define anolis_release 3 +Summary: REALTIMEKIT Realtime Policy and Watchdog Daemon Name: rtkit Epoch: 1 Version: 0.11 Release: %{anolis_release}%{?dist} -Summary: Realtime Policy and Watchdog Daemon +# The daemon itself is GPL3 licensed, and the client library is BSD licensed. License: GPLv3+ and BSD -URL: http://git.0pointer.net/rtkit.git/ -Source0: https://0pointer.de/public/rtkit-0.11.tar.xz +URL: http://git.0pointer.net/%{name}.git/ +Source0: https://0pointer.de/public/%{name}-%{version}.tar.xz -BuildRequires: make -BuildRequires: systemd-devel +BuildRequires: autoconf automake libtool make BuildRequires: dbus-devel >= 1.2 BuildRequires: libcap-devel -BuildRequires: polkit-devel -BuildRequires: autoconf automake libtool +BuildRequires: polkit-devel >= 0.92 +BuildRequires: systemd-devel + Requires: dbus -Requires: polkit +Requires: polkit >= 0.92 Patch0: 0000-rtkit-mq_getattr.patch Patch1: 0001-SECURITY-Pass-uid-of-caller-to-polkit.patch Patch2: 0002-rtkit-controlgroup.patch + # Temporarily disable -Werror=format-security since it breaks the build Patch3: 0003-format-security.patch - + Patch4: 0004-Fix-borked-error-check.patch Patch5: 0005-systemd-update-sd-daemon.-ch.patch Patch6: 0006-Remove-bundled-copy-of-sd-daemon.-ch.patch @@ -36,14 +38,17 @@ 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. +RealtimeKit can also be used to hand outh high priority +scheduling (i.e. negative nice level) to user processes. + %package doc -Summary: Documentation files for %{name} +Summary: Doc files for %{name} Requires: %{name} = %{epoch}:%{version}-%{release} BuildArch: noarch %description doc The %{name}-doc package contains documentation files for %{name}. - + %prep %autosetup -n %{name}-%{version} -p1 @@ -55,20 +60,17 @@ autoreconf -fvi %install %make_install -install -Dm0644 org.freedesktop.RealtimeKit1.xml %{buildroot}%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml +# install for dbus +install -D -m 0644 org.freedesktop.RealtimeKit1.xml %{buildroot}%{_datadir}/dbus-1/interfaces/org.freedesktop.RealtimeKit1.xml %generate_compatibility_deps %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 \ +# Create the rtkit user and group if they don't exist +# Notice that the uid and gid of the rtkit is both 172 +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 @@ -87,20 +89,25 @@ dbus-send --system --type=method_call --dest=org.freedesktop.DBus / org.freedesk %files %license GPL LICENSE %attr(0755,root,root) %{_sbindir}/rtkitctl +%attr(0755,root,root) %{_libexecdir}/rtkit-daemon %dir %{abidir} %{abidir}/rtkitctl-option.list -%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/* +%{_mandir}/man8/rtkitctl.8.* +%config(noreplace) %{_sysconfdir}/dbus-1/system.d/org.freedesktop.RealtimeKit1.conf %files doc %doc README rtkit.c rtkit.h %changelog +* Mon Apr 10 2023 Kun(llfl) - 1:0.11-3 +- optimize spec file +- add license description +- optimize description for the package + * Fri Mar 10 2023 Feng Su - 1:0.11-2 - add doc package - add abi/api files -- Gitee