# Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-laptop/pmud/pmud-0.10.1-r2.ebuild,v 1.4 2004/07/14 01:22:18 agriffis Exp $ FILE="laptop-mode-tools_1.00.tar.gz" DESCRIPTION="Laptopmode Tools" SRC_URI="http://www.xs4all.nl/~bsamwel/laptop_mode/tools/downloads/$FILE" #laptop-mode-tools_1.00.ebuild HOMEPAGE="http://www.xs4all.nl/~bsamwel/laptop_mode/tools/" KEYWORDS="-ppc -x86 -amd64 -alpha -hppa -mips -sparc" SLOT="0" LICENSE="GPL-2" src_unpack() { cd ${WORKDIR} unpack $FILE cd ${S} } #src_compile() { #} src_install() { echo "#!/sbin/runscript # # chkconfig: - 20 90 # description: Starts and stops "laptop-mode" - tweaks system behavior # to extend battery life. # # config: /etc/laptop-mode/laptop-mode.conf start () { ebegin \"Initializing laptop mode\" touch /var/run/laptop-mode-enabled /usr/sbin/laptop_mode auto > /dev/null eend \$? } reload () { set -e ebegin -n \"Restarting laptop mode\" /usr/sbin/laptop_mode stop > /dev/null /usr/sbin/laptop_mode start > /dev/null eend \$? } stop () { ebegin \"Stopping laptop mode\" rm -f /var/run/laptop-mode-enabled if ! ( /usr/sbin/laptop_mode stop > /dev/null ) ; then eerror \"failed.\" exit 1 fi eend \$? } " > /etc/init.d/laptop-mode echo "#!/bin/sh # # Returns 0 (true) if on AC power # 1 (false) if not on AC power # 255 (false) if can't tell # # Example shell script: # if on_ac_power; then # echo We're on AC power # else # echo Can't say we're on AC power # fi set -e # PMU if [ -r /proc/pmu/info ]; then exec awk ${S}/usr/sbin/on_ac_power echo "MAX_AGE=1800 MINIMUM_BATTERY_MINUTES=5 LAPTOP_MODE_ALWAYS_ON=1 READAHEAD=16384 BATT_HD=1 DO_REMOUNTS=1 DO_REMOUNT_NOATIME=1 HD=\"/dev/hda\"" >> ${S}/etc/laptop-mode/laptop-mode.conf dosbin ${S}/usr/sbin/* dodir /etc/laptop-mode/ insinto /etc/laptop-mode doins ${S}/etc/laptop-mode/* }