# Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/speedfreq/speedfreq-0.7.2-r4.ebuild,v 1.2 2005/03/29 22:26:27 stkn 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" IUSE="acpi" DEPEND="!ppc? ( acpi? ( sys-power/acpid ) ) sys-apps/powermgmt-base" RDEPEND="virtual/logger" 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-${PVR} speedfreq insinto /etc/conf.d ; newins ${FILESDIR}/speedfreq.conf-${PVR} speedfreq dodoc README if useq acpi ; then exeinto /etc/acpi/events doexe ${FILESDIR}/speedfreq_battery fi } pkg_postinst() { echo einfo "Configuration should be done in /etc/conf.d/speedfreq" einfo "Make sure that you have sysfs mounted on /sys" if useq acpi ; then einfo "Please restart acpid for the changes to take effect:" einfo " $ /etc/init.d/acpid restart" fi echo }