forked from pop-os/system76-scheduler
-
Notifications
You must be signed in to change notification settings - Fork 2
/
system76-scheduler.spec
93 lines (77 loc) · 3.55 KB
/
system76-scheduler.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
Name: system76-scheduler
Version: 2.{{{ git_dir_version }}}
Release: 1%{?dist}
Summary: Oneshot service to tweak the CFS scheduler on boot. Uses settings from the TKG kernel by default.
License: MPLv2.0
URL: https://github.com/KyleGospo/system76-scheduler
VCS: {{{ git_dir_vcs }}}
Source: {{{ git_dir_pack }}}
# Realtime priority if bcc-tools is installed. Not available on OpenMandriva.
%if ! 0%{?mdkversion}
Requires: bcc-tools
%endif
# No just package on EPEL, OpenSUSE, or OpenMandriva
%{?fedora:BuildRequires: just}
BuildRequires: rust
BuildRequires: cargo
BuildRequires: pipewire-devel
BuildRequires: llvm-devel
BuildRequires: clang-libs
BuildRequires: clang-devel
BuildRequires: systemd-rpm-macros
# Required packages to build just on OpenMandriva
%if 0%{?mdkversion}
BuildRequires: glibc-devel
BuildRequires: glibc-static-devel
%endif
%description
Scheduling service which optimizes Linux's CPU scheduler and automatically assigns process priorities for improved desktop responsiveness. Low latency CPU scheduling will be activated automatically when on AC, and the default scheduling latencies set on battery. Processes are regularly sweeped and assigned process priorities based on configuration files. When combined with a supported desktop environment, foreground processes and their sub-processes will be given higher process priority.
These changes result in a noticeable improvement in the experienced smoothness and performance of applications and games. The improved responsiveness of applications is most noticeable on older systems with budget hardware, whereas games will benefit from higher framerates and reduced jitter. This is because background applications and services will be given a smaller portion of leftover CPU budget after the active process has had the most time on the CPU.
# Disable debug packages
%define debug_package %{nil}
%if 0%{?mdkversion}
# FIXME this is a workaround for some debug files being created on OpenMandriva despite debug_package being set to %{nil}
%define _unpackaged_files_terminate_build 0
%endif
# Set path to just
%if ! 0%{?fedora}
# Cargo install path on EPEL, OpenSUSE, or OpenMandriva
%define justpath /builddir/.cargo/bin/just
%else
%define justpath just
%endif
%prep
{{{ git_dir_setup_macro }}}
# This will invoke `just` command in the directory with the extracted sources.
%build
%if ! 0%{?fedora}
cargo install just
%endif
%{justpath} execsnoop=/usr/share/bcc/tools/execsnoop build-release
# This will copy the files generated by the `just` command above into
# the installable rpm package.
%install
%{justpath} rootdir=%{buildroot} unitdir=%{_unitdir} sysconfdir=%{_sysconfdir} install
# Do post-installation
%post
%systemd_post com.system76.Scheduler.service
# Do before uninstallation
%preun
%systemd_preun com.system76.Scheduler.service
# Do after uninstallation
%postun
%systemd_postun_with_restart com.system76.Scheduler.service
# This lists all the files that are included in the rpm package and that
# are going to be installed into target system where the rpm is installed.
%files
%license LICENSE
%doc README.md
%{_bindir}/system76-scheduler
%{_sysconfdir}/system76-scheduler/config.kdl
%{_sysconfdir}/system76-scheduler/process-scheduler/rhel.kdl
%{_unitdir}/com.system76.Scheduler.service
%{_sysconfdir}/dbus-1/system.d/com.system76.Scheduler.conf
# Finally, changes from the latest release of your application are generated from
# your project's Git history. It will be empty until you make first annotated Git tag.
%changelog
{{{ git_dir_changelog }}}