diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-21 19:15:40 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2009-05-21 19:15:40 +0000 |
commit | 037d588f15825981336ef6c419009fa97c992ddc (patch) | |
tree | e4c0611bd8630f0a75ac41f7ab768e20c4780c66 /extra | |
parent | 82af859ee6efb8e9f3828216788cf20f69b8cbac (diff) | |
download | aports-037d588f15825981336ef6c419009fa97c992ddc.tar.bz2 aports-037d588f15825981336ef6c419009fa97c992ddc.tar.xz |
extra/cpufrequtils: new aport
Userspace tools for the kernel cpufreq subsystem
http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html
Diffstat (limited to 'extra')
-rw-r--r-- | extra/cpufrequtils/APKBUILD | 39 | ||||
-rw-r--r-- | extra/cpufrequtils/cpufrequtils-005-build.patch | 24 | ||||
-rw-r--r-- | extra/cpufrequtils/cpufrequtils-005-nls.patch | 73 | ||||
-rw-r--r-- | extra/cpufrequtils/cpufrequtils.confd | 7 | ||||
-rw-r--r-- | extra/cpufrequtils/cpufrequtils.initd | 22 |
5 files changed, 165 insertions, 0 deletions
diff --git a/extra/cpufrequtils/APKBUILD b/extra/cpufrequtils/APKBUILD new file mode 100644 index 000000000..2c4cdee7c --- /dev/null +++ b/extra/cpufrequtils/APKBUILD @@ -0,0 +1,39 @@ +# Maintainer: Natanael Copa <ncopa@alpinelinux.org> +pkgname=cpufrequtils +pkgver=005 +pkgrel=0 +pkgdesc="Userspace tools for the kernel cpufreq subsystem" +url="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/cpufrequtils.html" +license="GPL" +subpackages="$pkgname-dev $pkgname-doc" +depends="sysfsutils uclibc" +makedepends="sysfsutils-dev uclibc libtool" +source="http://www.kernel.org/pub/linux/utils/kernel/cpufreq/$pkgname-$pkgver.tar.bz2 + cpufrequtils-005-build.patch + cpufrequtils-005-nls.patch + $pkgname.initd + $pkgname.confd" + +build () +{ + cd "$srcdir"/$pkgname-$pkgver + for i in ../*.patch; do + msg "Applying $i..." + patch -p1 < $i || return 1 + done + + # distcc and ccache makes libtool confused about the tag. + make -j1 LIBTOOL_OPT="--tag=CC --silent" \ + NLS=false || return 1 + make mandir=/usr/share/man \ + NLS=false \ + DESTDIR="$pkgdir" \ + install || return 1 + install -D -m755 ../$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -D -m644 ../$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} +md5sums="73a41589fe74b73fc530f4179f2c6142 cpufrequtils-005.tar.bz2 +0b007dbd9fcb3acf55a8570f21b2f5d4 cpufrequtils-005-build.patch +d88bee4d20c8b72d8edd50c2af5d4600 cpufrequtils-005-nls.patch +b9b80ef2f1b6c5e7ce0476037a8bce6b cpufrequtils.initd +d47ff635eef03248c633486eaeec191d cpufrequtils.confd" diff --git a/extra/cpufrequtils/cpufrequtils-005-build.patch b/extra/cpufrequtils/cpufrequtils-005-build.patch new file mode 100644 index 000000000..7dbe57043 --- /dev/null +++ b/extra/cpufrequtils/cpufrequtils-005-build.patch @@ -0,0 +1,24 @@ +--- a/Makefile ++++ b/Makefile +@@ -158,10 +158,10 @@ endif + + # if DEBUG is enabled, then we do not strip or optimize + ifeq ($(strip $(DEBUG)),true) +- CFLAGDEF += -O1 -g -DDEBUG ++ CFLAGDEF += -DDEBUG + STRIPCMD = /bin/true -Since_we_are_debugging + else +- CFLAGDEF += $(OPTIMIZATION) -fomit-frame-pointer ++ CFLAGDEF += $(OPTIMIZATION) + STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment + endif + +@@ -191,7 +191,7 @@ libcpufreq: libcpufreq.la + + cpufreq-%: libcpufreq.la $(UTIL_OBJS) + $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -g -I. -I./lib/ -c -o utils/$@.o utils/$*.c +- $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -g -I./lib/ -L. -L./.libs/ -lcpufreq -o $@ utils/$@.o ++ $(QUIET) $(CC) $(CFLAGDEF) $(CFLAGS) -g $(LDFLAGS) -I./lib/ -L. -L./.libs/ -o $@ utils/$@.o -lcpufreq + $(QUIET) $(STRIPCMD) $@ + + utils: cpufreq-info cpufreq-set diff --git a/extra/cpufrequtils/cpufrequtils-005-nls.patch b/extra/cpufrequtils/cpufrequtils-005-nls.patch new file mode 100644 index 000000000..7a0336fff --- /dev/null +++ b/extra/cpufrequtils/cpufrequtils-005-nls.patch @@ -0,0 +1,73 @@ +make nls/gettext support optional + +patch by Jos van der Ende <seraph@xs4all.nl> + +http://bugs.gentoo.org/205576 + +--- cpufrequtils-005/Makefile ++++ cpufrequtils-005/Makefile +@@ -141,6 +141,7 @@ + ifeq ($(strip $(NLS)),true) + INSTALL_NLS += install-gmo + COMPILE_NLS += update-gmo ++ CFLAGDEF += -DNLS + endif + + +--- cpufrequtils-005/utils/info.c ++++ cpufrequtils-005/utils/info.c +@@ -10,7 +10,6 @@ + #include <errno.h> + #include <stdlib.h> + #include <string.h> +-#include <libintl.h> + #include <locale.h> + + #include <getopt.h> +@@ -18,9 +17,18 @@ + #include "cpufreq.h" + + ++#ifdef NLS ++#include <libintl.h> + #define _(String) gettext (String) + #define gettext_noop(String) String + #define N_(String) gettext_noop (String) ++#else ++#define gettext_noop(String) String ++#define _(String) gettext_noop (String) ++#define gettext(String) gettext_noop (String) ++#define N_(String) gettext_noop (String) ++#define textdomain(String) ++#endif + + #define LINE_LEN 10 + +--- cpufrequtils-005/utils/set.c ++++ cpufrequtils-005/utils/set.c +@@ -12,16 +12,24 @@ + #include <limits.h> + #include <string.h> + #include <ctype.h> +-#include <libintl.h> + #include <locale.h> + + #include <getopt.h> + + #include "cpufreq.h" + ++#ifdef NLS ++#include <libintl.h> + #define _(String) gettext (String) + #define gettext_noop(String) String + #define N_(String) gettext_noop (String) ++#else ++#define gettext_noop(String) String ++#define _(String) gettext_noop (String) ++#define gettext(String) gettext_noop (String) ++#define N_(String) gettext_noop (String) ++#define textdomain(String) ++#endif + + #define NORM_FREQ_LEN 32 + diff --git a/extra/cpufrequtils/cpufrequtils.confd b/extra/cpufrequtils/cpufrequtils.confd new file mode 100644 index 000000000..68f5b7594 --- /dev/null +++ b/extra/cpufrequtils/cpufrequtils.confd @@ -0,0 +1,7 @@ +# /etc/conf.d/cpufrequtils: config file for /etc/init.d/cpufrequtils + +# Options when starting cpufreq (given to the `cpufreq-set` program) +START_OPTS="--governor ondemand" + +# Options when stopping cpufreq (given to the `cpufreq-set` program) +STOP_OPTS="--governor performance" diff --git a/extra/cpufrequtils/cpufrequtils.initd b/extra/cpufrequtils/cpufrequtils.initd new file mode 100644 index 000000000..9aadd94c1 --- /dev/null +++ b/extra/cpufrequtils/cpufrequtils.initd @@ -0,0 +1,22 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/cpufrequtils/files/cpufrequtils-init.d-005,v 1.2 2008/10/21 21:20:59 vapier Exp $ + +affect_change() { + local c ret=0 + ebegin "Running cpufreq-set $*" + for c in $(cpufreq-info -o | awk '$1 == "CPU" { print $2 }') ; do + cpufreq-set -c ${c} $* + : $((ret+=$?)) + done + eend ${ret} +} + +start() { + affect_change ${START_OPTS} +} + +stop() { + affect_change ${STOP_OPTS} +} |