#!/bin/sh -ue
NAME=file
VERSION=5.45
RELEASE=1
SOURCE="https://astron.com/pub/file/file-${VERSION}.tar.gz"

build() {
    cd "$SRC/file-${VERSION}" || die "cannot enter source directory"

    msg "configuring file..."
    ./configure \
        --prefix="$PREFIX" \
        --enable-static \
        --disable-shared \
        CC="${CC:-cc}" \
        CFLAGS="${CFLAGS:--O2} -static -D_GNU_SOURCE -include utime.h" \
        LDFLAGS="${LDFLAGS:--static}" || die "configure failed"

    msg "building file..."
    gmake -j"$NPROC" || die "gmake failed"

    msg "installing file..."
    gmake DESTDIR="$PKG" install || die "gmake install failed"
}

. ${0%/*}/../../libsh/libdmake.sh
