summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCiaran McCreesh <ciaranm@gentoo.org>2005-03-14 21:57:10 +0000
committerCiaran McCreesh <ciaranm@gentoo.org>2005-03-14 21:57:10 +0000
commit31c69657f5b21833cc13f8131e16b8aceafd8ec0 (patch)
treef7d09ad3d92e6aa2f993543298ba51318e79fa9f /sys-power/speedfreq/speedfreq-0.7.2.ebuild
parentEbuild for 3.2 final. (diff)
downloadhistorical-31c69657f5b21833cc13f8131e16b8aceafd8ec0.tar.gz
historical-31c69657f5b21833cc13f8131e16b8aceafd8ec0.tar.bz2
historical-31c69657f5b21833cc13f8131e16b8aceafd8ec0.zip
Moved from sys-apps/speedfreq to sys-power/speedfreq.
Diffstat (limited to 'sys-power/speedfreq/speedfreq-0.7.2.ebuild')
-rw-r--r--sys-power/speedfreq/speedfreq-0.7.2.ebuild66
1 files changed, 66 insertions, 0 deletions
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
+}