a/acpid: Added acpid-2.0.0.

slackware-14.2
Damien Goutte-Gattat 13 years ago
parent b9c725baf7
commit 2ad89393a2
  1. 1
      a/acpid/acpid-2.0.0.tar.gz.sha1
  2. 114
      a/acpid/acpid.SlackBuild
  3. 18
      a/acpid/default.conf
  4. 13
      a/acpid/doinst.sh
  5. 23
      a/acpid/rc.acpid
  6. 12
      a/acpid/slack-desc

@ -0,0 +1 @@
4e4107629b731cd2a68a02d36a4e15e1d75d19fc acpid-2.0.0.tar.gz

@ -0,0 +1,114 @@
#!/bin/bash
# Build script for Slackware
# Copyright (C) 2010 Damien Goutte-Gattat
#
# Redistribution and use of this script, with or without modifications,
# 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.
#
# Contact: Damien Goutte-Gattat <dgouttegattat@incenp.org>
#
# Latest acpid sourcecode is available at:
# <http://www.tedfelix.com/linux/acpid-netlink.html>.
#
# This SlackBuild packages a version of acpid which supports the
# Netlink interface. It replaces the acpid provided in Slackware-13.0,
# which only supports the deprecated /proc/acpi/event interface.
# Source package infos
NAMESRC=${NAMESRC:-acpid}
VERSION=${VERSION:-2.0.0}
ARCHIVE=${ARCHIVE:-$NAMESRC-$VERSION.tar.gz}
WGET=${WGET:-http://www.tedfelix.com/linux/$ARCHIVE}
# Build infos
NAMEPKG=${NAMEPKG:-acpid}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-i486}
JOBS=${JOBS:-1}
EXT=${EXT:-txz}
# Directories
TMP=${TMP:-/tmp}
OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMEPKG}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
# Sanity checks
if [ $UID -eq 0 ]; then
echo "You should NOT run this script as ROOT!"
exit 1
fi
if [ ! -d $TMP ]; then
echo "$TMP does not exist or is not a directory!"
exit 1
fi
# Get and verify the source archive
if [ ! -r $ARCHIVE ]; then
wget -c -O $ARCHIVE.part "$WGET"
mv $ARCHIVE.part $ARCHIVE
fi
sha1sum -c $ARCHIVE.sha1
NAME=$(tar ft $ARCHIVE | head -n 1 | cut -d / -f 1)
# Compile and install
cd $TMP
echo "Building $ARCHIVE..."
tar xf $CWD/$ARCHIVE
cd $NAME
make -j $JOBS
install -D -s -m 0750 acpid $PKG/usr/sbin/acpid
install -D -s -m 0755 acpi_listen $PKG/usr/bin/acpi_listen
gzip -9 acpid.8 acpi_listen.8
install -D -m 644 acpid.8.gz $PKG/usr/man/man8/acpid.8.gz
install -m 644 acpi_listen.8.gz $PKG/usr/man/man8/acpi_listen.8.gz
# Install default configuration file
install -D -m 644 $CWD/default.conf $PKG/etc/acpi/events/default
# Install default event handler
install -D -m 755 samples/acpi_handler.sh $PKG/etc/acpi/acpi_handler.sh.new
# Install rc script
install -D -m 755 $CWD/rc.acpid $PKG/etc/rc.d/rc.acpid
# Install the documentation
mkdir -p $PKG/usr/doc/$NAME
install -m 644 COPYING Changelog README{,-NETLINK} TESTPLAN TODO \
$PKG/usr/doc/$NAME
# Copy slack-desc and doinst.sh files
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc
install -m 755 $CWD/doinst.sh $PKG/install/doinst.sh
# Package the tree
cd $PKG
mkdir -p $OUT
PACKAGING="
chown root:root . -R
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT
rm -rf $PKG
rm -rf $TMP/$NAME
"
if type -p fakeroot ; then
echo "$PACKAGING" | fakeroot
else
su -c "$PACKAGING"
fi

@ -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

@ -0,0 +1,13 @@
#!/bin/sh
config()
{
NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`"
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then
rm $NEW
fi
}
config etc/acpi/acpi_handler.sh.new

@ -0,0 +1,23 @@
#!/bin/sh
# Start/stop/restart acpid.
case "$1" in
start)
echo "Starting ACPI daemon: /usr/sbin/acpid"
/usr/sbin/acpid -n
;;
stop)
killall acpid
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage $0 start|stop|restart"
;;
esac

@ -0,0 +1,12 @@
|-----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: This is Ted Felix's <http://www.tedfelix.com> branch of the acpid
acpid: project, which includes support for netlink and the input layer.
acpid:
acpid:
Loading…
Cancel
Save