File cpupower-gui.spec of Package cpupower-gui
# Отключаем Mageia 9, так как там нет blueprint-compiler
%if 0%{?mageia} == 9
ExclusiveArch: %{nil}
%endif
Name: cpupower-gui
Version: 1.0.0
Release: 0
Summary: GUI utility to change the CPU frequency
License: GPL-3.0-or-later
Group: System/GUI/Other
URL: https://github.com/vagnum08/cpupower-gui
Source: %{name}-%{version}.tar.gz
# Основные сборочные зависимости
BuildRequires: meson >= 0.50.0
BuildRequires: pkgconfig
BuildRequires: python3-devel
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gtk4)
BuildRequires: pkgconfig(libadwaita-1)
BuildRequires: pkgconfig(gobject-introspection-1.0)
BuildRequires: hicolor-icon-theme
BuildRequires: gettext
# Фикс для Fedora 43: явно указываем wget, чтобы избежать конфликта wget1/wget2 в сервисах OBS
%if 0%{?fedora} >= 43
BuildRequires: wget2-wget
%else
BuildRequires: wget
%endif
%if 0%{?fedora}
BuildRequires: desktop-file-utils
BuildRequires: blueprint-compiler
%else
BuildRequires: blueprint-compiler
BuildRequires: update-desktop-files
BuildRequires: gettext-runtime
%endif
# Зависимости времени выполнения
%if 0%{?fedora}
Requires: python3-gobject
Requires: python3-dbus
%else
Requires: python3-gobject
Requires: python3-dbus-python
%endif
Requires: cpupower
Requires: polkit
BuildArch: noarch
%{?systemd_ordering}
%description
A graphical user interface for cpupower.
It allows you to change the frequency limits and governor of your CPU
per-core or for all cores at once.
%prep
%setup -q
%build
%meson
%meson_build
%install
%meson_install
%find_lang %{name}
%files -f %{name}.lang
%doc README.md
%license COPYING
%{_bindir}/%{name}
%{_prefix}/lib/%{name}/
%{_datadir}/%{name}/
%{_datadir}/applications/org.rnd2.cpupower_gui.desktop
%{_datadir}/glib-2.0/schemas/org.rnd2.cpupower_gui.gschema.xml
%{_datadir}/icons/hicolor/*/apps/*
%{_datadir}/metainfo/org.rnd2.cpupower_gui.appdata.xml
%{_datadir}/dbus-1/system.d/org.rnd2.cpupower_gui.helper.conf
%{_datadir}/dbus-1/system-services/org.rnd2.cpupower_gui.helper.service
%{_datadir}/dbus-1/services/org.rnd2.cpupower_gui.service
%{_datadir}/polkit-1/actions/org.rnd2.cpupower-gui.policy
%dir %{_datadir}/polkit-1/rules.d
%{_datadir}/polkit-1/rules.d/org.rnd2.cpupower-gui.rules
%{_prefix}/lib/systemd/system/%{name}*.service
%{_prefix}/lib/systemd/user/%{name}-user.service
%{_mandir}/man1/%{name}.1*
%{_mandir}/*/man1/%{name}*
%config(noreplace) %{_sysconfdir}/cpupower_gui.conf
%dir %{_sysconfdir}/cpupower_gui.d
%config(noreplace) %{_sysconfdir}/cpupower_gui.d/*
%post
%systemd_post %{name}-helper.service
# Обновляем конфиг D-Bus, чтобы система сразу увидела привилегированный помощник
if [ $1 -eq 1 ]; then
dbus-send --system --type=method_call --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ReloadConfig >/dev/null 2>&1 || :
fi
%preun
%systemd_preun %{name}-helper.service
%postun
%systemd_postun_with_restart %{name}-helper.service
%changelog