[powertop] New version

Jaroslav Škarvada jskarvad at fedoraproject.org
Tue Nov 25 12:44:55 UTC 2014


commit 08eab09a5d7e950ddf83a0b52814dc04e8597442
Author: Jaroslav Škarvada <jskarvad at redhat.com>
Date:   Tue Nov 25 13:44:35 2014 +0100

    New version
    
      Resolves: rhbz#1167726
    - De-fuzzified patches
    - Dropped man-fix patch (upstreamed)
    - Added powertop autotuner oneshot service

 powertop-2.6.1-man-fix.patch                       |   13 ------
 ...atch => powertop-2.7-always-create-params.patch |    6 +-
 ...atch => powertop-2.7-tunable-overflow-fix.patch |   16 ++++----
 powertop.spec                                      |   40 ++++++++++++++------
 sources                                            |    2 +-
 5 files changed, 40 insertions(+), 37 deletions(-)
---
diff --git a/powertop-2.3-always-create-params.patch b/powertop-2.7-always-create-params.patch
similarity index 85%
rename from powertop-2.3-always-create-params.patch
rename to powertop-2.7-always-create-params.patch
index 044bb71..87ddf7d 100644
--- a/powertop-2.3-always-create-params.patch
+++ b/powertop-2.7-always-create-params.patch
@@ -1,8 +1,8 @@
 diff --git a/src/parameters/persistent.cpp b/src/parameters/persistent.cpp
-index 483227b..5e4a5fd 100644
+index 9a5688a..6a232cd 100644
 --- a/src/parameters/persistent.cpp
 +++ b/src/parameters/persistent.cpp
-@@ -130,9 +130,6 @@ void save_parameters(const char *filename)
+@@ -145,9 +145,6 @@ void save_parameters(const char *filename)
  
  //	printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size());
  
@@ -12,7 +12,7 @@ index 483227b..5e4a5fd 100644
  	pathname = get_param_directory(filename);
  
  	file.open(pathname, ios::out);
-@@ -141,12 +138,15 @@ void save_parameters(const char *filename)
+@@ -156,12 +153,15 @@ void save_parameters(const char *filename)
  		return;
  	}
  
diff --git a/powertop-2.6.1-tunable-overflow-fix.patch b/powertop-2.7-tunable-overflow-fix.patch
similarity index 94%
rename from powertop-2.6.1-tunable-overflow-fix.patch
rename to powertop-2.7-tunable-overflow-fix.patch
index 7e61cad..b33b5da 100644
--- a/powertop-2.6.1-tunable-overflow-fix.patch
+++ b/powertop-2.7-tunable-overflow-fix.patch
@@ -1,5 +1,5 @@
 diff --git a/src/tuning/bluetooth.cpp b/src/tuning/bluetooth.cpp
-index e0bdf12..01c673d 100644
+index 9be327e..52a9278 100644
 --- a/src/tuning/bluetooth.cpp
 +++ b/src/tuning/bluetooth.cpp
 @@ -46,8 +46,8 @@
@@ -13,7 +13,7 @@ index e0bdf12..01c673d 100644
  }
  
  
