Big script
This commit is contained in:
50
toolchain/scripts/107-lz4.sh
Executable file
50
toolchain/scripts/107-lz4.sh
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
# ============================================================================
|
||||
# DarkForge Linux — Phase 3, Chapter 8.9: LZ4
|
||||
# ============================================================================
|
||||
# Purpose: Build and install LZ4 compression library and tools.
|
||||
# LZ4 is a fast compression algorithm used by some system tools.
|
||||
# Inputs: /sources/lz4-1.10.0.tar.gz
|
||||
# Outputs: /usr/bin/lz4, /usr/lib/liblz4.so
|
||||
# Ref: LFS 13.0 §8.9
|
||||
# ============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
source /sources/toolchain-scripts/100-chroot-env.sh
|
||||
|
||||
PACKAGE="lz4"
|
||||
VERSION="1.10.0"
|
||||
|
||||
echo "=== Building ${PACKAGE}-${VERSION} (Phase 3) ==="
|
||||
|
||||
pkg_extract "${PACKAGE}-${VERSION}.tar.gz"
|
||||
cd "${PACKAGE}-${VERSION}"
|
||||
|
||||
# LZ4 uses a Makefile (not autoconf)
|
||||
# Build and install in one step with make install
|
||||
# PREFIX=/usr: Install to standard location
|
||||
make BUILD_SHARED=yes PREFIX=/usr
|
||||
|
||||
# Run tests
|
||||
make test || true
|
||||
|
||||
# Install lz4
|
||||
make install PREFIX=/usr
|
||||
|
||||
# Verify installation
|
||||
if [ -x /usr/bin/lz4 ]; then
|
||||
echo "PASS: lz4 binary installed"
|
||||
else
|
||||
echo "FAIL: lz4 binary not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -f /usr/lib/liblz4.so ]; then
|
||||
echo "PASS: liblz4.so installed"
|
||||
else
|
||||
echo "FAIL: liblz4.so not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg_cleanup "${PACKAGE}-${VERSION}"
|
||||
echo "=== ${PACKAGE}-${VERSION} complete ==="
|
||||
Reference in New Issue
Block a user