#!/bin/bash
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (C) 2015-2016, 2026 InterGenJLU
#
# zip 3.0 — Info-ZIP archiver for creating ZIP archives
# BLFS 13.0

configure() {
    set -e
    # No configure step — uses unix/Makefile directly
    :
}

build() {
    set -e
    # BLFS: CC="gcc -std=gnu89" required — Zip uses pre-C99 constructs
    # Use 'generic' target (not generic_gcc) per BLFS 13.0
    make -f unix/Makefile generic \
        CC="gcc -std=gnu89"
}

do_install() {
    set -e
    make prefix="$DESTDIR/usr"                   \
         MANDIR="$DESTDIR/usr/share/man/man1"    \
         -f unix/Makefile install
}
