wok-4.x annotate acpid/receipt @ rev 9642

Up: firefox to 4.0.1.
author Christopher Rogers <slaxemulator@gmail.com>
date Thu Apr 28 23:42:39 2011 +0000 (2011-04-28)
parents 2bbc0ef3f1d2
children a1644dbcf632
rev   line source
domcox@1379 1 # SliTaz package receipt.
domcox@1379 2
domcox@1379 3 PACKAGE="acpid"
domcox@2853 4 VERSION="1.0.10"
domcox@1379 5 CATEGORY="system-tools"
domcox@1379 6 SHORT_DESC="The ACPI event daemon"
domcox@1379 7 MAINTAINER="domcox@users.sourceforge.net"
domcox@1379 8 DEPENDS=""
slaxemulator@6640 9 BUILD_DEPENDS=""
domcox@1379 10 TARBALL="$PACKAGE-$VERSION.tar.gz"
domcox@1379 11 WEB_SITE="http://acpid.sourceforge.net/"
domcox@1379 12 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
domcox@1512 13 KEY_FILE="key-constants"
jozee@3563 14 TAGS="power-management"
domcox@1379 15
domcox@1379 16 # Rules to configure and make the package.
domcox@1379 17 compile_rules()
domcox@1379 18 {
domcox@1512 19 # Build acpi_fakekey utility
domcox@1512 20 cp -a stuff/acpi_fakekey.c .
domcox@1512 21 gcc -g -Wall -o acpi_fakekey acpi_fakekey.c
domcox@1512 22 # Generate key constants file
domcox@1512 23 INPUT_H="/usr/include/linux/input.h"
domcox@1512 24 echo -n '# Generated from $INPUT dated ' > $KEY_FILE
domcox@1512 25 date -r $INPUT_H >> $KEY_FILE
domcox@1512 26 echo "KEY_RESERVED=0" >> $KEY_FILE
domcox@1512 27 awk '/define KEY_/{if($3 <= 255 && $3 > 0) print $2"="$3}' $INPUT_H | sort -nt'=' -k2 >> $KEY_FILE
domcox@1512 28 echo "KEY_LOCK=\$KEY_COFFEE" >> $KEY_FILE
domcox@1512 29 echo "KEY_LIGHT=\$KEY_F19" >> $KEY_FILE
domcox@1512 30 echo "KEY_VIDEOOUT=\$KEY_F20" >> $KEY_FILE
domcox@1512 31 echo "KEY_ROTATESCREEN=\$KEY_F21" >> $KEY_FILE
domcox@1512 32 echo "KEY_VIDEOMODECYCLE=\$KEY_F22" >> $KEY_FILE
domcox@1512 33 echo "KEY_PRESENTATION=\KEY_F23" >> $KEY_FILE
domcox@1512 34 # Build acpid
domcox@1379 35 cd $src
domcox@1379 36 make clean && make
domcox@1379 37 make INSTPREFIX=$PWD/_pkg install
domcox@1379 38 }
domcox@1379 39
domcox@1379 40 # Rules to gen a SliTaz package suitable for Tazpkg.
domcox@1379 41 genpkg_rules()
domcox@1379 42 {
domcox@1379 43 mkdir -p $fs/usr
domcox@1512 44 # acpid
domcox@1512 45 cp -a $_pkg/usr/sbin $fs/usr
domcox@1512 46 # acpi_listen
domcox@1379 47 cp -a $_pkg/usr/bin $fs/usr
domcox@1512 48 # acpid conf files
domcox@1512 49 mkdir -p $fs/etc
domcox@1512 50 cp -a stuff/init.d $fs/etc/
domcox@1512 51 cp -a stuff/acpi $fs/etc/
domcox@1512 52 # acpi_fakekey
domcox@1512 53 cp -a acpi_fakekey $fs/usr/bin
domcox@1512 54 cp -a $KEY_FILE $fs/etc/acpi/
domcox@1379 55 }
domcox@1379 56
domcox@1379 57 # Pre and post remove commands for Tazpkg
domcox@1379 58
domcox@1379 59 pre_remove()
domcox@1379 60 {
domcox@1379 61 /etc/init.d/acpid stop
domcox@1379 62 }
domcox@1379 63
domcox@1379 64 post_remove()
domcox@1379 65 {
domcox@1379 66 if [ `ls /etc/acpi/events | wc -l` -eq 0 ]; then
domcox@1512 67 echo -n "Removing /etc/acpi/events"
domcox@1512 68 rm -rf /etc/acpi/events
domcox@1512 69 status
domcox@1512 70 fi
domcox@1512 71 if [ `ls /etc/acpi | wc -l` -eq 0 ]; then
domcox@1512 72 echo -n "Removing /etc/acpi"
domcox@1379 73 rm -rf /etc/acpi
domcox@1379 74 status
domcox@1379 75 fi
jozee@3563 76 }