-@@ -188,9 +188,9 @@ const char *bt_tunable::toggle_script(void)
+@@ -190,9 +190,9 @@ const char *bt_tunable::toggle_script(void)
  	good = good_bad();
  
  	if (good == TUNE_GOOD) {
@@ -55,7 +55,7 @@ index 3d36112..f3f0224 100644
  
  	return NULL;
 diff --git a/src/tuning/runtime.cpp b/src/tuning/runtime.cpp
-index b57d53e..3369976 100644
+index 3201fdd..6d6bb98 100644
 --- a/src/tuning/runtime.cpp
 +++ b/src/tuning/runtime.cpp
 @@ -42,6 +42,7 @@ runtime_tunable::runtime_tunable(const char *path, const char *bus, const char *
@@ -116,7 +116,7 @@ index 3372378..8f90ee2 100644
  	char desc[4096];
  	double score;
 diff --git a/src/tuning/tuningsysfs.cpp b/src/tuning/tuningsysfs.cpp
-index ec1ca6b..aa4ebd5 100644
+index 0859a0c..3bfe0e3 100644
 --- a/src/tuning/tuningsysfs.cpp
 +++ b/src/tuning/tuningsysfs.cpp
 @@ -43,11 +43,15 @@
@@ -152,10 +152,10 @@ index ec1ca6b..aa4ebd5 100644
  
  
 diff --git a/src/tuning/tuningusb.cpp b/src/tuning/tuningusb.cpp
-index 27a6dca..2750121 100644
+index d2a0c11..ec869ec 100644
 --- a/src/tuning/tuningusb.cpp
 +++ b/src/tuning/tuningusb.cpp
-@@ -40,6 +40,7 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9,
+@@ -41,6 +41,7 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9,
  	char filename[4096];
  	char vendor[2048];
  	char product[2048];
@@ -163,7 +163,7 @@ index 27a6dca..2750121 100644
  	string str1, str2;
  	sprintf(usb_path, "%s/power/control", path);
  
-@@ -72,8 +73,10 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9,
+@@ -73,8 +74,10 @@ usb_tunable::usb_tunable(const char *path, const char *name) : tunable("", 0.9,
  	else if (strlen(vendor))
  		sprintf(desc, _("Autosuspend for USB device %s [%s]"), vendor, name);
  
@@ -176,7 +176,7 @@ index 27a6dca..2750121 100644
  }
  
  int usb_tunable::good_bad(void)
-@@ -107,10 +110,10 @@ const char *usb_tunable::toggle_script(void)
+@@ -108,10 +111,10 @@ const char *usb_tunable::toggle_script(void)
  	good = good_bad();
  
  	if (good == TUNE_GOOD) {
diff --git a/powertop.spec b/powertop.spec
index 9caaf77..d1eb8c9 100644
--- a/powertop.spec
+++ b/powertop.spec
@@ -1,21 +1,23 @@
 Name:           powertop
-Version:        2.6.1
-Release:        3%{?dist}
+Version:        2.7
+Release:        1%{?dist}
 Summary:        Power consumption monitor
 
 Group:          Applications/System
 License:        GPLv2
 URL:            http://01.org/powertop/
 Source0:        http://01.org/powertop/sites/default/files/downloads/%{name}-%{version}.tar.gz
+Source1:        powertop.service
 
 # Sent upstream
-Patch0:         powertop-2.3-always-create-params.patch
-# Sent upstream (http://github.com/fenrus75/powertop/pull/11)
-Patch1:         powertop-2.6.1-man-fix.patch
-Patch3:         powertop-2.6.1-tunable-overflow-fix.patch
+Patch0:         powertop-2.7-always-create-params.patch
+Patch1:         powertop-2.7-tunable-overflow-fix.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  gettext, ncurses-devel, pciutils-devel, zlib-devel, libnl3-devel
-Requires(post): coreutils
+BuildRequires:  systemd
+Requires(post): systemd, coreutils
+Requires(preun): systemd
+Requires(postun): systemd
 
 %description
 PowerTOP is a tool that finds the software component(s) that make your
@@ -24,11 +26,7 @@ computer use more power than necessary while it is idle.
 %prep
 %setup -q
 %patch0 -p1 -b .always-create-params
-%patch1 -p1 -b .man-fix
-%patch3 -p1 -b .tunable-overfow-fix
-
-# remove left over object files
-find . -name "*.o" -exec rm {} \;
+%patch1 -p1 -b .tunable-overfow-fix
 
 %build
 %configure
@@ -41,7 +39,17 @@ install -Dd %{buildroot}%{_localstatedir}/cache/powertop
 touch %{buildroot}%{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.powertop}
 %find_lang %{name}
 
+# Systemd
+install -Dpm 644 %{SOURCE1} %{buildroot}%{_unitdir}/powertop.service
+
+%preun
+%systemd_preun powertop.service
+
+%postun
+%systemd_postun_with_restart powertop.service
+
 %post
+%systemd_post powertop.service
 # Hack for powertop not to show warnings on first start
 touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.powertop}
 
@@ -56,8 +64,16 @@ rm -rf %{buildroot}
 %ghost %{_localstatedir}/cache/powertop/saved_results.powertop
 %{_sbindir}/powertop
 %{_mandir}/man8/powertop.8*
+%{_unitdir}/powertop.service
 
 %changelog
+* Tue Nov 25 2014 Jaroslav Škarvada <jskarvad at redhat.com> - 2.7-1
+- New version
+  Resolves: rhbz#1167726
+- De-fuzzified patches
+- Dropped man-fix patch (upstreamed)
+- Added powertop autotuner oneshot service
+
 * Sun Aug 17 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.6.1-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
 
diff --git a/sources b/sources
index 335b445..8c9ed51 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-705e091fa9e79a12d16bc3cb0c688280  powertop-2.6.1.tar.gz
+e0d686e47daaf7e9d89031f7763432ef  powertop-2.7.tar.gz


More information about the scm-commits mailing list