wok-current rev 1379
Add: acpid
author | Dominique Corbex <domcox@users.sourceforge.net> |
---|---|
date | Fri Sep 12 10:50:43 2008 +0200 (2008-09-12) |
parents | 1a375f41366b |
children | 4574379dbc68 |
files | acpid/receipt acpid/stuff/acpid acpid/stuff/power |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/acpid/receipt Fri Sep 12 10:50:43 2008 +0200 1.3 @@ -0,0 +1,48 @@ 1.4 +# SliTaz package receipt. 1.5 + 1.6 +PACKAGE="acpid" 1.7 +VERSION="1.0.6" 1.8 +CATEGORY="system-tools" 1.9 +SHORT_DESC="The ACPI event daemon" 1.10 +MAINTAINER="domcox@users.sourceforge.net" 1.11 +DEPENDS="" 1.12 +TARBALL="$PACKAGE-$VERSION.tar.gz" 1.13 +WEB_SITE="http://acpid.sourceforge.net/" 1.14 +WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" 1.15 + 1.16 +# Rules to configure and make the package. 1.17 +compile_rules() 1.18 +{ 1.19 + cd $src 1.20 + make clean && make 1.21 + make INSTPREFIX=$PWD/_pkg install 1.22 +} 1.23 + 1.24 +# Rules to gen a SliTaz package suitable for Tazpkg. 1.25 +genpkg_rules() 1.26 +{ 1.27 + mkdir -p $fs/usr 1.28 + cp -a $_pkg/usr/bin $fs/usr 1.29 + cp -a $_pkg/usr/sbin $fs/usr 1.30 + mkdir -p $fs/etc/init.d 1.31 + cp -a stuff/acpid $fs/etc/init.d 1.32 + mkdir -p $fs/etc/acpi/events 1.33 + cp -a stuff/power $fs/etc/acpi/events 1.34 + touch $fs/var/log/acpid.log && chmod 700 $fs/var/log/acpid.log 1.35 +} 1.36 + 1.37 +# Pre and post remove commands for Tazpkg 1.38 + 1.39 +pre_remove() 1.40 +{ 1.41 + /etc/init.d/acpid stop 1.42 +} 1.43 + 1.44 +post_remove() 1.45 +{ 1.46 + if [ `ls /etc/acpi/events | wc -l` -eq 0 ]; then 1.47 + echo -n "Removing /etc/acpi..." 1.48 + rm -rf /etc/acpi 1.49 + status 1.50 + fi 1.51 +} 1.52 \ No newline at end of file
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/acpid/stuff/acpid Fri Sep 12 10:50:43 2008 +0200 2.3 @@ -0,0 +1,55 @@ 2.4 +#!/bin/sh 2.5 +# /etc/init.d/acpid: Start, stop and restart acpid deamon on SliTaz, at boot 2.6 +# time or with the command line. 2.7 +# 2.8 +# To start daemon at boot time, just put the right name in the $RUN_DAEMONS 2.9 +# variable of /etc/rcS.conf and configure options with /etc/daemons.conf. 2.10 +# 2.11 +. /etc/init.d/rc.functions 2.12 +. /etc/daemons.conf 2.13 + 2.14 +NAME=acpid 2.15 +DESC="ACPI event deamon" 2.16 +DAEMON=/usr/sbin/acpid 2.17 +OPTIONS=$ACPID_OPTIONS 2.18 +PIDFILE=/var/run/acpid.pid 2.19 + 2.20 +case "$1" in 2.21 + start) 2.22 + if [ -f $PIDFILE ] ; then 2.23 + echo "$NAME already running." 2.24 + exit 1 2.25 + fi 2.26 + echo -n "Starting $DESC: $NAME... " 2.27 + $DAEMON $OPTIONS > /dev/null 2.28 + status 2.29 + ;; 2.30 + stop) 2.31 + if [ ! -f $PIDFILE ] ; then 2.32 + echo "$NAME is not running." 2.33 + exit 1 2.34 + fi 2.35 + echo -n "Stopping $DESC: $NAME... " 2.36 + kill `cat $PIDFILE` 2.37 + status 2.38 + ;; 2.39 + restart) 2.40 + if [ ! -f $PIDFILE ] ; then 2.41 + echo "$NAME is not running." 2.42 + exit 1 2.43 + fi 2.44 + echo -n "Restarting $DESC: $NAME... " 2.45 + kill `cat $PIDFILE` 2.46 + sleep 2 2.47 + $DAEMON $OPTIONS > /dev/null 2.48 + status 2.49 + ;; 2.50 + *) 2.51 + echo "" 2.52 + echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]" 2.53 + echo "" 2.54 + exit 1 2.55 + ;; 2.56 +esac 2.57 + 2.58 +exit 0