diff options
author | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-03-14 21:57:10 +0000 |
---|---|---|
committer | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-03-14 21:57:10 +0000 |
commit | 8955d6afb7a78ce421068f51a9bfa9437c7bec4b (patch) | |
tree | de39118f6b697d82c69a698f92da78629f2160b7 /sys-power/speedfreq | |
parent | Ebuild for 3.2 final. (diff) | |
download | gentoo-2-8955d6afb7a78ce421068f51a9bfa9437c7bec4b.tar.gz gentoo-2-8955d6afb7a78ce421068f51a9bfa9437c7bec4b.tar.bz2 gentoo-2-8955d6afb7a78ce421068f51a9bfa9437c7bec4b.zip |
Moved from sys-apps/speedfreq to sys-power/speedfreq.
Diffstat (limited to 'sys-power/speedfreq')
-rw-r--r-- | sys-power/speedfreq/ChangeLog | 50 | ||||
-rw-r--r-- | sys-power/speedfreq/Manifest | 25 | ||||
-rw-r--r-- | sys-power/speedfreq/files/0.7.2-python-ver.patch | 11 | ||||
-rwxr-xr-x | sys-power/speedfreq/files/battery-new.sh | 41 | ||||
-rwxr-xr-x | sys-power/speedfreq/files/battery.sh | 27 | ||||
-rw-r--r-- | sys-power/speedfreq/files/digest-speedfreq-0.5 | 1 | ||||
-rw-r--r-- | sys-power/speedfreq/files/digest-speedfreq-0.7.2 | 1 | ||||
-rw-r--r-- | sys-power/speedfreq/files/digest-speedfreq-0.7.2-r1 | 1 | ||||
-rw-r--r-- | sys-power/speedfreq/files/digest-speedfreq-0.7.2-r2 | 1 | ||||
-rw-r--r-- | sys-power/speedfreq/files/speedfreq.conf | 17 | ||||
-rwxr-xr-x | sys-power/speedfreq/files/speedfreq.rc | 51 | ||||
-rw-r--r-- | sys-power/speedfreq/metadata.xml | 5 | ||||
-rw-r--r-- | sys-power/speedfreq/speedfreq-0.5.ebuild | 66 | ||||
-rw-r--r-- | sys-power/speedfreq/speedfreq-0.7.2-r1.ebuild | 75 | ||||
-rw-r--r-- | sys-power/speedfreq/speedfreq-0.7.2-r2.ebuild | 76 | ||||
-rw-r--r-- | sys-power/speedfreq/speedfreq-0.7.2.ebuild | 66 |
16 files changed, 514 insertions, 0 deletions
diff --git a/sys-power/speedfreq/ChangeLog b/sys-power/speedfreq/ChangeLog new file mode 100644 index 000000000000..1d2b1eda409c --- /dev/null +++ b/sys-power/speedfreq/ChangeLog @@ -0,0 +1,50 @@ +# ChangeLog for sys-apps/speedfreq +# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/ChangeLog,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +*speedfreq-0.7.2-r2 (14 Mar 2005) +*speedfreq-0.7.2-r1 (14 Mar 2005) +*speedfreq-0.7.2 (14 Mar 2005) +*speedfreq-0.5 (14 Mar 2005) + + 14 Mar 2005; Ciaran McCreesh <ciaranm@gentoo.org> + +files/0.7.2-python-ver.patch, +files/battery.sh, +files/battery-new.sh, + +files/speedfreq.conf, +files/speedfreq.rc, +metadata.xml, + +speedfreq-0.5.ebuild, +speedfreq-0.7.2.ebuild, + +speedfreq-0.7.2-r1.ebuild, +speedfreq-0.7.2-r2.ebuild: + Moved from sys-apps/speedfreq to sys-power/speedfreq. + + 09 Oct 2004; Doug Goldstein <cardoe@gentoo.org> + +speedfreq-0.7.2-r2.ebuild, +files/battery-new.sh: + added support for BAT0 and BAT1 (bug #66670) + + 03 Sep 2004; Pieter Van den Abeele <pvdabeel@gentoo.org> + speedfreq-0.7.2.ebuild: + Masked speedfreq-0.7.2.ebuild stable for ppc + + 24 Jul 2004; Michael Sterrett <mr_bones_@gentoo.org> + speedfreq-0.7.2-r1.ebuild: + posix chown (bug #58131) + + 27 Jun 2004; Aron Griffis <agriffis@gentoo.org> speedfreq-0.5.ebuild, + speedfreq-0.7.2.ebuild: + QA - fix use invocation + + 10 May 2004; Daniel Ahlberg <aliz@gentoo.org> speedfreq-0.7.2-r1.ebuild: + Added amd64 keyword, closing #50573. + +*speedfreq-0.7.2-r1 (28 Mar 2004) + + 28 Mar 2004; Mike Frysinger <vapier@gentoo.org> : + Fix python search paths and use `make install` #43118. + +*speedfreq-0.7.2 (25 Feb 2004) + + 25 Feb 2004; Michael Imhof <tantive@gentoo.org> speedfreq-0.7.2.ebuild, + files/speedfreq.rc: + Version bumped. Fixed error in init-script. + +*speedfreq-0.5 (20 Aug 2003) + + 20 Aug 2003; Christian Axelsson <smiler@lanil.mine.nu> speedfreq-0.5.ebuild : + Initial release. #26973 diff --git a/sys-power/speedfreq/Manifest b/sys-power/speedfreq/Manifest new file mode 100644 index 000000000000..5d52848d3e0c --- /dev/null +++ b/sys-power/speedfreq/Manifest @@ -0,0 +1,25 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +MD5 5101f8c8cf0a9da0ec32ef61464303a8 ChangeLog 1303 +MD5 9a09f8d531c582e78977dbfd96edc1f2 metadata.xml 164 +MD5 3fb6c0734002411db70dc59323b324a8 speedfreq-0.5.ebuild 1819 +MD5 a6a2fc75140efbe75b0627df30f43818 speedfreq-0.7.2-r1.ebuild 1931 +MD5 fecad0323b80ea17fa5ad6f4afb8b06b speedfreq-0.7.2-r2.ebuild 1947 +MD5 941c6c8b5e1f5f09034739a7524a1529 speedfreq-0.7.2.ebuild 1821 +MD5 4ae134571b43465ff61cbd376539f6cf files/0.7.2-python-ver.patch 348 +MD5 9cd026350463268af426e1a2cb8f6d97 files/battery-new.sh 1185 +MD5 d46afb4e9c52383f9cd2f8d52413e25e files/battery.sh 790 +MD5 384a3c0ba9c47cef45f4b202e69f5581 files/digest-speedfreq-0.5 64 +MD5 f96b11d757583258d2fff576c68b06e2 files/digest-speedfreq-0.7.2 66 +MD5 f96b11d757583258d2fff576c68b06e2 files/digest-speedfreq-0.7.2-r1 66 +MD5 f96b11d757583258d2fff576c68b06e2 files/digest-speedfreq-0.7.2-r2 66 +MD5 2d45ddb123b7fda1e575f896856ac082 files/speedfreq.conf 776 +MD5 845ee0032b019b990a09877bc015e838 files/speedfreq.rc 1332 +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.9.10 (GNU/Linux) + +iD8DBQFBadz6HTu7gpaalycRAh+EAKCT+lRnSIaaJu6COqWKTQVYNtLZ6QCfXxdX +bsyA0+LItFHXKftEm5NHnZg= +=AO+c +-----END PGP SIGNATURE----- diff --git a/sys-power/speedfreq/files/0.7.2-python-ver.patch b/sys-power/speedfreq/files/0.7.2-python-ver.patch new file mode 100644 index 000000000000..c6149ab3a9c7 --- /dev/null +++ b/sys-power/speedfreq/files/0.7.2-python-ver.patch @@ -0,0 +1,11 @@ +--- Makefile.orig 2004-03-28 14:01:19.591638320 -0500 ++++ Makefile 2004-03-28 14:01:45.188746968 -0500 +@@ -14,7 +14,7 @@ + MAN ?= $(PREFIX)/share/man + LIB ?= $(PREFIX)/lib + INC ?= $(PREFIX)/include +-PY_VER ?= 2.2 ++PY_VER ?= $(shell python -c "import sys; print sys.version[0:3]") + PY_INC ?= /usr/include/python$(PY_VER) + + INITD ?= /etc/rc.d/init.d diff --git a/sys-power/speedfreq/files/battery-new.sh b/sys-power/speedfreq/files/battery-new.sh new file mode 100755 index 000000000000..ab8f54e18a72 --- /dev/null +++ b/sys-power/speedfreq/files/battery-new.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# Battery acpi script that set different speedfreq modes depending on AC adapter +# Can only handle one battery at the time, will add support for more when I get time +# +# To use this script add the following lines to /etc/acpi/events/default +# event=battery.* +# action=/etc/acpi/battery.sh %e + +set $* +source /etc/conf.d/speedfreq +[ "${SPEEDFREQ_SPEED}" != "auto" ] && exit 0 + +case "$2" in + BAT0) + if [ $4 -eq 00000001 ] && [ -f /proc/acpi/battery/BAT0/state ] ; then + action="`cat /proc/acpi/battery/BAT0/state | grep charging | cut -c 26-`" + case $action in + charging) /usr/bin/speedfreq -p performance + logger "A/C adapter plugged in" + ;; + discharging) /usr/bin/speedfreq -p powersave + logger "A/C adapter plugged out" + ;; + esac + fi + ;; + + BAT1) + if [ $4 -eq 00000001 ] && [ -f /proc/acpi/battery/BAT1/state ] ; then + action="`cat /proc/acpi/battery/BAT1/state | grep charging | cut -c 26-`" + case $action in + charging) /usr/bin/speedfreq -p performance + logger "A/C adapter plugged in" + ;; + discharging) /usr/bin/speedfreq -p powersave + logger "A/C adapter plugged out" + ;; + esac + fi + ;; +esac diff --git a/sys-power/speedfreq/files/battery.sh b/sys-power/speedfreq/files/battery.sh new file mode 100755 index 000000000000..b9da7d15da5e --- /dev/null +++ b/sys-power/speedfreq/files/battery.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Battery acpi script that set different speedfreq modes depending on AC adapter +# Can only handle one battery at the time, will add support for more when I get time +# +# To use this script add the following lines to /etc/acpi/events/default +# event=battery.* +# action=/etc/acpi/battery.sh %e + +set $* +source /etc/conf.d/speedfreq +[ "${SPEEDFREQ_SPEED}" != "auto" ] && exit 0 + +case "$2" in + BAT1) + if [ $4 -eq 00000001 ] && [ -f /proc/acpi/battery/BAT1/state ] ; then + action="`cat /proc/acpi/battery/BAT1/state | grep charging | cut -c 26-`" + case $action in + charging) /usr/bin/speedfreq -p performance + logger "A/C adapter plugged in" + ;; + discharging) /usr/bin/speedfreq -p powersave + logger "A/C adapter plugged out" + ;; + esac + fi + ;; +esac diff --git a/sys-power/speedfreq/files/digest-speedfreq-0.5 b/sys-power/speedfreq/files/digest-speedfreq-0.5 new file mode 100644 index 000000000000..36b9ba324f40 --- /dev/null +++ b/sys-power/speedfreq/files/digest-speedfreq-0.5 @@ -0,0 +1 @@ +MD5 d014030819b2d54e068ba44ccb124080 speedfreq-0.5.tar.gz 14178 diff --git a/sys-power/speedfreq/files/digest-speedfreq-0.7.2 b/sys-power/speedfreq/files/digest-speedfreq-0.7.2 new file mode 100644 index 000000000000..8bf05d80f4d6 --- /dev/null +++ b/sys-power/speedfreq/files/digest-speedfreq-0.7.2 @@ -0,0 +1 @@ +MD5 2d7fd41953f888469831a3fc0b622d42 speedfreq-0.7.2.tar.gz 31079 diff --git a/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r1 b/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r1 new file mode 100644 index 000000000000..8bf05d80f4d6 --- /dev/null +++ b/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r1 @@ -0,0 +1 @@ +MD5 2d7fd41953f888469831a3fc0b622d42 speedfreq-0.7.2.tar.gz 31079 diff --git a/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r2 b/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r2 new file mode 100644 index 000000000000..8bf05d80f4d6 --- /dev/null +++ b/sys-power/speedfreq/files/digest-speedfreq-0.7.2-r2 @@ -0,0 +1 @@ +MD5 2d7fd41953f888469831a3fc0b622d42 speedfreq-0.7.2.tar.gz 31079 diff --git a/sys-power/speedfreq/files/speedfreq.conf b/sys-power/speedfreq/files/speedfreq.conf new file mode 100644 index 000000000000..4ed4d0c7fb71 --- /dev/null +++ b/sys-power/speedfreq/files/speedfreq.conf @@ -0,0 +1,17 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/files/speedfreq.conf,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +# Select here how you want your CPU to be controlled +# If you select auto you should use the battery.sh script +# provided with this ebuild to control speed depending on A/C status +# acceptable values: +# powersave maximise power savings +# performance maximise performance +# dynamic adjust speed according to CPU load (default) +# NNN set CPU to a fixed speed of NNN MHz +# auto let the init script detect current battery status +SPEEDFREQ_SPEED="auto" + +# For more options refer to `speedfreqd -h` +SPEEDFREQ_OPTS="" diff --git a/sys-power/speedfreq/files/speedfreq.rc b/sys-power/speedfreq/files/speedfreq.rc new file mode 100755 index 000000000000..585f4daa3068 --- /dev/null +++ b/sys-power/speedfreq/files/speedfreq.rc @@ -0,0 +1,51 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/files/speedfreq.rc,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +depend() { + need modules logger + use acpid +} + +check_battery() { + [ "${SPEEDFREQ_SPEED}" == "auto" ] || return 0 + + local status="" + if [ -e /proc/acpi/battery/BAT0/state ] ; then + status="$(awk '/^charging/ {print $NF}' /proc/acpi/battery/BAT0/state)" + elif [ -e /proc/acpi/battery/BAT1/state ] ; then + status="$(awk '/^charging/ {print $NF}' /proc/acpi/battery/BAT1/state)" + elif [ -e /proc/pmu/info ] ; then + status="$(awk '/^AC Power/ {print $NF}' /proc/pmu/info)" + [ ${status} -eq 1 ] \ + && status="charging" \ + || status="discharging" + fi + + case ${status} in + charging) SPEEDFREQ_SPEED=performance;; + discharging) SPEEDFREQ_SPEED=powersave;; + *) SPEEDFREQ_SPEED=performance;; + esac + return 0 +} + +start() { + check_battery + + ebegin "Starting speedfreq" + /usr/sbin/speedfreqd -P /var/run/speedfreq.pid -p ${SPEEDFREQ_SPEED} ${SPEEDFREQ_OPTS} + eend $? +} + +stop() { + ebegin "Stopping speedfreq" + if [ -e /var/run/speedfreq.pid ] ; then + local pid="$(</var/run/speedfreq.pid)" + kill ${pid} >& /dev/null + eend $? "Could not kill pid '${pid}'" + else + eend 1 "Lost pid file :(" + fi +} diff --git a/sys-power/speedfreq/metadata.xml b/sys-power/speedfreq/metadata.xml new file mode 100644 index 000000000000..96a2d586367d --- /dev/null +++ b/sys-power/speedfreq/metadata.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> +<herd>base-system</herd> +</pkgmetadata> diff --git a/sys-power/speedfreq/speedfreq-0.5.ebuild b/sys-power/speedfreq/speedfreq-0.5.ebuild new file mode 100644 index 000000000000..bc670ccc2f20 --- /dev/null +++ b/sys-power/speedfreq/speedfreq-0.5.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/speedfreq-0.5.ebuild,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +DESCRIPTION="daemon to control the CPU speed in 2.6 kernels" +HOMEPAGE="http://www.goop.org/~jeremy/speedfreq/" +SRC_URI="http://www.goop.org/~jeremy/speedfreq/${P}.tar.gz" + +LICENSE="GPL-1" +SLOT="0" +KEYWORDS="x86 ppc" +IUSE="acpi" + +DEPEND="!ppc? ( acpi? ( sys-apps/acpid ) )" + +is_2_6_kernel() { + local KV_major="$(echo "${KV}" | cut -d. -f1)" + local KV_minor="$(echo "${KV}" | cut -d. -f2)" + [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ] \ + && return 0 \ + || return 1 +} + +pkg_setup() { + check_KV + if [ ! is_2_6_kernel ] ; then + eerror "This only works with 2.6.x kernels" + die "Only works with 2.6.x kernels, not ${KV}" + fi +} + +src_compile() { + emake CFLAGS="${CFLAGS}" || die "compile of speedfreq failed" +} + +src_install() { + dosbin speedfreqd + dobin speedfreq + doman *.[38] + dolib.so libspeedfreq.so.1 + dosym libspeedfreq.so.1 /usr/lib/libspeedfreq.so + exeinto /etc/init.d ; newexe ${FILESDIR}/speedfreq.rc speedfreq + insinto /etc/conf.d ; newins ${FILESDIR}/speedfreq.conf speedfreq + insinto /usr/include + doins speedfreq.h + dodoc README + if use acpi ; then + exeinto /etc/acpi + doexe ${FILESDIR}/battery.sh + fi +} + +pkg_postinst() { + if use acpi ; then + echo + einfo "A sample script for powercontrol has been placed in /etc/acpi/battery.sh" + einfo "To use it add the following lines to your /etc/acpi/default/events" + einfo " event=battery.*" + einfo " action=/etc/acpi/battery.sh %e" + einfo "Note that this only supports one battery at the time" + echo + einfo "Configuration should be done in /etc/conf.d/speedfreq" + einfo "Make sure that you have sysfs mounted on /sys" + echo + fi +} diff --git a/sys-power/speedfreq/speedfreq-0.7.2-r1.ebuild b/sys-power/speedfreq/speedfreq-0.7.2-r1.ebuild new file mode 100644 index 000000000000..518be1d02b2e --- /dev/null +++ b/sys-power/speedfreq/speedfreq-0.7.2-r1.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/speedfreq-0.7.2-r1.ebuild,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +inherit eutils + +DESCRIPTION="daemon to control the CPU speed in 2.6 kernels" +HOMEPAGE="http://www.goop.org/~jeremy/speedfreq/" +SRC_URI="http://www.goop.org/~jeremy/speedfreq/${P}.tar.gz" + +LICENSE="GPL-1" +SLOT="0" +KEYWORDS="x86 ppc ~amd64" +IUSE="acpi" + +DEPEND="!ppc? ( acpi? ( sys-apps/acpid ) )" + +is_2_6_kernel() { + local KV_major="$(echo "${KV}" | cut -d. -f1)" + local KV_minor="$(echo "${KV}" | cut -d. -f2)" + [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ] \ + && return 0 \ + || return 1 +} + +pkg_setup() { + check_KV + if [ ! is_2_6_kernel ] ; then + eerror "This only works with 2.6.x kernels" + die "Only works with 2.6.x kernels, not ${KV}" + fi +} + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${PV}-python-ver.patch + sed -i \ + -e 's/root\.root/root:root/' Makefile \ + || die "sed Makefile failed" +} + +src_compile() { + emake CFLAGS="${CFLAGS}" || die "compile of speedfreq failed" +} + +src_install() { + make \ + PREFIX=${D}/usr \ + INITD=${T} \ + install \ + || die "make install failed" + exeinto /etc/init.d ; newexe ${FILESDIR}/speedfreq.rc speedfreq + insinto /etc/conf.d ; newins ${FILESDIR}/speedfreq.conf speedfreq + dodoc README + if use acpi ; then + exeinto /etc/acpi + doexe ${FILESDIR}/battery.sh + fi +} + +pkg_postinst() { + if use acpi ; then + echo + einfo "A sample script for powercontrol has been placed in /etc/acpi/battery.sh" + einfo "To use it add the following lines to your /etc/acpi/events/default" + einfo " event=battery.*" + einfo " action=/etc/acpi/battery.sh %e" + einfo "Note that this only supports one battery at the time" + echo + einfo "Configuration should be done in /etc/conf.d/speedfreq" + einfo "Make sure that you have sysfs mounted on /sys" + echo + fi +} diff --git a/sys-power/speedfreq/speedfreq-0.7.2-r2.ebuild b/sys-power/speedfreq/speedfreq-0.7.2-r2.ebuild new file mode 100644 index 000000000000..49a4d55cf6b6 --- /dev/null +++ b/sys-power/speedfreq/speedfreq-0.7.2-r2.ebuild @@ -0,0 +1,76 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/speedfreq-0.7.2-r2.ebuild,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +inherit eutils + +DESCRIPTION="daemon to control the CPU speed in 2.6 kernels" +HOMEPAGE="http://www.goop.org/~jeremy/speedfreq/" +SRC_URI="http://www.goop.org/~jeremy/speedfreq/${P}.tar.gz" + +LICENSE="GPL-1" +SLOT="0" +KEYWORDS="~x86 ~ppc ~amd64" +IUSE="acpi" + +DEPEND="!ppc? ( acpi? ( sys-apps/acpid ) )" + +is_2_6_kernel() { + local KV_major="$(echo "${KV}" | cut -d. -f1)" + local KV_minor="$(echo "${KV}" | cut -d. -f2)" + [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ] \ + && return 0 \ + || return 1 +} + +pkg_setup() { + check_KV + if [ ! is_2_6_kernel ] ; then + eerror "This only works with 2.6.x kernels" + die "Only works with 2.6.x kernels, not ${KV}" + fi +} + +src_unpack() { + unpack ${A} + cd ${S} + epatch ${FILESDIR}/${PV}-python-ver.patch + + sed -i \ + -e 's/root\.root/root:root/' Makefile \ + || die "sed Makefile failed" +} + +src_compile() { + emake CFLAGS="${CFLAGS}" || die "compile of speedfreq failed" +} + +src_install() { + make \ + PREFIX=${D}/usr \ + INITD=${T} \ + install \ + || die "make install failed" + exeinto /etc/init.d ; newexe ${FILESDIR}/speedfreq.rc speedfreq + insinto /etc/conf.d ; newins ${FILESDIR}/speedfreq.conf speedfreq + dodoc README + if use acpi ; then + exeinto /etc/acpi + newexe ${FILESDIR}/battery-new.sh battery.sh + fi +} + +pkg_postinst() { + if use acpi ; then + echo + einfo "A sample script for powercontrol has been placed in /etc/acpi/battery.sh" + einfo "To use it add the following lines to your /etc/acpi/events/default" + einfo " event=battery.*" + einfo " action=/etc/acpi/battery.sh %e" + einfo "Note that this only supports one battery at the time" + echo + einfo "Configuration should be done in /etc/conf.d/speedfreq" + einfo "Make sure that you have sysfs mounted on /sys" + echo + fi +} diff --git a/sys-power/speedfreq/speedfreq-0.7.2.ebuild b/sys-power/speedfreq/speedfreq-0.7.2.ebuild new file mode 100644 index 000000000000..a6a335cd2304 --- /dev/null +++ b/sys-power/speedfreq/speedfreq-0.7.2.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-power/speedfreq/speedfreq-0.7.2.ebuild,v 1.1 2005/03/14 21:57:10 ciaranm Exp $ + +DESCRIPTION="daemon to control the CPU speed in 2.6 kernels" +HOMEPAGE="http://www.goop.org/~jeremy/speedfreq/" +SRC_URI="http://www.goop.org/~jeremy/speedfreq/${P}.tar.gz" + +LICENSE="GPL-1" +SLOT="0" +KEYWORDS="x86 ppc" +IUSE="acpi" + +DEPEND="!ppc? ( acpi? ( sys-apps/acpid ) )" + +is_2_6_kernel() { + local KV_major="$(echo "${KV}" | cut -d. -f1)" + local KV_minor="$(echo "${KV}" | cut -d. -f2)" + [ "${KV_major}" -eq 2 -a "${KV_minor}" -eq 6 ] \ + && return 0 \ + || return 1 +} + +pkg_setup() { + check_KV + if [ ! is_2_6_kernel ] ; then + eerror "This only works with 2.6.x kernels" + die "Only works with 2.6.x kernels, not ${KV}" + fi +} + +src_compile() { + emake CFLAGS="${CFLAGS}" || die "compile of speedfreq failed" +} + +src_install() { + dosbin speedfreqd + dobin speedfreq + doman *.[38] + dolib.so libspeedfreq.so.1 + dosym libspeedfreq.so.1 /usr/lib/libspeedfreq.so + exeinto /etc/init.d ; newexe ${FILESDIR}/speedfreq.rc speedfreq + insinto /etc/conf.d ; newins ${FILESDIR}/speedfreq.conf speedfreq + insinto /usr/include + doins speedfreq.h + dodoc README + if use acpi ; then + exeinto /etc/acpi + doexe ${FILESDIR}/battery.sh + fi +} + +pkg_postinst() { + if use acpi ; then + echo + einfo "A sample script for powercontrol has been placed in /etc/acpi/battery.sh" + einfo "To use it add the following lines to your /etc/acpi/default/events" + einfo " event=battery.*" + einfo " action=/etc/acpi/battery.sh %e" + einfo "Note that this only supports one battery at the time" + echo + einfo "Configuration should be done in /etc/conf.d/speedfreq" + einfo "Make sure that you have sysfs mounted on /sys" + echo + fi +} |