Big script
This commit is contained in:
39
toolchain/scripts/124-libcap.sh
Executable file
39
toolchain/scripts/124-libcap.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# DarkForge Linux — Phase 3, Chapter 8.27: Libcap (POSIX Capabilities)
|
||||
# ============================================================================
|
||||
# Purpose: Build libcap, a library for managing POSIX capabilities on
|
||||
# executables. Used for privilege separation without full root.
|
||||
# Required by various system tools and by polkit (for privilege escalation).
|
||||
# Inputs: /sources/libcap-2.76.tar.xz
|
||||
# Outputs: libcap library in /usr/lib, utilities in /usr/sbin
|
||||
# Ref: LFS 13.0 §8.27
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
source /sources/toolchain-scripts/100-chroot-env.sh
|
||||
|
||||
PACKAGE="libcap"
|
||||
VERSION="2.76"
|
||||
|
||||
echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ==="
|
||||
|
||||
pkg_extract "${PACKAGE}-${VERSION}.tar.xz"
|
||||
cd "${PACKAGE}-${VERSION}"
|
||||
|
||||
# Prevent static linking (we want shared libraries)
|
||||
sed -i '/^LIBDIR/s/lib/lib/' Makefile
|
||||
|
||||
# Build and install with optimizations
|
||||
make lib=lib
|
||||
make lib=lib DESTDIR=/ install
|
||||
|
||||
# Install headers
|
||||
install -Dm644 libcap/include/sys/capability.h /usr/include/sys/capability.h
|
||||
|
||||
# Verify installation
|
||||
echo "libcap version: $(/usr/sbin/getcap -V 2>&1 || echo 'libcap installed')"
|
||||
|
||||
cd "${SRCDIR}"
|
||||
pkg_cleanup "${PACKAGE}-${VERSION}"
|
||||
echo "=== ${PACKAGE}-${VERSION} complete ==="
|
||||
Reference in New Issue
Block a user