File intel-undervolt.spec of Package intel-undervolt

#
# spec file for package intel-undervolt
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           intel-undervolt
Version:        1.7
Release:        0
Summary:        Intel CPU undervolting and throttling configuration tool
License:        GPL-3.0-only
URL:            https://github.com/kitsunyan/intel-undervolt
Source0:        https://github.com/kitsunyan/intel-undervolt/archive/%{version}.tar.gz
BuildRequires:  make
BuildRequires:  pkgconfig
BuildRequires:  sed
BuildRequires:  pkgconfig(systemd)
ExclusiveArch:  x86_64
%systemd_ordering

%description
Tool for undervolting and throttling limits alteration for Intel CPUs
Undervolting works on Haswell and newer CPUs

%prep
%setup -q

%build
# configure is a custom script, not your usual configure. Thus do not use %%configure
./configure --enable-systemd
%make_build

%install
%make_install
mkdir -p %{buildroot}%{_sbindir}
ln -s service %{buildroot}%{_sbindir}/rcintel-undervolt
ln -s service %{buildroot}%{_sbindir}/rcintel-undervolt-loop


%files
%license COPYING
%config %{_sysconfdir}/intel-undervolt.conf
%{_bindir}/intel-undervolt
%{_unitdir}/intel-undervolt.service
%{_unitdir}/intel-undervolt-loop.service
%{_sbindir}/rcintel-undervolt
%{_sbindir}/rcintel-undervolt-loop

%pre
%service_add_pre intel-undervolt.service
%service_add_pre intel-undervolt-loop.service

%post
%service_add_post intel-undervolt.service
%service_add_post intel-undervolt-loop.service

%preun
%service_del_preun intel-undervolt.service
%service_del_preun intel-undervolt-loop.service

%postun
%service_del_postun intel-undervolt.service
%service_del_postun intel-undervolt-loop.service

%changelog
openSUSE Build Service is sponsored by