39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# ============================================================================
|
|
# DarkForge Linux — Phase 3, Chapter 8: tar
|
|
# ============================================================================
|
|
# Purpose: Build GNU tar (archive creation and extraction).
|
|
# Essential for handling .tar, .tar.gz, .tar.xz files.
|
|
# Inputs: /sources/tar-1.35.tar.xz
|
|
# Outputs: tar binary in /usr/bin/
|
|
# Assumes: Running inside chroot
|
|
# Ref: LFS 13.0 §8.73
|
|
# ============================================================================
|
|
|
|
set -euo pipefail
|
|
|
|
source /sources/toolchain-scripts/100-chroot-env.sh
|
|
|
|
PACKAGE="tar"
|
|
VERSION="1.35"
|
|
|
|
echo "=== Building ${PACKAGE}-${VERSION} ==="
|
|
|
|
cd /sources
|
|
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
|
|
cd "${PACKAGE}-${VERSION}"
|
|
|
|
FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr
|
|
|
|
make
|
|
# Optional: run tests (may take significant time)
|
|
# make check || true
|
|
make install
|
|
|
|
# Create symlink for consistency with some build scripts
|
|
ln -sfv tar /usr/bin/gtar
|
|
|
|
cd /sources
|
|
rm -rf "${PACKAGE}-${VERSION}"
|
|
echo "=== ${PACKAGE}-${VERSION} complete ==="
|