1.27. tmp libcap-2.48

This package is not added to temporary system at stage1 in original LFS.

We add it for another essential build tools.

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

Configuration

src_config()
{
    sed -i '/install -m.*STA/d' libcap/Makefile
}

Compilation

src_compile()
{
    make ${MAKEOPTS} lib=lib prefix=${PREFIX}
}

Installation

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

    mkdir -p ${D}/lib/
    for libname in cap psx; do
        mv ${D}${PREFIX}/lib/lib${libname}.so.* ${D}/lib
        ln -sf ../../lib/lib${libname}.so.2 ${D}${PREFIX}/lib/lib${libname}.so
        chmod 755 ${D}/lib/lib${libname}.so.${PV}
    done
}

Unit testing

src_check()
{
    make test
}

Links

url.lfs: https://linuxfromscratch.org/lfs/view/10.1/chapter08/libcap.html