mkports

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

commit 44566d988fc72166c0cf250497a690bbbe54185a
parent c5eb1e4294a9a3b07586e4726bc97dc733ca53a7
Author: z3bra <willyatmailoodotorg>
Date:   Sun Jan 17 22:09:58 2016

Add target 'cleanup' to clean packs

Diffstat:
 default.mk | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/default.mk b/default.mk @@ -1,7 +1,7 @@ destdir = `{printf '%s/%s/.rootfs' "$(pwd)" "$pkg-$ver"} # create a pack from an chroot install (see the "install" target) -$pkg\#$ver.tar.bz2:Q: install +$pkg\#$ver.tar.bz2:Q: fetch patch build install cleanup cd $destdir tar -c `ls` | bzip2 -c > ../../$pkg\#$ver.tar.bz2 @@ -22,7 +22,14 @@ install:QV: build mkdir -p $destdir cd $pkg-$ver make PREFIX= DESTDIR=$destdir install - find $destdir -name '*.la' -delete + fi + +cleanup:QV: install + cd $destdir + find . -name '*.la' -delete + rm -rf ./share/doc ./share/info + if [ -z "$(ls ./share)" ]; then + rmdir ./share fi # patch your software using everything in ./patches @@ -51,7 +58,15 @@ fetch-archive:QV: out=$(basename $url) test -f $out || out=$(curl -LOw %{filename_effective} $url) rm -rf $pkg-$ver - src=$(tar -xvf $out|sed -n 1p|cut -f1 -d/) + case $out in + *.tar.bz2) + src=$(bzip2 -cd $out|tar -xv|sed -n 1p|cut -f1 -d/);; + *.tar.gz) + src=$(gzip -cd $out|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 + esac if [ "$src" != "$pkg-$ver" ]; then mv "$src" "$pkg-$ver" fi