Files
darkforge/toolchain/scripts/173-man-db.sh
2026-03-20 15:09:30 +01:00

56 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# ============================================================================
# DarkForge Linux — Phase 3, Chapter 8: man-db
# ============================================================================
# Purpose: Build man-db (man page indexing and viewing).
# Provides man, whatis, apropos utilities for reading documentation.
# Inputs: /sources/man-db-2.13.0.tar.xz
# /sources/man-pages-6.12.tar.xz
# Outputs: man-db utilities and man pages in /usr/bin/, /usr/share/man/
# Assumes: Running inside chroot, libpipeline installed
# Ref: LFS 13.0 §8.79
# ============================================================================
set -euo pipefail
source /sources/toolchain-scripts/100-chroot-env.sh
PACKAGE="man-db"
VERSION="2.13.0"
PAGES_VERSION="6.12"
echo "=== Building ${PACKAGE}-${VERSION} ==="
cd /sources
tar -xf "${PACKAGE}-${VERSION}.tar.xz"
cd "${PACKAGE}-${VERSION}"
# Configure man-db to use the appropriate database location
./configure \
--prefix=/usr \
--docdir=/usr/share/doc/man-db-${VERSION} \
--sysconfdir=/etc \
--disable-setuid \
--enable-cache-owner=bin \
--with-browser=/usr/bin/lynx \
--with-pager=/usr/bin/less \
--with-col=/usr/bin/col
make
# Optional: run tests
# make check || true
make install
# Install man pages
echo ">>> Installing man-pages-${PAGES_VERSION}..."
cd /sources
tar -xf man-pages-${PAGES_VERSION}.tar.xz
cd man-pages-${PAGES_VERSION}
make prefix=/usr install
cd /sources
rm -rf "${PACKAGE}-${VERSION}"
rm -rf man-pages-${PAGES_VERSION}
echo "=== ${PACKAGE}-${VERSION} and man-pages complete ==="