1.24. tmp sudo-1.9.11p3

This package is not part of original LFS (on both pass1 and main stages).

Package is used for user switching inside chrooted container. After default chroot(1) we are acting as root user. sudo helps us to return back to general user (automatically).

At pass1 stage function lfs_install is shown below as empty, but actually it is not. The package is installed automatically at pass1 stage, and lfs_install behaves the same as for other packages. At main stage the package is built, but not installed, as installation would conflict with settings for sudo files, previously done as root.

#!/bin/sh
# Copyright © 1999-2022 Gerard Beekmans
# Copyright © 2017-2022 Random Crew
# Distributed under the terms of MIT License.



# this cancels the effect of empty lfs_install in main build
loadlib lfs

Configuration

src_config()
{
    ./configure \
        --prefix=${PREFIX} \
        --libexecdir=${PREFIX}/lib      \
        --with-secure-path         \
        --with-all-insults         \
        --with-env-editor          \
        --docdir=${PREFIX}/share/doc/${P} \
        --with-passprompt="[sudo] password for %p: " \
        --host=${LFS_TGT} \
        --build=$(./scripts/config.guess)
}

Compilation

src_compile()
{
    make ${MAKEOPTS}
}

Installation

src_install()
{
    make install ${MAKEOPTS} DESTDIR=${D}

    ln -sf libsudo_util.so.0.0.0 ${D}${PREFIX}/lib/sudo/libsudo_util.so.0
}

lfs_install

lfs_install()
{
    return
}