SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "sudo-pam"

# SliTaz package receipt.

PACKAGE="sudo-pam"
VERSION="1.9.5p2"
CATEGORY="security"
SHORT_DESC="Allows command execution as root for specified users using PAM."
MAINTAINER="erjo@slitaz.org"
LICENSE="ISC"
WEB_SITE="https://www.sudo.ws/"

SOURCE="sudo"
TARBALL="$SOURCE-$VERSION.tar.gz"
WGET_URL="${WEB_SITE}dist/$TARBALL"

PROVIDE="sudo:pam"
DEPENDS="pam"
BUILD_DEPENDS="pam-dev"

# What is the latest version available today?
current_version()
{
    wget -O - $WEB_SITE 2>/dev/null | \
    grep -C 9 'The current' | sed '/>sudo/!d;s|.*>sudo *||;s|<.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
    ./configure            \
        --sysconfdir=/etc    \
        --with-pam        \
        --with-editor=/bin/vi    \
        --libexecdir=/usr/lib    \
        $CONFIGURE_ARGS &&
    make &&
    make install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/lib
    mkdir -p $fs/etc/pam.d

    cp -a $install/usr/bin        $fs/usr
    cp -a $install/usr/sbin        $fs/usr
    cp -a $install/etc/sudoers    $fs/etc/
    cp -a $stuff/sudo        $fs/etc/pam.d/
    cp -a $install/usr/lib        $fs/usr
}

pre_install()
{
    if [ -f "$1/etc/sudoers" ]
      then
        cp "$1/etc/sudoers"    "$1/etc/sudoers.bak"
    fi
}

post_install()
{
    if [ -f "$1/etc/sudoers.bak" ]
      then
        rm -f            "$1/etc/sudoers"
        mv "$1/etc/sudoers.bak"    "$1/etc/sudoers"
      else
        chown root.root    "$1/etc/sudoers"
        chmod 0440    "$1/etc/sudoers"
    fi
}

pre_remove()
{
    tazpkg get-install ${PACKAGE%-pam}
}
5935 packages and 845883 files in cooking database (Sun Jun 30 00:45:24 2024)