diff options
author | James Meyer <james.meyer@operamail.com> | 2008-11-08 17:08:28 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2008-11-08 17:08:28 (GMT) |
commit | c38715641e214272ad7dc6d495edd29940366e7f (patch) | |
tree | 9dcd507543e67458d98fa7462f62026041524047 /abs/core-testing/acpid | |
parent | 3d91b06198a56b6579cb0bd77de65f5908571b87 (diff) | |
download | linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.zip linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.tar.gz linhes_pkgbuild-c38715641e214272ad7dc6d495edd29940366e7f.tar.bz2 |
packages that will be needed in the future.
This is the initial merge of packages from MythVantage that are not MythVantage specific.
Diffstat (limited to 'abs/core-testing/acpid')
-rw-r--r-- | abs/core-testing/acpid/Makefile | 56 | ||||
-rw-r--r-- | abs/core-testing/acpid/PKGBUILD | 31 | ||||
-rwxr-xr-x | abs/core-testing/acpid/acpi_handler.sh | 23 | ||||
-rw-r--r-- | abs/core-testing/acpid/acpid | 35 | ||||
-rw-r--r-- | abs/core-testing/acpid/acpid-1.0.4-gcc4.patch | 20 | ||||
-rw-r--r-- | abs/core-testing/acpid/anything | 3 | ||||
-rw-r--r-- | abs/core-testing/acpid/default | 20 | ||||
-rwxr-xr-x | abs/core-testing/acpid/handler.sh | 69 |
8 files changed, 257 insertions, 0 deletions
diff --git a/abs/core-testing/acpid/Makefile b/abs/core-testing/acpid/Makefile new file mode 100644 index 0000000..a5fe385 --- /dev/null +++ b/abs/core-testing/acpid/Makefile @@ -0,0 +1,56 @@ +# Makefile for ACPI daemon + +# update these numbers for new releases +VERSION = 1.0.6 + +INSTPREFIX = +BINDIR = $(INSTPREFIX)/usr/bin +SBINDIR = $(INSTPREFIX)/usr/sbin +MAN8DIR = $(INSTPREFIX)/usr/share/man/man8 + +SBIN_PROGS = acpid +BIN_PROGS = acpi_listen +PROGS = $(SBIN_PROGS) $(BIN_PROGS) + +acpid_SRCS = acpid.c event.c ud_socket.c +acpid_OBJS = $(acpid_SRCS:.c=.o) + +acpi_listen_SRCS = acpi_listen.c ud_socket.c +acpi_listen_OBJS = $(acpi_listen_SRCS:.c=.o) + +MAN8 = acpid.8 acpi_listen.8 +MAN8GZ = $(MAN8:.8=.8.gz) + +CFLAGS = -Wall -Werror -g $(DEFS) -D_GNU_SOURCE +DEFS = -DVERSION="\"$(VERSION)\"" + +all: $(PROGS) + +acpid: $(acpid_OBJS) + +acpi_listen: $(acpi_listen_OBJS) + +man: $(MAN8) + for a in $^; do gzip -f -9 -c $$a > $$a.gz; done + +install: $(PROGS) man + mkdir -p $(SBINDIR) + mkdir -p $(BINDIR) + install -m 750 acpid $(SBINDIR) + install -m 755 acpi_listen $(BINDIR) + mkdir -p $(MAN8DIR) + install -m 644 $(MAN8GZ) $(MAN8DIR) + +DISTTMP=/tmp +dist: + rm -rf $(DISTTMP)/acpid-$(VERSION) + mkdir -p $(DISTTMP)/acpid-$(VERSION) + cp -a * $(DISTTMP)/acpid-$(VERSION) + find $(DISTTMP)/acpid-$(VERSION) -type d -name CVS | xargs rm -rf + make -C $(DISTTMP)/acpid-$(VERSION) clean + tar -C $(DISTTMP) -zcvf acpid-$(VERSION).tar.gz acpid-$(VERSION) + rm -rf $(DISTTMP)/acpid-$(VERSION) + +clean: + $(RM) $(PROGS) $(MAN8GZ) *.o + diff --git a/abs/core-testing/acpid/PKGBUILD b/abs/core-testing/acpid/PKGBUILD new file mode 100644 index 0000000..f39bbc1 --- /dev/null +++ b/abs/core-testing/acpid/PKGBUILD @@ -0,0 +1,31 @@ + +pkgname=acpid +pkgver=1.0.6 +pkgrel=3 +arch=('i686') +pkgdesc="Utilities for using ACPI power management" +url="http://acpid.sourceforge.net" +depends=(glibc) +source=(http://easynews.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz + acpid-1.0.4-gcc4.patch + acpid + anything + handler.sh + Makefile ) +backup=('etc/acpi/handler.sh' 'etc/acpi/events/anything') +#options='-D_GNU_SOURCE' +MAKEFLAGS="-j2" + +build() { + cd $startdir/src/$pkgname-$pkgver + # patch -Np1 -i ${startdir}/src/acpid-1.0.4-gcc4.patch || return 1 + cp ../Makefile . + /usr/bin/make || return 1 + /bin/install -d -m0755 $startdir/pkg/usr/bin + /usr/bin/make INSTPREFIX=$startdir/pkg \ + MAN8DIR=$startdir/pkg/usr/man/man8 install + /bin/install -D -m0755 ../acpid $startdir/pkg/etc/rc.d/acpid + /bin/install -d -m0755 $startdir/pkg/etc/acpi/events + /bin/install -D -m0644 ../anything $startdir/pkg/etc/acpi/events/anything + /bin/install -D -m0755 ../handler.sh $startdir/pkg/etc/acpi/handler.sh +} diff --git a/abs/core-testing/acpid/acpi_handler.sh b/abs/core-testing/acpid/acpi_handler.sh new file mode 100755 index 0000000..65e4ee5 --- /dev/null +++ b/abs/core-testing/acpid/acpi_handler.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# Default acpi script that takes an entry for all actions +set $* +EVENT=`echo $1 |cut -d/ -f1` +ACTION=`echo $1|cut -d/ -f2` + +#echo $EVENT +#echo $ACTION +case "$EVENT" in + button) + case "$ACTION" in + power) + echo Please wait while the system powers off | /usr/local/bin/putfifo /tmp/onscreen & + xsay "Please wait while the system powers off" & + /sbin/init 0 + ;; + *) logger "ACPI action $2 is not defined" + ;; + esac + ;; + *) logger "ACPI group $1 / action $2 is not defined" + ;; +esac diff --git a/abs/core-testing/acpid/acpid b/abs/core-testing/acpid/acpid new file mode 100644 index 0000000..585944f --- /dev/null +++ b/abs/core-testing/acpid/acpid @@ -0,0 +1,35 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/acpid` +case "$1" in + start) + stat_busy "Starting acpid" + [ -z "$PID" ] && /usr/sbin/acpid + 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/abs/core-testing/acpid/acpid-1.0.4-gcc4.patch b/abs/core-testing/acpid/acpid-1.0.4-gcc4.patch new file mode 100644 index 0000000..b56901d --- /dev/null +++ b/abs/core-testing/acpid/acpid-1.0.4-gcc4.patch @@ -0,0 +1,20 @@ +--- acpid-1.0.4/ud_socket.c 2005-04-26 10:26:29.000000000 +0000 ++++ acpid-1.0.4.az/ud_socket.c 2005-04-26 10:27:09.000000000 +0000 +@@ -60,7 +60,7 @@ + struct sockaddr_un cliaddr; + int len = sizeof(struct sockaddr_un); + +- newsock = accept(listenfd, (struct sockaddr *)&cliaddr, &len); ++ newsock = accept(listenfd, (struct sockaddr *)&cliaddr, (socklen_t *)&len); + if (newsock < 0) { + if (errno == EINTR) { + continue; /* signal */ +@@ -71,7 +71,7 @@ + + if (cred) { + len = sizeof(struct ucred); +- getsockopt(newsock, SOL_SOCKET, SO_PEERCRED,cred,&len); ++ getsockopt(newsock, SOL_SOCKET, SO_PEERCRED,cred,(socklen_t *)&len); + } + + return newsock; diff --git a/abs/core-testing/acpid/anything b/abs/core-testing/acpid/anything new file mode 100644 index 0000000..d182898 --- /dev/null +++ b/abs/core-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/abs/core-testing/acpid/default b/abs/core-testing/acpid/default new file mode 100644 index 0000000..93944aa --- /dev/null +++ b/abs/core-testing/acpid/default @@ -0,0 +1,20 @@ +# 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 +#This halts the computer when the Power button is pressed. + +event=button power.* +#action=/sbin/shutdown -h now +action=/usr/local/sbin/shutdown.sh + +# 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/acpi_handler.sh %e diff --git a/abs/core-testing/acpid/handler.sh b/abs/core-testing/acpid/handler.sh new file mode 100755 index 0000000..b885f77 --- /dev/null +++ b/abs/core-testing/acpid/handler.sh @@ -0,0 +1,69 @@ +#!/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" + xsay "Please wait while the system powers off" & + /sbin/halt-runit + ;; + *) 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) + 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 |