3.53. coreutils-9.0

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

Configuration

src_config()
{
    autoreconf -fiv
    FORCE_UNSAFE_CONFIGURE=1 \
    ./configure \
        --prefix=${PREFIX} \
        --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

The actions for tests differs from original LFS. As we are building from our own user, which is autocreated inside chroot, we do not need to switch to that user manually. On the opposite, we need to switch to root user.

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

    make RUN_EXPENSIVE_TESTS=yes check
}

Patches

01-coreutils-9.0-i18n-1.patch
02-coreutils-9.0-chmod_fix-1.patch

Build code

coreutils.build
pass1.sh

Other files

meta.txt
text

Links

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