From 76c210c4f625d121437b1bf67c2a20df0e6fdba9 Mon Sep 17 00:00:00 2001 From: thepeople Date: Fri, 12 Feb 2010 15:38:58 +0000 Subject: [PATCH] add powertop, thanks Raphael HUCK git-svn-id: svn://svn.openwrt.org/openwrt/packages@19607 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/powertop/Makefile | 42 +++++++++++++++++++++ utils/powertop/patches/100-no-wide-ncurses.patch | 11 ++++++ utils/powertop/patches/200-no-gettext.patch | 48 ++++++++++++++++++++++++ 3 files changed, 101 insertions(+) create mode 100644 utils/powertop/Makefile create mode 100644 utils/powertop/patches/100-no-wide-ncurses.patch create mode 100644 utils/powertop/patches/200-no-gettext.patch diff --git a/utils/powertop/Makefile b/utils/powertop/Makefile new file mode 100644 index 000000000..6fe80950f --- /dev/null +++ b/utils/powertop/Makefile @@ -0,0 +1,42 @@ +# +# Copyright (C) 2006-2010 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=powertop +PKG_VERSION:=1.11 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.lesswatts.org/projects/powertop/download/ +PKG_MD5SUM:=3498f5983c683c3a57dce7379a722082 + +PKG_INSTALL:=1 +PKG_FIXUP:=libtool + +include $(INCLUDE_DIR)/package.mk + +define Package/powertop + SECTION:=utils + CATEGORY:=Utilities + TITLE:=PowerTOP + DEPENDS:=+libncurses +libgcc + KCONFIG:=CONFIG_DEBUG_KERNEL=y CONFIG_TIMER_STATS=y + URL:=http://www.lesswatts.org +endef + +define Package/powertop/description +PowerTOP is a Linux tool that helps you find those programs that are misbehaving +while your computer is idle. +endef + +define Package/powertop/install + $(CP) $(PKG_INSTALL_DIR)/* $(1) +endef + +$(eval $(call BuildPackage,powertop)) + diff --git a/utils/powertop/patches/100-no-wide-ncurses.patch b/utils/powertop/patches/100-no-wide-ncurses.patch new file mode 100644 index 000000000..61c93a3a8 --- /dev/null +++ b/utils/powertop/patches/100-no-wide-ncurses.patch @@ -0,0 +1,11 @@ +--- a/Makefile ++++ b/Makefile +@@ -20,7 +20,7 @@ OBJS = powertop.o config.o process.o mis + + + powertop: $(OBJS) Makefile powertop.h +- $(CC) ${CFLAGS} $(OBJS) -lncursesw -o powertop ++ $(CC) ${LDFLAGS} $(OBJS) -lncurses -o powertop + @(cd po/ && $(MAKE)) + + powertop.1.gz: powertop.1 diff --git a/utils/powertop/patches/200-no-gettext.patch b/utils/powertop/patches/200-no-gettext.patch new file mode 100644 index 000000000..623f24036 --- /dev/null +++ b/utils/powertop/patches/200-no-gettext.patch @@ -0,0 +1,48 @@ +--- a/powertop.c ++++ b/powertop.c +@@ -30,7 +30,9 @@ + #include + #include + #include ++#ifdef ENABLE_GETTEXT + #include ++#endif + #include + #include + #include +@@ -783,9 +785,11 @@ int main(int argc, char **argv) + uint64_t cur_usage[8], cur_duration[8]; + double wakeups_per_second = 0; + ++#ifdef ENABLE_GETTEXT + setlocale (LC_ALL, ""); + bindtextdomain ("powertop", "/usr/share/locale"); + textdomain ("powertop"); ++#endif + + while (1) { + static struct option opts[] = { +--- a/powertop.h ++++ b/powertop.h +@@ -26,7 +26,9 @@ + #ifndef __INCLUDE_GUARD_POWERTOP_H_ + #define __INCLUDE_GUARD_POWERTOP_H_ + ++#ifdef ENABLE_GETTEXT + #include ++#endif + + struct line { + char *string; +@@ -86,7 +88,11 @@ extern suggestion_func *suggestion_activ + _x < _y ? _x : _y; }) + + ++#ifdef ENABLE_GETTEXT + #define _(STRING) gettext(STRING) ++#else ++#define _(STRING) STRING ++#endif + + + #define PT_COLOR_DEFAULT 1 -- 2.11.0