1.9. tmp coreutils-9.1

Package automake and aclocal at the host system are prerequisites for building this package.

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

Configuration

src_config()
{
    ./configure \
            --prefix=${PREFIX}                \
            --host=${LFS_TGT}                 \
            --build=$(build-aux/config.guess) \
            --enable-install-program=hostname \
            --enable-no-install-program=kill,uptime
}

Compilation

src_compile()
{
    make ${MAKEOPTS}
}

Installation

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

    mkdir -p ${D}${PREFIX}/sbin
    mv ${D}${PREFIX}/bin/chroot ${D}${PREFIX}/sbin/
    mkdir -p ${D}${PREFIX}/share/man/man8/
    mv ${D}${PREFIX}/share/man/man1/chroot.1 ${D}${PREFIX}/share/man/man8/chroot.8
    sed -i s/\"1\"/\"8\"/1 ${D}${PREFIX}/share/man/man8/chroot.8
}

Unit testing

Unit testing is not used during this stage.

src_check()
{
    su root -s /bin/bash \
    -c "PATH=$PATH make NON_ROOT_USERNAME=$(id -un) check-root"

    make RUN_EXPENSIVE_TESTS=yes check
}

Links

url.lfs: https://linuxfromscratch.org/lfs/view/11.2/chapter08/coreutils.html
url.lfs.stage1: https://linuxfromscratch.org/lfs/view/11.2/chapter06/coreutils.html