2023-07-25 19:21:53 +00:00
|
|
|
Name: vpower
|
2023-07-25 21:21:20 +00:00
|
|
|
Version: {{{ git_dir_version }}}
|
|
|
|
Release: 1%{?dist}
|
2023-07-25 19:21:53 +00:00
|
|
|
Summary: Service that calculates battery metrics and handles critical battery scenarios
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
URL: https://gitlab.com/evlaV/vpower/
|
|
|
|
Source: %{url}-/archive/main/vpower-main.tar.gz
|
2023-07-25 21:21:20 +00:00
|
|
|
Patch0: fedora.patch
|
2023-07-25 19:21:53 +00:00
|
|
|
|
|
|
|
BuildRequires: rust-packaging >= 21
|
|
|
|
BuildRequires: lm_sensors-devel
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
|
|
|
|
Requires: lm_sensors
|
|
|
|
Requires: lm_sensors-libs
|
|
|
|
|
|
|
|
%description
|
|
|
|
Service that calculates battery metrics and handles critical battery scenarios
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -n %{name}-main -p1
|
|
|
|
%cargo_prep
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
%cargo_generate_buildrequires
|
|
|
|
|
|
|
|
%build
|
|
|
|
%cargo_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%cargo_install
|
2023-12-26 07:30:51 +00:00
|
|
|
mkdir -p %{buildroot}%{_libexecdir}
|
|
|
|
mv %{buildroot}%{_bindir}/%{name} %{buildroot}%{_libexecdir}/%{name}
|
2023-07-25 19:21:53 +00:00
|
|
|
mkdir -p %{buildroot}%{_unitdir}/
|
|
|
|
cp -v vpower.service %{buildroot}%{_unitdir}/%{name}.service
|
2023-08-14 23:27:15 +00:00
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/
|
|
|
|
cp -v vpower.toml %{buildroot}%{_sysconfdir}/%{name}.toml
|
2023-07-25 19:21:53 +00:00
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
%check
|
|
|
|
%cargo_test
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Do post-installation
|
|
|
|
%post
|
|
|
|
%systemd_post %{name}.service
|
|
|
|
|
|
|
|
# Do before uninstallation
|
|
|
|
%preun
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
# Do after uninstallation
|
|
|
|
%postun
|
|
|
|
%systemd_postun_with_restart %{name}.service
|
|
|
|
|
|
|
|
%files
|
|
|
|
%license LICENSE
|
2023-12-26 07:39:22 +00:00
|
|
|
%{_libexecdir}/%{name}
|
2023-07-25 19:21:53 +00:00
|
|
|
%{_unitdir}/%{name}.service
|
2023-08-14 23:27:15 +00:00
|
|
|
%{_sysconfdir}/%{name}.toml
|
2023-07-25 19:21:53 +00:00
|
|
|
|
|
|
|
%changelog
|
|
|
|
%autochangelog
|