#!/bin/bash # ============================================================================ # DarkForge Linux — Phase 3, Chapter 8.36: Grep # ============================================================================ # Purpose: Build GNU grep, a text search utility for pattern matching. # Essential for scripting and text processing. # Inputs: /sources/grep-3.12.tar.xz # Outputs: grep binary in /bin/ # Assumes: Running inside chroot # Ref: LFS 13.0 §8.36 # ============================================================================ set -euo pipefail source /sources/toolchain-scripts/100-chroot-env.sh PACKAGE="grep" VERSION="3.12" echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ===" pkg_extract "${PACKAGE}-${VERSION}.tar.xz" cd "${PACKAGE}-${VERSION}" ./configure \ --prefix=/usr \ --bindir=/bin make make install pkg_cleanup "${PACKAGE}-${VERSION}" echo "=== ${PACKAGE}-${VERSION} complete ==="