summaryrefslogtreecommitdiff
path: root/community/acpid
diff options
context:
space:
mode:
authorMichał Masłowski <mtjm@mtjm.eu>2012-03-07 18:10:48 +0100
committerMichał Masłowski <mtjm@mtjm.eu>2012-03-07 18:10:48 +0100
commit61733e7ff1a756e9325154d9d52cdcdeb27d9097 (patch)
treea0f842807088c4986fb918be0de70bac3f18ea04 /community/acpid
parent42badd081241c57a3b9bbd7a18dec85e64038314 (diff)
parent5a680f7689b01b4b7a0bfade1a6c1f659f8cbed4 (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts: community/bin2iso/PKGBUILD community/espeak/PKGBUILD community/gnash/PKGBUILD community/gtk2hs-buildtools/PKGBUILD community/haskell-binary/PKGBUILD community/haskell-dataenc/PKGBUILD community/haskell-ghc-paths/PKGBUILD community/haskell-haskeline/PKGBUILD community/haskell-hslogger/PKGBUILD community/haskell-tar/PKGBUILD community/haskell-terminfo/PKGBUILD community/haskell-utf8-string/PKGBUILD community/haskell-x11-xft/PKGBUILD community/kmess/PKGBUILD community/libident/PKGBUILD community/lwm/PKGBUILD core/dialog/PKGBUILD core/gcc/PKGBUILD core/libtool/PKGBUILD core/ppl/PKGBUILD extra/boost/PKGBUILD extra/dnsmasq/PKGBUILD extra/ghc/PKGBUILD extra/haskell-html/PKGBUILD extra/haskell-http/PKGBUILD extra/haskell-mtl/PKGBUILD extra/haskell-network/PKGBUILD extra/haskell-parsec/PKGBUILD extra/haskell-quickcheck/PKGBUILD extra/haskell-regex-base/PKGBUILD extra/haskell-regex-compat/PKGBUILD extra/haskell-regex-posix/PKGBUILD extra/haskell-text/PKGBUILD extra/haskell-transformers/PKGBUILD extra/haskell-zlib/PKGBUILD extra/liborigin2/PKGBUILD extra/libpst/PKGBUILD extra/mkvtoolnix/PKGBUILD extra/pekwm/PKGBUILD extra/soprano/PKGBUILD extra/udisks/PKGBUILD multilib-testing/lib32-libpciaccess/PKGBUILD multilib/gcc-multilib/PKGBUILD multilib/lib32-glibc/PKGBUILD multilib/lib32-glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch multilib/lib32-glibc/glibc-2.15-ifunc.patch multilib/lib32-glibc/glibc-2.15-revert-netlink-cache.patch multilib/lib32-glibc/glibc-2.15-scanf.patch multilib/libtool-multilib/PKGBUILD staging/kdeedu-kig/PKGBUILD staging/kdeedu-rocs/PKGBUILD testing/libpciaccess/PKGBUILD testing/mkinitcpio-busybox/PKGBUILD testing/xorg-server/PKGBUILD
Diffstat (limited to 'community/acpid')
-rw-r--r--community/acpid/PKGBUILD43
-rw-r--r--community/acpid/acpid38
-rw-r--r--community/acpid/acpid.conf.d5
-rw-r--r--community/acpid/anything3
-rw-r--r--community/acpid/handler.sh70
5 files changed, 159 insertions, 0 deletions
diff --git a/community/acpid/PKGBUILD b/community/acpid/PKGBUILD
new file mode 100644
index 000000000..fa62a9ebb
--- /dev/null
+++ b/community/acpid/PKGBUILD
@@ -0,0 +1,43 @@
+# $Id: PKGBUILD 67166 2012-03-05 00:42:11Z pschmitz $
+# Maintainer:
+# Contributor: xduugu
+# Contributor: Manolis Tzanidakis
+# Contributor: Jonathan Schmidt <j.schmidt@archlinux.us
+
+pkgname=acpid
+pkgver=2.0.14
+pkgrel=1
+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')
+replaces=('acpid2')
+backup=('etc/acpi/handler.sh' 'etc/acpi/events/anything' 'etc/conf.d/acpid')
+source=("http://www.tedfelix.com/linux/$pkgname-$pkgver.tar.gz"
+ 'acpid'
+ 'anything'
+ 'handler.sh'
+ 'acpid.conf.d')
+md5sums=('14fc1eabc3489f3ded9347fcd55f158a'
+ 'd69203a032c4583f9abaafcf21a7ed84'
+ '2d37b98d6e74bab815604b8b48c6cfd4'
+ 'd411b758e8531adee191b66bcbc2892d'
+ '929c6d2e91295c22ed9ec6212d7eabef')
+
+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
+}
diff --git a/community/acpid/acpid b/community/acpid/acpid
new file mode 100644
index 000000000..288ac078d
--- /dev/null
+++ b/community/acpid/acpid
@@ -0,0 +1,38 @@
+#!/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
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0
diff --git a/community/acpid/acpid.conf.d b/community/acpid/acpid.conf.d
new file mode 100644
index 000000000..b60103a2d
--- /dev/null
+++ b/community/acpid/acpid.conf.d
@@ -0,0 +1,5 @@
+#
+# Arguments to be passed to the acpid daemon
+#
+
+ACPID_ARGS=""
diff --git a/community/acpid/anything b/community/acpid/anything
new file mode 100644
index 000000000..d1828989b
--- /dev/null
+++ b/community/acpid/anything
@@ -0,0 +1,3 @@
+# Pass all events to our one handler script
+event=.*
+action=/etc/acpi/handler.sh %e
diff --git a/community/acpid/handler.sh b/community/acpid/handler.sh
new file mode 100644
index 000000000..505ed7c11
--- /dev/null
+++ b/community/acpid/handler.sh
@@ -0,0 +1,70 @@
+#!/bin/sh
+# Default acpi script that takes an entry for all actions
+
+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
+ PBTN|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)
+ case "$3" in
+ close)
+ #echo "LID closed!">/dev/tty5
+ ;;
+ open)
+ #echo "LID opened!">/dev/tty5
+ ;;
+ esac
+ ;;
+
+ *)
+ logger "ACPI group/action undefined: $1 / $2"
+ ;;
+esac