From a6ab3d7b94100df562f4009c04317247cc7dfc24 Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Wed, 4 Sep 2019 16:40:25 +0200 Subject: [PATCH] libarchive: static executables, executables split --- libarchive/recipe.spec | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/libarchive/recipe.spec b/libarchive/recipe.spec index 3ccf7ba..e3d123e 100644 --- a/libarchive/recipe.spec +++ b/libarchive/recipe.spec @@ -1,4 +1,35 @@ name: libarchive version: 3.3.3 -release: 1 +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 + dependencies: libarchive + +%split bsdcat + files: %{prefix}/bin/bsdcat + dependencies: libarchive +