From 58bbd3c61c0fddac6cd5ed148f20a34ff2d3e123bbc4b64bbe92774cef378ed9 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 14 May 2012 09:40:37 +0000 Subject: [PATCH] Accepting request 120774 from home:jengelh:branches:Base:System - Update to new upstream release 2.0: * Interactive mode: redesigned, tab-based user interface with full on-demand window refresh support. * Reporting mode: PowerTOP v2.0 now allows you to specify not only the duration of each test measurement cycle, but the number of iterations to measure. PowerTOP can now produce HTML and CSV. * Increased WLAN support: PowerTOP now supports multiple WLAN interfaces * Enhanced i915 driver support * More robust battery data acquisition * Real time measurement support for USB hot-plug. OBS-URL: https://build.opensuse.org/request/show/120774 OBS-URL: https://build.opensuse.org/package/show/Base:System/powertop?expand=0&rev=11 --- powertop-1.98-always-create-params.patch | 30 ++++--- powertop-1.98-compile-fix.patch | 110 ----------------------- powertop-1.98-unknown-readings-fix.patch | 35 -------- powertop-1.98.tar.bz2 | 3 - powertop-2.0.tar.bz2 | 3 + powertop-no-date.patch | 14 +-- powertop.changes | 15 ++++ powertop.spec | 44 ++++----- powertop_set_cflags_override.patch | 25 ------ 9 files changed, 61 insertions(+), 218 deletions(-) delete mode 100644 powertop-1.98-compile-fix.patch delete mode 100644 powertop-1.98-unknown-readings-fix.patch delete mode 100644 powertop-1.98.tar.bz2 create mode 100644 powertop-2.0.tar.bz2 delete mode 100644 powertop_set_cflags_override.patch diff --git a/powertop-1.98-always-create-params.patch b/powertop-1.98-always-create-params.patch index b92625b..3ed9c68 100644 --- a/powertop-1.98-always-create-params.patch +++ b/powertop-1.98-always-create-params.patch @@ -1,26 +1,31 @@ -diff -up powertop-1.98/parameters/persistent.cpp.orig powertop-1.98/parameters/persistent.cpp ---- powertop-1.98/parameters/persistent.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/parameters/persistent.cpp 2011-12-02 19:48:45.056747667 +0100 -@@ -122,22 +122,23 @@ void save_parameters(const char *filenam +--- + src/parameters/persistent.cpp | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +Index: powertop-2.0/src/parameters/persistent.cpp +=================================================================== +--- powertop-2.0.orig/src/parameters/persistent.cpp ++++ powertop-2.0/src/parameters/persistent.cpp +@@ -129,9 +129,6 @@ void save_parameters(const char *filenam // printf("result size is %i, #parameters is %i \n", (int)past_results.size(), (int)all_parameters.parameters.size()); - if (!global_power_valid()) - return; +- + pathname = get_param_directory(filename); - file.open(filename, ios::out); - if (!file) { - cout << _("Cannot save to file ") << filename << "\n"; + file.open(pathname, ios::out); +@@ -140,12 +137,15 @@ void save_parameters(const char *filenam return; } -- -- map::iterator it; +- map::iterator it; +- - for (it = param_index.begin(); it != param_index.end(); it++) { - int index; - index = it->second; - file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n"; -- } + if (global_power_valid()) + { + map::iterator it; @@ -29,8 +34,7 @@ diff -up powertop-1.98/parameters/persistent.cpp.orig powertop-1.98/parameters/p + int index; + index = it->second; + file << it->first << "\t" << setprecision(9) << all_parameters.parameters[index] << "\n"; -+ } -+ } ++ } + } file.close(); } - diff --git a/powertop-1.98-compile-fix.patch b/powertop-1.98-compile-fix.patch deleted file mode 100644 index c75d678..0000000 --- a/powertop-1.98-compile-fix.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff -up powertop-1.98/devices/alsa.cpp.orig powertop-1.98/devices/alsa.cpp ---- powertop-1.98/devices/alsa.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/alsa.cpp 2012-01-11 16:19:53.365786704 +0100 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - - using namespace std; -diff -up powertop-1.98/devices/device.cpp.orig powertop-1.98/devices/device.cpp ---- powertop-1.98/devices/device.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/device.cpp 2012-01-11 16:13:38.284981557 +0100 -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - using namespace std; - -diff -up powertop-1.98/html.cpp.orig powertop-1.98/html.cpp ---- powertop-1.98/html.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/html.cpp 2012-01-11 16:06:58.714989836 +0100 -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - #include "css.h" - #include "lib.h" -diff -up powertop-1.98/devices/i915-gpu.cpp.orig powertop-1.98/devices/i915-gpu.cpp ---- powertop-1.98/devices/i915-gpu.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/i915-gpu.cpp 2012-01-11 16:21:46.958008197 +0100 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - - using namespace std; -diff -up powertop-1.98/cpu/intel_cpus.cpp.orig powertop-1.98/cpu/intel_cpus.cpp ---- powertop-1.98/cpu/intel_cpus.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/cpu/intel_cpus.cpp 2012-01-11 16:11:55.784740852 +0100 -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - - #include "../lib.h" - #include "../parameters/parameters.h" -diff -up powertop-1.98/main.cpp.orig powertop-1.98/main.cpp ---- powertop-1.98/main.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/main.cpp 2012-01-11 16:00:06.445806979 +0100 -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include - - #include "cpu/cpu.h" - #include "process/process.h" -diff -up powertop-1.98/devices/network.cpp.orig powertop-1.98/devices/network.cpp ---- powertop-1.98/devices/network.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/network.cpp 2012-01-11 16:23:18.176178890 +0100 -@@ -33,6 +33,7 @@ - #include - #include - #include -+#include - - #include - -diff -up powertop-1.98/devices/rfkill.cpp.orig powertop-1.98/devices/rfkill.cpp ---- powertop-1.98/devices/rfkill.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/rfkill.cpp 2012-01-11 16:15:46.003268813 +0100 -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - - using namespace std; -diff -up powertop-1.98/devices/thinkpad-fan.cpp.orig powertop-1.98/devices/thinkpad-fan.cpp ---- powertop-1.98/devices/thinkpad-fan.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/devices/thinkpad-fan.cpp 2012-01-11 16:25:27.550410318 +0100 -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - #include "../lib.h" - -diff -up powertop-1.98/devices/thinkpad-light.cpp.orig powertop-1.98/devices/thinkpad-light.cpp ---- powertop-1.98/devices/thinkpad-light.cpp.orig 2012-01-11 16:27:38.000000000 +0100 -+++ powertop-1.98/devices/thinkpad-light.cpp 2012-01-11 16:27:50.995652724 +0100 -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - - #include "../lib.h" - diff --git a/powertop-1.98-unknown-readings-fix.patch b/powertop-1.98-unknown-readings-fix.patch deleted file mode 100644 index 70fe273..0000000 --- a/powertop-1.98-unknown-readings-fix.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff -up powertop-1.98/measurement/acpi.cpp.orig powertop-1.98/measurement/acpi.cpp ---- powertop-1.98/measurement/acpi.cpp.orig 2011-05-11 06:48:37.000000000 +0200 -+++ powertop-1.98/measurement/acpi.cpp 2012-01-10 18:31:21.093799991 +0100 -@@ -108,8 +108,13 @@ void acpi_power_meter::measure(void) - while (*c == ' ') c++; - _capacity = strtoull(c, NULL, 10); - c = strchr(c, ' '); -- c++; -- strcpy(capacity_units, c); -+ if (c) { -+ c++; -+ strcpy(capacity_units, c); -+ } else { -+ _capacity = 0; -+ strcpy(capacity_units, "Unknown"); -+ } - } - if (strstr(line, "present voltage:")) { - c = strchr(line, ':'); -@@ -117,8 +122,13 @@ void acpi_power_meter::measure(void) - while (*c == ' ') c++; - _voltage = strtoull(c, NULL, 10); - c = strchr(c, ' '); -- c++; -- strcpy(voltage_units, c); -+ if (c) { -+ c++; -+ strcpy(voltage_units, c); -+ } else { -+ _voltage = 0; -+ strcpy(voltage_units, "Unknown"); -+ } - } - } - file.close(); diff --git a/powertop-1.98.tar.bz2 b/powertop-1.98.tar.bz2 deleted file mode 100644 index faf0817..0000000 --- a/powertop-1.98.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:078b2d05a467ae83a6ee567d11ed7f80b917a3e2ad9d9de0e4b9facd857353f4 -size 88110 diff --git a/powertop-2.0.tar.bz2 b/powertop-2.0.tar.bz2 new file mode 100644 index 0000000..716b767 --- /dev/null +++ b/powertop-2.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7af51d320856b3446bcc314c9414385f3b05b9360f650883b0210cd3b12c5c1c +size 456654 diff --git a/powertop-no-date.patch b/powertop-no-date.patch index 18006a4..d14084b 100644 --- a/powertop-no-date.patch +++ b/powertop-no-date.patch @@ -1,8 +1,12 @@ -Index: powertop-1.98/main.cpp +--- + src/main.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: powertop-2.0/src/main.cpp =================================================================== ---- powertop-1.98.orig/main.cpp -+++ powertop-1.98/main.cpp -@@ -71,7 +71,7 @@ static const struct option long_options[ +--- powertop-2.0.orig/src/main.cpp ++++ powertop-2.0/src/main.cpp +@@ -80,7 +80,7 @@ static const struct option long_options[ static void print_version() { @@ -10,4 +14,4 @@ Index: powertop-1.98/main.cpp + printf(_("Powertop version" POWERTOP_VERSION "\n")); } - static void print_usage() + static bool set_refresh_timeout() diff --git a/powertop.changes b/powertop.changes index 63cc8d7..ce23dcc 100644 --- a/powertop.changes +++ b/powertop.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sat May 12 15:22:00 UTC 2012 - jengelh@inai.de + +- Update to new upstream release 2.0: +* Interactive mode: redesigned, tab-based user interface with full + on-demand window refresh support. +* Reporting mode: PowerTOP v2.0 now allows you to specify not only + the duration of each test measurement cycle, but the number of + iterations to measure. PowerTOP can now produce HTML and CSV. +* Increased WLAN support: PowerTOP now supports multiple + WLAN interfaces +* Enhanced i915 driver support +* More robust battery data acquisition +* Real time measurement support for USB hot-plug. + ------------------------------------------------------------------- Thu Feb 2 09:11:29 UTC 2012 - aj@suse.de diff --git a/powertop.spec b/powertop.spec index 62b6ac9..f106d04 100644 --- a/powertop.spec +++ b/powertop.spec @@ -16,29 +16,27 @@ # - Name: powertop -Url: http://www.lesswatts.org +Url: https://01.org/powertop/ +#Git-Clone: git://github.com/fenrus75/powertop Summary: A Linux Tool to Find out What is Using Power on a Laptop -Version: 1.98 -Release: 1 License: GPL-2.0+ Group: System/Monitoring -Source0: %{name}-%{version}.tar.bz2 -Patch1: powertop_set_cflags_override.patch +Version: 2.0 +Release: 0 +Source: https://01.org/powertop/sites/default/files/downloads/%name-%version.tar.bz2 Patch2: powertop-1.98-always-create-params.patch -Patch3: powertop-1.98-unknown-readings-fix.patch -Patch4: powertop-1.98-compile-fix.patch Patch5: powertop-no-date.patch BuildRequires: gcc-c++ +BuildRequires: gettext BuildRequires: ncurses-devel BuildRequires: pkg-config -BuildRequires: libnl-1_1-devel -BuildRequires: zlib-devel -BuildRequires: pciutils-devel -BuildRequires: gettext +BuildRequires: pkgconfig +BuildRequires: pkgconfig(libnl-3.0) +BuildRequires: pkgconfig(libnl-genl-3.0) +BuildRequires: pkgconfig(libpci) +BuildRequires: pkgconfig(zlib) BuildRoot: %{_tmppath}/%{name}-%{version}-build -AutoReqProv: on %description PowerTOP is a program that collects the various pieces of information @@ -47,37 +45,29 @@ doing in terms of power savings. %prep %setup -q -%patch1 -p1 %patch2 -p1 -%patch3 -p1 -%patch4 -p1 %patch5 -p1 %build -make CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" +%configure +make %{?_smp_mflags} %install -mkdir -p %{buildroot}/%{_bindir} -make install DESTDIR=%{buildroot} +make install DESTDIR="%buildroot" install -Dd %{buildroot}%{_localstatedir}/cache/powertop touch %{buildroot}%{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.powertop} -#%find_lang %{name} +%find_lang %{name} %post # Hack for powertop not to show warnings on first start touch %{_localstatedir}/cache/powertop/{saved_parameters.powertop,saved_results.powertop} -%clean -rm -rf %{_buildroot} - -#%files -f %{name}.lang - -%files +%files -f %name.lang %defattr(-,root,root) %doc COPYING README %dir %{_localstatedir}/cache/powertop %ghost %{_localstatedir}/cache/powertop/saved_parameters.powertop %ghost %{_localstatedir}/cache/powertop/saved_results.powertop -%{_bindir}/%{name} +%_sbindir/%name %changelog diff --git a/powertop_set_cflags_override.patch b/powertop_set_cflags_override.patch deleted file mode 100644 index 5fb9fc9..0000000 --- a/powertop_set_cflags_override.patch +++ /dev/null @@ -1,25 +0,0 @@ -Index: powertop-1.98/Makefile -=================================================================== ---- powertop-1.98.orig/Makefile -+++ powertop-1.98/Makefile -@@ -2,9 +2,9 @@ all: powertop po/powertop.pot - - VERSION := 1.98 - --CFLAGS += -Wall -O2 -g -fno-omit-frame-pointer -fstack-protector -Wshadow -Wformat -D_FORTIFY_SOURCE=2 -+override CFLAGS += -Wall -O2 -g -fno-omit-frame-pointer -fstack-protector -Wshadow -Wformat -D_FORTIFY_SOURCE=2 - CPPFLAGS += -Wall -O2 -g -fno-omit-frame-pointer --CXXFLAGS += -Wall -O2 -g -fno-omit-frame-pointer -fstack-protector -Wshadow -Wformat -D_FORTIFY_SOURCE=2 -+override CXXFLAGS += -Wall -O2 -g -fno-omit-frame-pointer -fstack-protector -Wshadow -Wformat -D_FORTIFY_SOURCE=2 - PKG_CONFIG ?= pkg-config - - OBJS := lib.o main.o display.o html.o devlist.o -@@ -90,7 +90,7 @@ css.h: csstoh powertop.css - %.o: %.cpp lib.h css.h Makefile - @echo " CC $<" - @[ -x /usr/bin/cppcheck ] && /usr/bin/cppcheck -q $< || : -- @$(CC) $(CFLAGS) -c -o $@ $< -+ $(CC) $(CFLAGS) -c -o $@ $< - - - uptrans: