summaryrefslogtreecommitdiffstats
path: root/source/a/acpid
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/acpid')
-rw-r--r--source/a/acpid/acpi_handler.sh19
-rwxr-xr-xsource/a/acpid/acpid.SlackBuild74
-rw-r--r--source/a/acpid/default18
-rw-r--r--source/a/acpid/doinst.sh13
-rw-r--r--source/a/acpid/rc.acpid36
-rw-r--r--source/a/acpid/slack-desc19
6 files changed, 179 insertions, 0 deletions
diff --git a/source/a/acpid/acpi_handler.sh b/source/a/acpid/acpi_handler.sh
new file mode 100644
index 000000000..386fa8d05
--- /dev/null
+++ b/source/a/acpid/acpi_handler.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+# Default acpi script that takes an entry for all actions
+
+IFS=${IFS}/
+set $@
+
+case "$1" in
+ button)
+ case "$2" in
+ power) /sbin/init 0
+ ;;
+ *) logger "ACPI action $2 is not defined"
+ ;;
+ esac
+ ;;
+ *)
+ logger "ACPI group $1 / action $2 is not defined"
+ ;;
+esac
diff --git a/source/a/acpid/acpid.SlackBuild b/source/a/acpid/acpid.SlackBuild
new file mode 100755
index 000000000..3010e0136
--- /dev/null
+++ b/source/a/acpid/acpid.SlackBuild
@@ -0,0 +1,74 @@
+#!/bin/sh
+
+# Copyright 2009 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+VERSION=1.0.8
+ARCH=${ARCH:-x86_64}
+BUILD=${BUILD:-2}
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-acpid
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+
+cd $TMP
+rm -rf acpid-$VERSION
+tar xvf $CWD/acpid-$VERSION.tar.?z* || exit 1
+cd acpid-$VERSION || exit 1
+chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+make || exit 1
+strip acpid acpi_listen
+mkdir -p $PKG/usr/sbin
+cat acpid > $PKG/usr/sbin/acpid
+chmod 755 $PKG/usr/sbin/acpid
+mkdir -p $PKG/usr/bin
+cat acpi_listen > $PKG/usr/bin/acpi_listen
+chmod 755 $PKG/usr/bin/acpi_listen
+mkdir -p $PKG/usr/man/man8
+cat acpid.8 | gzip -9c > $PKG/usr/man/man8/acpid.8.gz
+cat acpi_listen.8 | gzip -9c > $PKG/usr/man/man8/acpi_listen.8.gz
+mkdir -p $PKG/usr/doc/acpid-$VERSION
+cp -a Changelog README \
+ $PKG/usr/doc/acpid-$VERSION
+cp -a samples $PKG/usr/doc/acpid-$VERSION
+mkdir -p $PKG/etc/acpi/events
+zcat $CWD/acpi_handler.sh.gz > $PKG/etc/acpi/acpi_handler.sh.new
+chmod 755 $PKG/etc/acpi/acpi_handler.sh.new
+zcat $CWD/default.gz > $PKG/etc/acpi/events/default
+mkdir -p $PKG/etc/rc.d
+zcat $CWD/rc.acpid.gz > $PKG/etc/rc.d/rc.acpid
+chmod 755 $PKG/etc/rc.d/rc.acpid
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
+
+# Build the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/acpid-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source/a/acpid/default b/source/a/acpid/default
new file mode 100644
index 000000000..db1233908
--- /dev/null
+++ b/source/a/acpid/default
@@ -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/acpi_handler.sh %e
diff --git a/source/a/acpid/doinst.sh b/source/a/acpid/doinst.sh
new file mode 100644
index 000000000..c090b9fe5
--- /dev/null
+++ b/source/a/acpid/doinst.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+config() {
+ NEW="$1"
+ OLD="`dirname $NEW`/`basename $NEW .new`"
+ # If there's no config file by that name, mv it over:
+ if [ ! -r $OLD ]; then
+ mv $NEW $OLD
+ elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+ rm $NEW
+ fi
+ # Otherwise, we leave the .new copy for the admin to consider...
+}
+config etc/acpi/acpi_handler.sh.new
diff --git a/source/a/acpid/rc.acpid b/source/a/acpid/rc.acpid
new file mode 100644
index 000000000..32486d17c
--- /dev/null
+++ b/source/a/acpid/rc.acpid
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Start/stop/restart acpid.
+
+# Start acpid:
+acpid_start() {
+ if [ -x /usr/sbin/acpid -a -d /proc/acpi ]; then
+ echo "Starting ACPI daemon: /usr/sbin/acpid"
+ /usr/sbin/acpid
+ fi
+}
+
+# Stop acpid:
+acpid_stop() {
+ killall acpid
+}
+
+# Restart acpid:
+acpid_restart() {
+ acpid_stop
+ sleep 1
+ acpid_start
+}
+
+case "$1" in
+'start')
+ acpid_start
+ ;;
+'stop')
+ acpid_stop
+ ;;
+'restart')
+ acpid_restart
+ ;;
+*)
+ echo "usage $0 start|stop|restart"
+esac
diff --git a/source/a/acpid/slack-desc b/source/a/acpid/slack-desc
new file mode 100644
index 000000000..b72ac8e62
--- /dev/null
+++ b/source/a/acpid/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|' on
+# the right side marks the last column you can put a character in. You must make
+# exactly 11 lines for the formatting to be correct. It's also customary to
+# leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+acpid: acpid (ACPI daemon)
+acpid:
+acpid: Most modern computers support the Advanced Configuration and Power
+acpid: Interface (ACPI) standard to allow intelligent power management.
+acpid: This package contains acpid, which is the user-space daemon needed in
+acpid: order to make the Linux ACPI support completely functional.
+acpid:
+acpid: ACPI must be compiled into the kernel to run acpid.
+acpid:
+acpid:
+acpid: