mkports

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

commit 900b95ca4f8387ad4a19b30ad13fc0be2f8e9731
parent 0de3f25560b80c304d9c531330323d2a0e286ccc
Author: z3bra <willyatmailoodotorg>
Date:   Wed Jan 20 18:06:31 2016

Clean archive file using $url basename

Diffstat:
 default.mk     | 16 ++++++++--------
 libgmp/mkfile  |  4 ----
 libmpc/mkfile  |  4 ----
 libmpfr/mkfile |  4 ----
 4 files changed, 8 insertions(+), 20 deletions(-)

diff --git a/default.mk b/default.mk @@ -1,4 +1,5 @@ destdir = `{printf '%s/%s/.rootfs' "$(pwd)" "$pkg-$ver"} +archive = `{basename $url 2>/dev/null} # create a pack from an chroot install (see the "install" target) $pkg\#$ver.tar.bz2:Q: fetch patch build install cleanup @@ -53,27 +54,26 @@ fetch-git:QV: # content to a directory named $pkg-$ver fetch-archive:QV: if [ -n "$url" ]; then - out=$(basename $url) - test -f $out || out=$(curl -LOw %{filename_effective} $url) + test -f $archive || curl -LO $url > $archive rm -rf $pkg-$ver - case $out in + case $archive in *.tar.bz2) - src=$(bzip2 -cd $out|tar -xv|sed -n 1p|cut -f1 -d/);; + src=$(bzip2 -cd $archive|tar -xv|sed -n 1p|cut -f1 -d/);; *.tar.gz|*.tgz) - src=$(gzip -cd $out|tar -xv|sed -n 1p|cut -f1 -d/);; + src=$(gzip -cd $archive|tar -xv|sed -n 1p|cut -f1 -d/);; *.tar.xz) - src=$(xz -cd $out|tar -xv|sed -n 1p|cut -f1 -d/);; - *) echo "$out: format not recognized" >&2; exit 1 + src=$(xz -cd $archive|tar -xv|sed -n 1p|cut -f1 -d/);; + *) echo "$archive: format not recognized" >&2; exit 1 esac if [ "$src" != "$pkg-$ver" ]; then mv "$src" "$pkg-$ver" fi + rm $archive fi # delete everything but the pack clean:V: rm -rf $pkg-$ver - rm -f $pkg-$ver.* # remove the pack distclean:V: clean diff --git a/libgmp/mkfile b/libgmp/mkfile @@ -4,7 +4,3 @@ url = http://gmplib.org/download/gmp/gmp-$ver.tar.xz <../config.mk <../default.mk - -clean:V: - rm -rf $pkg-$ver - rm -f gmp-$ver.tar.xz diff --git a/libmpc/mkfile b/libmpc/mkfile @@ -4,7 +4,3 @@ url = ftp://ftp.gnu.org/gnu/mpc/mpc-$ver.tar.gz <../config.mk <../default.mk - -clean:V: - rm -rf $pkg-$ver - rm -f mpc-$ver.tar.xz diff --git a/libmpfr/mkfile b/libmpfr/mkfile @@ -4,7 +4,3 @@ url = http://www.mpfr.org/mpfr-$ver/mpfr-$ver.tar.xz <../config.mk <../default.mk - -clean:V: - rm -rf $pkg-$ver - rm -f mpfr-$ver.*