summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-07-17 19:53:50 +0000
committerMike Frysinger <vapier@gentoo.org>2007-07-17 19:53:50 +0000
commitb851b1bd99585f36e488159dd649a680a4f2d164 (patch)
tree3dc5112c4b1b920a54cf5e90f451f9ba81bfc318 /sys-power
parentstable x86, security bug 171884 (diff)
downloadgentoo-2-b851b1bd99585f36e488159dd649a680a4f2d164.tar.gz
gentoo-2-b851b1bd99585f36e488159dd649a680a4f2d164.tar.bz2
gentoo-2-b851b1bd99585f36e488159dd649a680a4f2d164.zip
Use Gentoo defaults for /etc/acpi again since they are better than the Debian ones and fix bashism #170213 by Roy Marples. Also make sure we respect env CFLAGS.
(Portage version: 2.1.3_rc8)
Diffstat (limited to 'sys-power')
-rw-r--r--sys-power/acpid/ChangeLog11
-rw-r--r--sys-power/acpid/acpid-1.0.6.ebuild17
-rwxr-xr-xsys-power/acpid/files/acpid-1.0.6-default.sh59
-rw-r--r--sys-power/acpid/files/acpid-1.0.6-examples.diff116
4 files changed, 77 insertions, 126 deletions
diff --git a/sys-power/acpid/ChangeLog b/sys-power/acpid/ChangeLog
index fcb05aad973d..821c03e1ba3c 100644
--- a/sys-power/acpid/ChangeLog
+++ b/sys-power/acpid/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-power/acpid
-# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/ChangeLog,v 1.29 2007/07/17 19:42:55 genstef Exp $
+# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/ChangeLog,v 1.30 2007/07/17 19:53:50 vapier Exp $
+
+ 17 Jul 2007; Mike Frysinger <vapier@gentoo.org>
+ +files/acpid-1.0.6-default.sh, -files/acpid-1.0.6-examples.diff,
+ acpid-1.0.6.ebuild:
+ Use Gentoo defaults for /etc/acpi again since they are better than the
+ Debian ones and fix bashism #170213 by Roy Marples. Also make sure we
+ respect env CFLAGS.
*acpid-1.0.6 (17 Jul 2007)
diff --git a/sys-power/acpid/acpid-1.0.6.ebuild b/sys-power/acpid/acpid-1.0.6.ebuild
index 2fefc12290b6..ef9c9fd1cab2 100644
--- a/sys-power/acpid/acpid-1.0.6.ebuild
+++ b/sys-power/acpid/acpid-1.0.6.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/acpid-1.0.6.ebuild,v 1.1 2007/07/17 19:42:55 genstef Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-power/acpid/acpid-1.0.6.ebuild,v 1.2 2007/07/17 19:53:50 vapier Exp $
inherit eutils toolchain-funcs
@@ -18,8 +18,10 @@ RDEPEND=""
src_unpack() {
unpack ${A}
-
- epatch ${FILESDIR}/${P}-examples.diff
+ cd "${S}"
+ sed -i \
+ -e '/^CFLAGS /{s:=:+=:;s:-Werror -g::}' \
+ Makefile
}
src_compile() {
@@ -33,18 +35,17 @@ src_install() {
emake INSTPREFIX="${D}" install || die "emake install failed"
exeinto /etc/acpi
- doexe examples/default.sh
+ newexe "${FILESDIR}"/${P}-default.sh default.sh || die
insinto /etc/acpi/events
- doins examples/default
+ newins "${FILESDIR}"/acpid-1.0.4-default default || die
dodoc README Changelog TODO
- newinitd ${FILESDIR}/${P}-init.d acpid
- newconfd ${FILESDIR}/${P}-conf.d acpid
+ newinitd "${FILESDIR}"/${P}-init.d acpid
+ newconfd "${FILESDIR}"/${P}-conf.d acpid
docinto examples
dodoc samples/{acpi_handler.sh,sample.conf}
- dodoc examples/ac{,.sh}
docinto examples/battery
dodoc samples/battery/*
diff --git a/sys-power/acpid/files/acpid-1.0.6-default.sh b/sys-power/acpid/files/acpid-1.0.6-default.sh
new file mode 100755
index 000000000000..6db71b05cd61
--- /dev/null
+++ b/sys-power/acpid/files/acpid-1.0.6-default.sh
@@ -0,0 +1,59 @@
+#!/bin/sh
+# /etc/acpi/default.sh
+# Default acpi script that takes an entry for all actions
+
+set $*
+
+group=${1/%%/*}
+action=${1#*/}
+device=$2
+id=$3
+value=$4
+
+log_unhandled() {
+ logger "ACPI event unhandled: $*"
+}
+
+case "$group" in
+ button)
+ case "$action" in
+ power)
+ /sbin/init 0
+ ;;
+
+ # if your laptop doesnt turn on/off the display via hardware
+ # switch and instead just generates an acpi event, you can force
+ # X to turn off the display via dpms. note you will have to run
+ # 'xhost +local:0' so root can access the X DISPLAY.
+ #lid)
+ # xset dpms force off
+ # ;;
+
+ *) log_unhandled $* ;;
+ esac
+ ;;
+
+ ac_adapter)
+ case "$value" in
+ # Add code here to handle when the system is unplugged
+ # (maybe change cpu scaling to powersave mode). For
+ # multicore systems, make sure you set powersave mode
+ # for each core!
+ #*0)
+ # cpufreq-set -g powersave
+ # ;;
+
+ # Add code here to handle when the system is plugged in
+ # (maybe change cpu scaling to performance mode). For
+ # multicore systems, make sure you set performance mode
+ # for each core!
+ #*1)
+ # cpufreq-set -g performance
+ # ;;
+
+ *) log_unhandled $* ;;
+ esac
+ ;;
+
+ *) log_unhandled $* ;;
+esac
diff --git a/sys-power/acpid/files/acpid-1.0.6-examples.diff b/sys-power/acpid/files/acpid-1.0.6-examples.diff
deleted file mode 100644
index 5a8e21ff3603..000000000000
--- a/sys-power/acpid/files/acpid-1.0.6-examples.diff
+++ /dev/null
@@ -1,116 +0,0 @@
-diff -Nur acpid-1.0.6.orig/examples/ac acpid-1.0.6/examples/ac
---- acpid-1.0.6.orig/examples/ac 1970-01-01 01:00:00.000000000 +0100
-+++ acpid-1.0.6/examples/ac 2007-07-16 19:37:35.000000000 +0200
-@@ -0,0 +1,11 @@
-+# /etc/acpid/events/ac
-+# This detects changes to AC power status, and passes them to
-+# /etc/acpi/ac.sh for further processing.
-+
-+# Optionally you can specify the placeholder %e. It will pass
-+# through the whole kernel event message to the program you've
-+# specified.
-+
-+event=ac_adapter
-+action=/etc/acpi/ac.sh
-+
-diff -Nur acpid-1.0.6.orig/examples/ac.sh acpid-1.0.6/examples/ac.sh
---- acpid-1.0.6.orig/examples/ac.sh 1970-01-01 01:00:00.000000000 +0100
-+++ acpid-1.0.6/examples/ac.sh 2007-07-16 19:37:35.000000000 +0200
-@@ -0,0 +1,39 @@
-+#!/bin/sh
-+# /etc/acpid/ac.sh
-+# Detect loss of AC power and regaining of AC power, and take action
-+# appropriatly.
-+
-+# On my laptop anyway, this script doesn't not get different parameters for
-+# loss of power and regained power. So, I have to use a separate program to
-+# tell what the adapter status is.
-+
-+# This uses the spicctrl program for probing the sonypi device.
-+BACKLIGHT=$(spicctrl -B)
-+
-+if on_ac_power; then
-+ # Now on AC power.
-+
-+ # Tell longrun to go crazy.
-+ longrun -f performance
-+ longrun -s 0 100
-+
-+ # Turn up the backlight unless it's up far enough.
-+ if [ "$BACKLIGHT" -lt 108 ]; then
-+ spicctrl -b 108
-+ fi
-+else
-+ # Now off AC power.
-+
-+ # Tell longrun to be a miser.
-+ longrun -f economy
-+ longrun -s 0 50 # adjust to suite..
-+
-+ # Don't allow the screen to be too bright, but don't turn the
-+ # backlight _up_ on removal, and don't turn it all the way down, as
-+ # that is unusable on my laptop in most conditions. Adjust to
-+ # taste.
-+ if [ "$BACKLIGHT" -gt 68 ]; then
-+ spicctrl -b 68
-+ fi
-+fi
-+
-diff -Nur acpid-1.0.6.orig/examples/default acpid-1.0.6/examples/default
---- acpid-1.0.6.orig/examples/default 1970-01-01 01:00:00.000000000 +0100
-+++ acpid-1.0.6/examples/default 2007-07-16 19:37:35.000000000 +0200
-@@ -0,0 +1,18 @@
-+# This is the ACPID default configuration, it takes all
-+# events and passes them to /etc/acpi/default.sh for further
-+# processing.
-+
-+# event keeps a regular expression matching the event. To get
-+# power events only, just use something like "event=button power.*"
-+# to catch it.
-+# action keeps the command to be executed after an event occurs
-+# In case of the power event above, your entry may look this way:
-+#event=button power.*
-+#action=/sbin/init 0
-+
-+# Optionally you can specify the placeholder %e. It will pass
-+# through the whole kernel event message to the program you've
-+# specified.
-+
-+event=.*
-+action=/etc/acpi/default.sh %e
-diff -Nur acpid-1.0.6.orig/examples/default.sh acpid-1.0.6/examples/default.sh
---- acpid-1.0.6.orig/examples/default.sh 1970-01-01 01:00:00.000000000 +0100
-+++ acpid-1.0.6/examples/default.sh 2007-07-16 19:37:35.000000000 +0200
-@@ -0,0 +1,32 @@
-+#!/bin/sh
-+# Default acpi script that takes an entry for all actions
-+
-+set $*
-+
-+# Take care about the way events are reported
-+ev_type=`echo "$1" | cut -d/ -f1`
-+if [ "$ev_type" = "$1" ]; then
-+ event="$2";
-+else
-+ event=`echo "$1" | cut -d/ -f2`
-+fi
-+
-+
-+case "$ev_type" in
-+ button)
-+ case "$event" in
-+ power)
-+ logger "acpid: received a shutdown request"
-+ /sbin/init 0
-+ break
-+ ;;
-+ *)
-+ logger "acpid: action $2 is not defined"
-+ ;;
-+ esac
-+ ;;
-+
-+ *)
-+ logger "ACPI group $1 / action $2 is not defined"
-+ ;;
-+esac