File stalld.spec of Package stalld

Name:             stalld
Version:          1.19.3
Release:          1%{?dist}
Summary:          Daemon that finds starving tasks and gives them a temporary boost

Vendor:           SUSE Linux

License:          GPL-2.0-or-later AND GPL-2.0-only
URL:              https://gitlab.com/rt-linux-tools/%{name}/%{name}.git
Source0:          stalld-v1.19.3.tar.bz2

Patch0:           pid-dir.patch

BuildRequires:    glibc-devel
BuildRequires:    gcc
BuildRequires:    make

Requires:         systemd
Requires(post):   %fillup_prereq

%description
The stalld program monitors the set of system threads,
looking for threads that are ready-to-run but have not
been given processor time for some threshold period.
When a starving thread is found, it is given a temporary
boost using the SCHED_DEADLINE policy. The default is to
allow 10 microseconds of runtime for 1 second of clock time.

%prep
%autosetup -v -p1 -n %{name}-v%{version}

%build
%make_build USE_BPF=0 SOPTS="" CFLAGS="%{optflags} %{build_cflags} -DVERSION="\\\"%{version}\\\""" stalld

%install
%make_install DOCDIR=%{_docdir} MANDIR=%{_mandir} BINDIR=%{_bindir} DATADIR=%{_datadir} VERSION=%{version}
%make_install -C systemd UNITDIR=%{_unitdir}
mkdir -p %{buildroot}%{_fillupdir}
mv %{buildroot}%{_sysconfdir}/sysconfig/%{name} %{buildroot}%{_fillupdir}/sysconfig.%{name}

%files
%{_bindir}/%{name}
%{_bindir}/throttlectl
%{_unitdir}/%{name}.service
%{_fillupdir}/sysconfig.%{name}
%doc %{_docdir}/README.md
%doc %{_mandir}/man8/stalld.8*
%license gpl-2.0.txt

%pre
%service_add_pre %{name}.service

%post
%fillup_only
%systemd_post %{name}.service

%preun
%systemd_preun %{name}.service

%postun
%systemd_postun_with_restart %{name}.service

%changelog
* Mon Jun 3 2024 Marco Chiappero <marco.chiappero@suse.com> - 1.19.3
- Initial package
openSUSE Build Service is sponsored by