name: libarchive
version: 3.3.3
release: 2
sources: https://www.libarchive.org/downloads/libarchive-%{version}.tar.gz
build-dependencies: xz-dev, zlib-dev, bzip2-dev, lzo-dev
dependencies: xz, zlib, bzip2, lzo
options:
- configure: --with-zlib --with-lzo2 --with-lzma --with-bz2lib --without-zstd --without-cng --without-nettle --without-openssl --without-expat --without-xml2 --enable-posix-regex-lib=libc LDFLAGS="-L%{prefix}/lib -static"
@build
cd %{name}-%{version}
make
for i in tar cpio cat; do
${CC:-cc} -static -o bsd${i} \
${i}/*.o \
.libs/libarchive.a .libs/libarchive_fe.a \
-llzma -lz -llzo2 -lbz2
done
# FIXME: We’ll want to use those as default `tar`, `cpio` and `zcat`
# implementations in the future.
%split bsdtar
files: %{prefix}/bin/bsdtar
dependencies: libarchive
%split bsdcpio
files: %{prefix}/bin/bsdcpio
%split bsdcat
files: %{prefix}/bin/bsdcat