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