wok view pm-utils/receipt @ rev 25794

created recipe for exo-lang
author Hans-G?nter Theisgen
date Wed Oct 23 16:19:52 2024 +0100 (4 weeks ago)
parents fcc29e8c0135
children
line source
1 # SliTaz package receipt.
3 PACKAGE="pm-utils"
4 VERSION="1.4.1"
5 CATEGORY="system-tools"
6 SHORT_DESC="Collection of scripts that handle suspend and resume."
7 MAINTAINER="domcox@slitaz.org"
8 LICENSE="GPL2"
9 TARBALL="$PACKAGE-$VERSION.tar.gz"
10 WEB_SITE="https://pm-utils.freedesktop.org/wiki/"
11 WGET_URL="https://pm-utils.freedesktop.org/releases/$TARBALL"
12 CONFIG_FILES="/etc/pm"
13 TAGS="power-management"
15 DEPENDS="bash kbd"
17 # What is the latest version available today?
18 current_version()
19 {
20 wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
21 sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
22 }
24 # Rules to configure and make the package.
25 compile_rules()
26 {
27 cd $src
28 # workaround grep -x not implemented in busybox
29 echo -n "Applying grep -x patch.."
30 patch -p1 pm/functions.in $stuff/grep-x.patch > /dev/null \
31 && echo done. || echo failed.
32 # remove acoustic management not implemented in busybox
33 echo -n "Applying harddrive patch.."
34 patch -p1 pm/power.d/harddrive $stuff/harddrive.patch > /dev/null \
35 && echo done. || echo failed.
36 # build
37 ./configure \
38 --prefix=/usr \
39 --sysconfdir=/etc \
40 $CONFIGURE_ARGS &&
41 make &&
42 make DESTDIR=$DESTDIR install
43 }
45 # Rules to gen a SliTaz package suitable for Tazpkg.
46 genpkg_rules()
47 {
48 # main
49 mkdir -p $fs/usr/lib $fs/usr/share/applications
50 cp -a $install/usr/bin $fs/usr
51 cp -a $install/usr/sbin $fs/usr
52 cp -a $install/usr/lib/pm-utils $fs/usr/lib
54 # sysconfig
55 mkdir -p $fs/etc
56 cp -a $install/etc/pm $fs/etc
58 # remove incompatible hooks
59 echo "remove incompatible hooks"
60 # NetworkManager hook
61 rm -f $fs/usr/lib/pm-utils/sleep.d/55NetworkManager
62 # grub hook (Redhat specific)
63 rm -f $fs/usr/lib/pm-utils/sleep.d/01grub
64 # readahead hook (not busybox compliant)
65 rm -f $fs/usr/lib/pm-utils/power.d/readahead
66 # sata_alpm (causes disk errors on many hardware)
67 rm -f $fs/usr/lib/pm-utils/power.d/sata_alpm
69 # add video quirks
70 echo -n "Add video quirks"
71 cp -a $stuff/video-quirks $fs/usr/lib/pm-utils
72 status
74 # add pm-suspend menu entry
75 echo -n "Add pm-suspend menu entry"
76 cp -a $stuff/pm-suspend.desktop $fs/usr/share/applications
77 status
78 }
80 pre_remove()
81 {
82 [ -s "$1/etc/slim.conf" ] &&
83 sed -i 's|.*/usr/sbin/pm-suspend|#&|' "$1/etc/slim.conf"
84 }
86 post_install()
87 {
88 [ -s "$1/etc/slim.conf" ] &&
89 sed -i 's|^#suspend_cmd.*|suspend_cmd /usr/sbin/pm-suspend|' \
90 "$1/etc/slim.conf"
91 }