mkports

recipes for building multiple softwares with mk(1)
git clone git://z3bra.org/mkports
Log | Files | Refs

commit f3c8c883f4c6692d65bac56cbaf410d200f4ce79
parent bb996c6324172d28b2286054ef524ccfc2227c5a
Author: z3bra <contactatz3bradotorg>
Date:   Thu May 18 23:40:30 +0200

Make extraction support bsdtar

Diffstat:
default.mk | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/default.mk b/default.mk @@ -12,6 +12,7 @@ $tarball:Q: cd $destdir mkdir -p $(dirname $tarball) ${TAR} -cjf $tarball `ls -1` + printf '\n\t%s\n\n' "$tarball" # recipe trying to follow the most common pattern in software # building @@ -66,12 +67,13 @@ fetch-archive:QV: $WORK/$archive if [ -n "$url" ]; then cd $WORK case $archive in - *.tar.bz2|*.tbz) opt="-xvj" ;; - *.tar.gz|*.tgz) opt="-xvz" ;; - *.tar.xz|*.txz) opt="-xvJ" ;; + *.tar.bz2|*.tbz) method="-j" ;; + *.tar.gz|*.tgz) method="-z" ;; + *.tar.xz|*.txz) method="-J" ;; *) echo "$archive: format not recognized" >&2; exit 1 esac - src=$(${TAR} $opt -f $archive|sed -n 1p|cut -f1 -d/) + ${TAR} $method -xf $archive + src=$(${TAR} $method -tf $archive|sed -n 1p|cut -f1 -d/) if [ "$src" != "$pkg-$ver" ]; then mv "$src" "$pkg-$ver" fi