#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2015-2016, 2026 InterGenJLU
#
# Gawk 5.3.2
# LFS 13.0 Section 8.63

configure() {
    set -e
    # Remove extras directory (non-essential)
    sed -i 's/extras//' Makefile.in

    ./configure --prefix=/usr
}

build() {
    set -e
    make -j${IGOS_JOBS}
}

check() {
    set -e
    chown -R tester .
    su tester -c "PATH=$PATH make check"
}

do_install() {
    set -e
    rm -f /usr/bin/gawk-5.3.2
    make DESTDIR="$DESTDIR" install
    ln -sv gawk.1 "${DESTDIR}/usr/share/man/man1/awk.1"
}
