wok annotate pm-utils/receipt @ rev 18297

Up linux (3.2.71), again
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Aug 17 13:02:26 2015 +0200 (2015-08-17)
parents 51a1ebbda768
children 9e01bc6321ea
rev   line source
domcox@2655 1 # SliTaz package receipt.
domcox@2655 2
domcox@2655 3 PACKAGE="pm-utils"
domcox@6084 4 VERSION="1.4.1"
domcox@2655 5 CATEGORY="system-tools"
domcox@12202 6 SHORT_DESC="Collection of scripts that handle suspend and resume."
domcox@12202 7 MAINTAINER="domcox@slitaz.org"
pascal@15375 8 LICENSE="GPL2"
domcox@2655 9 TARBALL="$PACKAGE-$VERSION.tar.gz"
domcox@2655 10 WEB_SITE="http://pm-utils.freedesktop.org/"
domcox@2655 11 WGET_URL="http://pm-utils.freedesktop.org/releases/$TARBALL"
domcox@12202 12 CONFIG_FILES="/etc/pm"
domcox@6097 13 TAGS="power-management"
domcox@2655 14
pascal@15375 15 DEPENDS="bash kbd"
pascal@15375 16
domcox@2655 17 # Rules to configure and make the package.
domcox@2655 18 compile_rules()
domcox@2655 19 {
domcox@2655 20 cd $src
domcox@12209 21 # workaround grep -x not implemented in busybox
domcox@12209 22 echo -n "Applying grep -x patch.."
domcox@12209 23 patch -p1 pm/functions.in $stuff/grep-x.patch > /dev/null \
domcox@12209 24 && echo done. || echo failed.
domcox@12209 25 # remove acoustic management not implemented in busybox
domcox@12209 26 echo -n "Applying harddrive patch.."
domcox@12209 27 patch -p1 pm/power.d/harddrive $stuff/harddrive.patch > /dev/null \
domcox@12209 28 && echo done. || echo failed.
domcox@12209 29 # build
domcox@2655 30 ./configure \
domcox@2655 31 --prefix=/usr \
domcox@12202 32 --sysconfdir=/etc \
domcox@2655 33 $CONFIGURE_ARGS &&
domcox@2655 34 make &&
pascal@15375 35 make DESTDIR=$DESTDIR install
domcox@2655 36 }
domcox@2655 37
domcox@2655 38 # Rules to gen a SliTaz package suitable for Tazpkg.
domcox@2655 39 genpkg_rules()
domcox@2655 40 {
domcox@12209 41 # main
domcox@12202 42 mkdir -p $fs/usr/lib
pascal@15375 43 cp -a $install/usr/bin $fs/usr
pascal@15375 44 cp -a $install/usr/sbin $fs/usr
pascal@15375 45 cp -a $install/usr/lib/pm-utils $fs/usr/lib
domcox@12209 46
domcox@12209 47 # sysconfig
domcox@2655 48 mkdir -p $fs/etc
pascal@15375 49 cp -a $install/etc/pm $fs/etc
domcox@12209 50
domcox@12209 51 # remove incompatible hooks
domcox@12209 52 echo "remove incompatible hooks"
domcox@12209 53 # NetworkManager hook
domcox@12209 54 rm -f $fs/usr/lib/pm-utils/sleep.d/55NetworkManager
domcox@12209 55 # grub hook (Redhat specific)
domcox@12209 56 rm -f $fs/usr/lib/pm-utils/sleep.d/01grub
domcox@12209 57 # readahead hook (not busybox compliant)
domcox@12209 58 rm -f $fs/usr/lib/pm-utils/power.d/readahead
domcox@12209 59 # sata_alpm (causes disk errors on many hardware)
domcox@12209 60 rm -f $fs/usr/lib/pm-utils/power.d/sata_alpm
domcox@12209 61
domcox@12209 62 # add video quirks
domcox@12209 63 echo -n "Add video quirks"
domcox@12209 64 cp -a $stuff/video-quirks $fs/usr/lib/pm-utils
domcox@12209 65 status
domcox@2655 66 }
pascal@17526 67
pascal@17526 68 pre_remove()
pascal@17526 69 {
pascal@17526 70 [ -s $1/etc/slim.conf ] &&
pascal@17526 71 sed -i 's|.*/usr/sbin/pm-suspend|#&|' $1/etc/slim.conf
pascal@17526 72 }
pascal@17526 73
pascal@17526 74 post_install()
pascal@17526 75 {
pascal@17526 76 [ -s $1/etc/slim.conf ] &&
pascal@17526 77 sed -i 's|^#suspend_cmd.*|suspend_cmd /usr/sbin/pm-suspend|' \
pascal@17526 78 $1/etc/slim.conf
pascal@17526 79 }