wok rev 3854

lzma: add debian fake
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 07 18:25:10 2009 +0200 (2009-08-07)
parents f5677e5ac179
children fe884d8ff264
files lzma/receipt lzma/stuff/lzma
line diff
     1.1 --- a/lzma/receipt	Fri Aug 07 16:37:50 2009 +0200
     1.2 +++ b/lzma/receipt	Fri Aug 07 18:25:10 2009 +0200
     1.3 @@ -38,6 +38,8 @@
     1.4  genpkg_rules()
     1.5  {
     1.6  	mkdir -p $fs/usr/bin
     1.7 -	cp -a $src/CPP/7zip/Compress/LZMA_Alone/lzma-shared $fs/usr/bin/lzma
     1.8 +	cp -a $src/CPP/7zip/Compress/LZMA_Alone/lzma-shared $fs/usr/bin/lzma-alone
     1.9 +	cp stuff/lzma $fs/usr/bin
    1.10 +	chmod 755 $fs/usr/bin/lzma
    1.11  }
    1.12  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/lzma/stuff/lzma	Fri Aug 07 18:25:10 2009 +0200
     2.3 @@ -0,0 +1,48 @@
     2.4 +#!/bin/sh
     2.5 +
     2.6 +case "$1" in
     2.7 +d|e|b) exec /usr/bin/lzma-alone $@;;
     2.8 +esac
     2.9 +
    2.10 +[ -x /usr/bin/lzmap ] && exec /usr/bin/lzmap $@
    2.11 +
    2.12 +files=""
    2.13 +outfilter=''
    2.14 +suffix='lzma'
    2.15 +opts='-a1 -d23 -fb128 -mfbt4 -lc3 -lp0 -pb2'
    2.16 +command='e'
    2.17 +keep=''
    2.18 +
    2.19 +while [ -n "$1" ]; do
    2.20 +  case "$1" in
    2.21 +  -c|--stdout|--to-stdout) outfilter='s/.*/-so/'; keep='y';;
    2.22 +  -S|--suffix) suffix="$2"; shift;;
    2.23 +  -d|--decompress|--uncompress) command='d';;
    2.24 +  -k|--keep) keep='y';;
    2.25 +  -1|--fast) opts='-a0 -d16 -fb64 -mfhc4 -lc3 -lp0 -pb2';;
    2.26 +  -2) opts='-a1 -d20 -fb64 -mfbt4 -lc3 -lp0 -pb2';;
    2.27 +  -3) opts='-a1 -d19 -fb64 -mfbt4 -lc3 -lp0 -pb2';;
    2.28 +  -4) opts='-a1 -d20 -fb128 -mfbt4 -lc3 -lp0 -pb2';;
    2.29 +  -5) opts='-a1 -d21 -fb128 -mfbt4 -lc3 -lp0 -pb2';;
    2.30 +  -6) opts='-a1 -d22 -fb128 -mfbt4 -lc3 -lp0 -pb2';;
    2.31 +  -7) opts='-a1 -d23 -fb128 -mfbt4 -lc3 -lp0 -pb2';;
    2.32 +  -8) opts='-a1 -d24 -fb255 -mfbt4 -lc3 -lp0 -pb2';;
    2.33 +  -9|--best) opts='-a1 -d25 -fb255 -mfhc4 -lc3 -lp0 -pb2';;
    2.34 +  -*);;
    2.35 +  *) files="$files $1";;
    2.36 +  esac
    2.37 +  shift
    2.38 +done
    2.39 +[ -z "$outfilter" ] && if [ -n "$files" ]; then
    2.40 +  if [ "$command" == "e" ]; then
    2.41 +    outfilter="s/\$/.$suffix/"
    2.42 +  else
    2.43 +    outfilter="s/.$suffix\$//"
    2.44 +  fi
    2.45 +else
    2.46 +    files='-si'; outfilter='s/.*/-so/'; keep='y';
    2.47 +fi
    2.48 +for i in $files ; do
    2.49 +  /usr/bin/lzma-alone $command $i $(echo $i | sed $outfilter) $opts || exit $?
    2.50 +  [ -n "$keep" ] || rm -f $i
    2.51 +done