#!/bin/sh
name="libarchive"
short_desc="Multi-format archive and compression library"
desc="Includes the libarchive library, the bsdtar and bsdcpio command-line programs, full test suite, and documentation."
category="archivers"
version="3.7.2"
maintainer="ffqq@danwin1210.de"
www="https://www.libarchive.org/"
master_site="https://www.libarchive.org/downloads"
source_name="$name-$version.tar.gz"
license_logic="and" # accepted values: single, and, or
licenses=("libarchive" "BSD-3-CLAUSE")

build_dependencies=("lang/gcc" "devel/gmake")
run_dependencies=("system/glibc" "textproc/expat")

build_process() {
    cd $name-$version || exit 1
    ./configure --prefix=/usr   \
    --disable-static            || exit 1
    make -j$(nproc)
    make DESTDIR=$TAMANDUA_STAGE_DIR install
    # we will use libarchive as our primary tool for cpio and tar
    ln -sv bsdtar $TAMANDUA_STAGE_DIR/usr/bin/tar
    ln -sv bsdcpio $TAMANDUA_STAGE_DIR/usr/bin/cpio
}