xref: /openbmc/u-boot/lib/lzma/import_lzmasdk.sh (revision baefb63a)
1#!/bin/sh
2
3usage() {
4	echo "Usage: $0 lzmaVERSION.tar.bz2" >&2
5	echo >&2
6	exit 1
7}
8
9if [ "$1" = "" ] ; then
10	 usage
11fi
12
13if [ ! -f $1 ] ; then
14	echo "$1 doesn't exist!" >&2
15	exit 1
16fi
17
18BASENAME=`basename $1 .tar.bz2`
19TMPDIR=/tmp/tmp_lib_$BASENAME
20FILES="C/LzmaDec.h
21      C/Types.h
22      C/LzmaDec.c
23      history.txt
24      lzma.txt"
25
26mkdir -p $TMPDIR
27echo "Untar $1 -> $TMPDIR"
28tar -jxf $1 -C $TMPDIR
29
30for i in $FILES; do
31	echo Copying  $TMPDIR/$i \-\> `basename $i`
32	cp $TMPDIR/$i .
33	chmod -x `basename $i`
34done
35
36echo "done!"
37