diff --git a/powertop.changes b/powertop.changes index e003d6e..4c89c72 100644 --- a/powertop.changes +++ b/powertop.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Apr 11 04:56:30 UTC 2015 - hillwood@linuxfans.org + +- Add a systemd script. + ------------------------------------------------------------------- Sun Feb 8 22:02:17 UTC 2015 - p.drouand@gmail.com diff --git a/powertop.service b/powertop.service new file mode 100644 index 0000000..c767dfe --- /dev/null +++ b/powertop.service @@ -0,0 +1,11 @@ +[Unit] +Description=Extend the battery life of laptop + +[Service] +Type=oneshot +Environment="TERM=xterm" +ExecStart=/usr/sbin/powertop --auto-tune + +[Install] +WantedBy=multi-user.target + diff --git a/powertop.spec b/powertop.spec index 95ddab5..9ad936a 100644 --- a/powertop.spec +++ b/powertop.spec @@ -1,7 +1,7 @@ # # spec file for package powertop # -# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,8 @@ License: GPL-2.0+ Group: System/Monitoring Version: 2.7 Release: 0 -Source: https://01.org/sites/default/files/downloads/%name/%name-%version.tar.gz +Source0: https://01.org/sites/default/files/downloads/%name/%name-%version.tar.gz +Source1: powertop.service Patch2: powertop-1.98-always-create-params.patch Patch3: powertop-fix-crash-with-autotune.patch Patch5: powertop-no-date.patch @@ -37,6 +38,7 @@ BuildRequires: pkgconfig(libnl-3.0) BuildRequires: pkgconfig(libnl-genl-3.0) BuildRequires: pkgconfig(libpci) BuildRequires: pkgconfig(zlib) +Requires: xterm Recommends: %{name}-lang BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -64,6 +66,8 @@ make %{?_smp_mflags} make install DESTDIR="%buildroot" install -Dd %{buildroot}%{_localstatedir}/cache/powertop touch %{buildroot}%{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.powertop} +install -d %{buildroot}%{_unitdir} +install -m 644 %{SOURCE1} %{buildroot}%{_unitdir} %find_lang %{name} %post @@ -79,6 +83,7 @@ touch %{_localstatedir}/cache/powertop/saved_results.powertop %ghost %{_localstatedir}/cache/powertop/saved_results.powertop %_sbindir/%name %{_mandir}/man8/powertop.8.gz +%{_unitdir}/%{name}.service %files lang -f %{name}.lang