SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "pm-utils"

# SliTaz package receipt.

PACKAGE="pm-utils"
VERSION="1.4.1"
CATEGORY="system-tools"
SHORT_DESC="Collection of scripts that handle suspend and resume."
MAINTAINER="domcox@slitaz.org"
LICENSE="GPL2"
TARBALL="$PACKAGE-$VERSION.tar.gz"
WEB_SITE="https://pm-utils.freedesktop.org/wiki/"
WGET_URL="https://pm-utils.freedesktop.org/releases/$TARBALL"
CONFIG_FILES="/etc/pm"
TAGS="power-management"

DEPENDS="bash kbd"

# What is the latest version available today?
current_version()
{
    wget -O - ${WGET_URL%/*}/ 2>/dev/null | \
    sed "/latest/d;/$PACKAGE-[0-9]/!d;/tar/!d;s|.*$PACKAGE-\\(.*\\).tar.*|\\1|" | sort -Vr | sed q
}

# Rules to configure and make the package.
compile_rules()
{
    cd $src
    # workaround grep -x not implemented in busybox
    echo -n "Applying grep -x patch.."
    patch -p1 pm/functions.in $stuff/grep-x.patch > /dev/null \
        && echo done. || echo failed.
    # remove acoustic management not implemented in busybox
    echo -n "Applying harddrive patch.."
    patch -p1 pm/power.d/harddrive $stuff/harddrive.patch > /dev/null \
        && echo done. || echo failed.
    # build
    ./configure \
        --prefix=/usr \
        --sysconfdir=/etc \
        $CONFIGURE_ARGS &&
    make &&
    make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    # main
    mkdir -p $fs/usr/lib
    cp -a $install/usr/bin $fs/usr
    cp -a $install/usr/sbin $fs/usr
    cp -a $install/usr/lib/pm-utils $fs/usr/lib

    # sysconfig
    mkdir -p $fs/etc
    cp -a $install/etc/pm $fs/etc

    # remove incompatible hooks
    echo "remove incompatible hooks"
    # NetworkManager hook
    rm -f $fs/usr/lib/pm-utils/sleep.d/55NetworkManager
    # grub hook (Redhat specific)
    rm -f $fs/usr/lib/pm-utils/sleep.d/01grub
    # readahead hook (not busybox compliant)
    rm -f $fs/usr/lib/pm-utils/power.d/readahead
    # sata_alpm (causes disk errors on many hardware)
    rm -f $fs/usr/lib/pm-utils/power.d/sata_alpm

    # add video quirks
    echo -n "Add video quirks"
    cp -a $stuff/video-quirks $fs/usr/lib/pm-utils
    status
}

pre_remove()
{
    [ -s "$1/etc/slim.conf" ] &&
    sed -i 's|.*/usr/sbin/pm-suspend|#&|' "$1/etc/slim.conf"
}

post_install()
{
    [ -s "$1/etc/slim.conf" ] &&
    sed -i 's|^#suspend_cmd.*|suspend_cmd         /usr/sbin/pm-suspend|' \
        "$1/etc/slim.conf"
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)