diff options
author | Joshua Ismael Haase Hernandez <hahj87@gmail.com> | 2011-05-19 12:44:24 -0500 |
---|---|---|
committer | Joshua Ismael Haase Hernandez <hahj87@gmail.com> | 2011-05-19 12:44:24 -0500 |
commit | 071445e6a2bb31ddf638e6f2e5362953b47e72dc (patch) | |
tree | 9ec266d72aaa5971dee2d1abbe2de511d971de87 /testing/acpid | |
parent | c14218d562c03601d6d23666f77ed0c2f0025c1b (diff) | |
parent | b8ea4461e461f0e1782e28b5810eb811423afa79 (diff) |
Merge branch 'master' of vparabola:~/abslibre-pre-mips64el into pre
Conflicts:
core/heimdal/PKGBUILD
extra/apache-ant/PKGBUILD
extra/aria2/PKGBUILD
extra/bs/PKGBUILD
extra/dosbox/PKGBUILD
extra/ettercap-gtk/PKGBUILD
extra/gqmpeg/PKGBUILD
extra/gtk-theme-switch2/PKGBUILD
extra/icecast/PKGBUILD
extra/kmldonkey/PKGBUILD
extra/kmplayer/PKGBUILD
extra/libbtctl/PKGBUILD
extra/libx86/PKGBUILD
extra/mc/PKGBUILD
extra/monotone/PKGBUILD
extra/nbsmtp/PKGBUILD
extra/nickle/PKGBUILD
extra/nppangband/PKGBUILD
extra/numlockx/PKGBUILD
extra/python-gtkglext/PKGBUILD
extra/speedcrunch/PKGBUILD
extra/vbetool/PKGBUILD
libre/xchat-gnome-libre/PKGBUILD
libre/xchat-gnome-libre/gtk2-2.20.patch
libre/xchat-gnome-libre/xchat-gnome-0.26.1-deprecated-symbol.patch
libre/xchat-gnome-libre/xchat-gnome.install
Diffstat (limited to 'testing/acpid')
-rw-r--r-- | testing/acpid/PKGBUILD | 43 | ||||
-rw-r--r-- | testing/acpid/acpid | 37 | ||||
-rw-r--r-- | testing/acpid/acpid.conf.d | 5 | ||||
-rw-r--r-- | testing/acpid/anything | 3 | ||||
-rw-r--r-- | testing/acpid/handler.sh | 65 |
5 files changed, 153 insertions, 0 deletions
diff --git a/testing/acpid/PKGBUILD b/testing/acpid/PKGBUILD new file mode 100644 index 000000000..28d94a296 --- /dev/null +++ b/testing/acpid/PKGBUILD @@ -0,0 +1,43 @@ +# $Id: PKGBUILD 124204 2011-05-17 17:28:41Z andrea $ +# Maintainer: +# Contributor: xduugu +# Contributor: Manolis Tzanidakis +# Contributor: Jonathan Schmidt <j.schmidt@archlinux.us + +pkgname=acpid +pkgver=2.0.9 +pkgrel=3 +pkgdesc="A daemon for delivering ACPI power management events with netlink support" +arch=('i686' 'x86_64') +url="http://tedfelix.com/linux/acpid-netlink.html" +license=('GPL') +depends=('bash') +source=("http://www.tedfelix.com/linux/$pkgname-$pkgver.tar.gz" + 'acpid' + 'anything' + 'handler.sh' + 'acpid.conf.d') +replaces=('acpid2') +backup=('etc/acpi/handler.sh' 'etc/acpi/events/anything' 'etc/conf.d/acpid') + +build() { + cd "${srcdir}"/$pkgname-$pkgver + make +} + +package() { + cd "${srcdir}"/$pkgname-$pkgver + make DESTDIR="${pkgdir}" install + + install -Dm755 "$srcdir/acpid" "$pkgdir/etc/rc.d/acpid" + install -Dm644 "$srcdir/anything" "$pkgdir/etc/acpi/events/anything" + install -Dm755 "$srcdir/handler.sh" "$pkgdir/etc/acpi/handler.sh" + install -Dm644 "$srcdir/acpid.conf.d" "$pkgdir/etc/conf.d/acpid" + + chmod 755 "${pkgdir}"/usr/sbin/acpid +} +md5sums=('8b30aa1b31f607161745a4ac7a19699b' + '955490c4db5233ec44461db694b873a4' + '2d37b98d6e74bab815604b8b48c6cfd4' + '7b2e4c299af5eb87e1a81c07b6916c97' + '929c6d2e91295c22ed9ec6212d7eabef') diff --git a/testing/acpid/acpid b/testing/acpid/acpid new file mode 100644 index 000000000..9177c8207 --- /dev/null +++ b/testing/acpid/acpid @@ -0,0 +1,37 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +[ -f /etc/conf.d/acpid ] && . /etc/conf.d/acpid + +PID=`pidof -o %PPID /usr/sbin/acpid` +case "$1" in + start) + stat_busy "Starting acpid" + [ -z "$PID" ] && /usr/sbin/acpid $ACPID_ARGS + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon acpid + stat_done + fi + ;; + stop) + stat_busy "Stopping acpid" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon acpid + stat_done + fi + ;; + restart) + $0 stop + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 diff --git a/testing/acpid/acpid.conf.d b/testing/acpid/acpid.conf.d new file mode 100644 index 000000000..b60103a2d --- /dev/null +++ b/testing/acpid/acpid.conf.d @@ -0,0 +1,5 @@ +# +# Arguments to be passed to the acpid daemon +# + +ACPID_ARGS="" diff --git a/testing/acpid/anything b/testing/acpid/anything new file mode 100644 index 000000000..d1828989b --- /dev/null +++ b/testing/acpid/anything @@ -0,0 +1,3 @@ +# Pass all events to our one handler script +event=.* +action=/etc/acpi/handler.sh %e diff --git a/testing/acpid/handler.sh b/testing/acpid/handler.sh new file mode 100644 index 000000000..518a62dea --- /dev/null +++ b/testing/acpid/handler.sh @@ -0,0 +1,65 @@ +#!/bin/sh +# Default acpi script that takes an entry for all actions + +# NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to +# modify it to not use /sys + +minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq` +maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` +setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed" + +set $* + +case "$1" in + button/power) + #echo "PowerButton pressed!">/dev/tty5 + case "$2" in + PWRF) logger "PowerButton pressed: $2" ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + button/sleep) + case "$2" in + SLPB) echo -n mem >/sys/power/state ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + ac_adapter) + case "$2" in + AC|ACAD|ADP0) + case "$4" in + 00000000) + echo -n $minspeed >$setspeed + #/etc/laptop-mode/laptop-mode start + ;; + 00000001) + echo -n $maxspeed >$setspeed + #/etc/laptop-mode/laptop-mode stop + ;; + esac + ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + battery) + case "$2" in + BAT0) + case "$4" in + 00000000) #echo "offline" >/dev/tty5 + ;; + 00000001) #echo "online" >/dev/tty5 + ;; + esac + ;; + CPU0) + ;; + *) logger "ACPI action undefined: $2" ;; + esac + ;; + button/lid) + #echo "LID switched!">/dev/tty5 + ;; + *) + logger "ACPI group/action undefined: $1 / $2" + ;; +esac |