wok-stable annotate acpid/receipt @ rev 1522
libgnomeprintw: fix compile_rules
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Oct 08 17:01:36 2008 +0000 (2008-10-08) |
parents | 0259fc542832 |
children | b19e50dd80d8 |
rev | line source |
---|---|
domcox@1379 | 1 # SliTaz package receipt. |
domcox@1379 | 2 |
domcox@1379 | 3 PACKAGE="acpid" |
domcox@1379 | 4 VERSION="1.0.6" |
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="" |
domcox@1379 | 9 TARBALL="$PACKAGE-$VERSION.tar.gz" |
domcox@1379 | 10 WEB_SITE="http://acpid.sourceforge.net/" |
domcox@1379 | 11 WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL" |
domcox@1512 | 12 KEY_FILE="key-constants" |
domcox@1379 | 13 |
domcox@1379 | 14 # Rules to configure and make the package. |
domcox@1379 | 15 compile_rules() |
domcox@1379 | 16 { |
domcox@1512 | 17 # Build acpi_fakekey utility |
domcox@1512 | 18 cp -a stuff/acpi_fakekey.c . |
domcox@1512 | 19 gcc -g -Wall -o acpi_fakekey acpi_fakekey.c |
domcox@1512 | 20 # Generate key constants file |
domcox@1512 | 21 INPUT_H="/usr/include/linux/input.h" |
domcox@1512 | 22 echo -n '# Generated from $INPUT dated ' > $KEY_FILE |
domcox@1512 | 23 date -r $INPUT_H >> $KEY_FILE |
domcox@1512 | 24 echo "KEY_RESERVED=0" >> $KEY_FILE |
domcox@1512 | 25 awk '/define KEY_/{if($3 <= 255 && $3 > 0) print $2"="$3}' $INPUT_H | sort -nt'=' -k2 >> $KEY_FILE |
domcox@1512 | 26 echo "KEY_LOCK=\$KEY_COFFEE" >> $KEY_FILE |
domcox@1512 | 27 echo "KEY_LIGHT=\$KEY_F19" >> $KEY_FILE |
domcox@1512 | 28 echo "KEY_VIDEOOUT=\$KEY_F20" >> $KEY_FILE |
domcox@1512 | 29 echo "KEY_ROTATESCREEN=\$KEY_F21" >> $KEY_FILE |
domcox@1512 | 30 echo "KEY_VIDEOMODECYCLE=\$KEY_F22" >> $KEY_FILE |
domcox@1512 | 31 echo "KEY_PRESENTATION=\KEY_F23" >> $KEY_FILE |
domcox@1512 | 32 # Build acpid |
domcox@1379 | 33 cd $src |
domcox@1379 | 34 make clean && make |
domcox@1379 | 35 make INSTPREFIX=$PWD/_pkg install |
domcox@1379 | 36 } |
domcox@1379 | 37 |
domcox@1379 | 38 # Rules to gen a SliTaz package suitable for Tazpkg. |
domcox@1379 | 39 genpkg_rules() |
domcox@1379 | 40 { |
domcox@1379 | 41 mkdir -p $fs/usr |
domcox@1512 | 42 # acpid |
domcox@1512 | 43 cp -a $_pkg/usr/sbin $fs/usr |
domcox@1512 | 44 # acpi_listen |
domcox@1379 | 45 cp -a $_pkg/usr/bin $fs/usr |
domcox@1512 | 46 # acpid conf files |
domcox@1512 | 47 mkdir -p $fs/etc |
domcox@1512 | 48 cp -a stuff/init.d $fs/etc/ |
domcox@1512 | 49 cp -a stuff/acpi $fs/etc/ |
domcox@1512 | 50 mkdir -p $fs/var/log/ |
domcox@1379 | 51 touch $fs/var/log/acpid.log && chmod 700 $fs/var/log/acpid.log |
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 |
domcox@1379 | 76 } |