summaryrefslogtreecommitdiffstats
path: root/main/cpufrequtils
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2009-07-24 08:01:31 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2009-07-24 08:01:31 +0000
commitb70981b68efcce5256eb11c6cd26ae123b10b6ea (patch)
treea38be6efae5e2ba15c2e839504632f9b7bfd5f91 /main/cpufrequtils
parent2b4df81538b8398442d5296650905c70341dd8d3 (diff)
moved extra/* to main/
and fixed misc build issues
Diffstat (limited to 'main/cpufrequtils')
-rw-r--r--main/cpufrequtils/APKBUILD42
-rw-r--r--main/cpufrequtils/cpufrequtils-005-build.patch24
-rw-r--r--main/cpufrequtils/cpufrequtils-005-nls.patch73
-rw-r--r--main/cpufrequtils/cpufrequtils.confd7
-rw-r--r--main/cpufrequtils/cpufrequtils.initd22
5 files changed, 168 insertions, 0 deletions
diff --git a/main/cpufrequtils/APKBUILD b/main/cpufrequtils/APKBUILD
new file mode 100644
index 00000000000..50cb2d1b08d
--- /dev/null
+++ b/main/cpufrequtils/APKBUILD
@@ -0,0 +1,42 @@
+# 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.
+ # we save 4k by disabling the 2.4 kernel support (PROC=false)
+ make -j1 LIBTOOL_OPT="--tag=CC --silent" \
+ NLS=false \
+ PROC=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/main/cpufrequtils/cpufrequtils-005-build.patch b/main/cpufrequtils/cpufrequtils-005-build.patch
new file mode 100644
index 00000000000..7dbe57043a3
--- /dev/null
+++ b/main/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/main/cpufrequtils/cpufrequtils-005-nls.patch b/main/cpufrequtils/cpufrequtils-005-nls.patch
new file mode 100644
index 00000000000..7a0336fff4c
--- /dev/null
+++ b/main/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/main/cpufrequtils/cpufrequtils.confd b/main/cpufrequtils/cpufrequtils.confd
new file mode 100644
index 00000000000..68f5b7594c6
--- /dev/null
+++ b/main/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/main/cpufrequtils/cpufrequtils.initd b/main/cpufrequtils/cpufrequtils.initd
new file mode 100644
index 00000000000..9aadd94c10b
--- /dev/null
+++ b/main/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}
+}