# HG changeset patch # User Dominique Corbex # Date 1221209443 -7200 # Node ID 0259fc5428324d205750e3785376e3a16b01de2a # Parent 1a375f41366b5eef339fb70d5f86686c876faba6 Add: acpid diff -r 1a375f41366b -r 0259fc542832 acpid/receipt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/acpid/receipt Fri Sep 12 10:50:43 2008 +0200 @@ -0,0 +1,48 @@ +# SliTaz package receipt. + +PACKAGE="acpid" +VERSION="1.0.6" +CATEGORY="system-tools" +SHORT_DESC="The ACPI event daemon" +MAINTAINER="domcox@users.sourceforge.net" +DEPENDS="" +TARBALL="$PACKAGE-$VERSION.tar.gz" +WEB_SITE="http://acpid.sourceforge.net/" +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" + +# Rules to configure and make the package. +compile_rules() +{ + cd $src + make clean && make + make INSTPREFIX=$PWD/_pkg install +} + +# Rules to gen a SliTaz package suitable for Tazpkg. +genpkg_rules() +{ + mkdir -p $fs/usr + cp -a $_pkg/usr/bin $fs/usr + cp -a $_pkg/usr/sbin $fs/usr + mkdir -p $fs/etc/init.d + cp -a stuff/acpid $fs/etc/init.d + mkdir -p $fs/etc/acpi/events + cp -a stuff/power $fs/etc/acpi/events + touch $fs/var/log/acpid.log && chmod 700 $fs/var/log/acpid.log +} + +# Pre and post remove commands for Tazpkg + +pre_remove() +{ + /etc/init.d/acpid stop +} + +post_remove() +{ + if [ `ls /etc/acpi/events | wc -l` -eq 0 ]; then + echo -n "Removing /etc/acpi..." + rm -rf /etc/acpi + status + fi +} \ No newline at end of file diff -r 1a375f41366b -r 0259fc542832 acpid/stuff/acpid --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/acpid/stuff/acpid Fri Sep 12 10:50:43 2008 +0200 @@ -0,0 +1,55 @@ +#!/bin/sh +# /etc/init.d/acpid: Start, stop and restart acpid deamon on SliTaz, at boot +# time or with the command line. +# +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. +# +. /etc/init.d/rc.functions +. /etc/daemons.conf + +NAME=acpid +DESC="ACPI event deamon" +DAEMON=/usr/sbin/acpid +OPTIONS=$ACPID_OPTIONS +PIDFILE=/var/run/acpid.pid + +case "$1" in + start) + if [ -f $PIDFILE ] ; then + echo "$NAME already running." + exit 1 + fi + echo -n "Starting $DESC: $NAME... " + $DAEMON $OPTIONS > /dev/null + status + ;; + stop) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Stopping $DESC: $NAME... " + kill `cat $PIDFILE` + status + ;; + restart) + if [ ! -f $PIDFILE ] ; then + echo "$NAME is not running." + exit 1 + fi + echo -n "Restarting $DESC: $NAME... " + kill `cat $PIDFILE` + sleep 2 + $DAEMON $OPTIONS > /dev/null + status + ;; + *) + echo "" + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" + echo "" + exit 1 + ;; +esac + +exit 0 diff -r 1a375f41366b -r 0259fc542832 acpid/stuff/power --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/acpid/stuff/power Fri Sep 12 10:50:43 2008 +0200 @@ -0,0 +1,4 @@ +# This is a sample ACPID configuration + +event=button power.* +action=/usr/bin/desktopbox logout