# SliTaz package receipt.

PACKAGE="busybox-pam"
VERSION="1.31.1"
CATEGORY="base-system"
SHORT_DESC="Busybox combines tiny versions of many common UNIX utilities."
MAINTAINER="pascal.bellard@slitaz.org"
DEPENDS="busybox pam"
WANTED="busybox"
WEB_SITE="http://www.busybox.net/"
CONFIG_FILES="/etc/pam.d"
PROVIDE="busybox:pam"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
        mkdir -p $fs/bin
        cp -a $src/busybox-pam $fs/bin/busybox
        cp -a $stuff/* $fs
}

pre_remove()
{
        # We install non-pam busybox to replace busybox-pam.
        tazpkg get-install ${PACKAGE%-pam} --forced

        # We remove /bin/busybox from the file.list of busybox-pam.
        # This way, the non-pam busybox we just installed will not be
        # removed.
        sed '/\/bin\/busybox/d' \
                -i /var/lib/tazpkg/installed/busybox-pam/files.list
}

post_install()
{
        chmod 4755 $1/bin/busybox
}