#!/bin/bash # Prepare the install dir for ICA (Iterative Comparative Analysis) # Based on gsbuild by Greg Schafer source `which ttPM-funcs` 2>/dev/null || exit 1 usage() { printMsg warning "Usage: `basename $0` dir" exit 1 } if [ $# -ne 1 ] then usage fi if [ ! -d "$1" ] then usage fi if [ "${DIR:0:1}" != "/" ] then DIR=$PWD/$1 else DIR=$1 fi # Remove symlinks find $DIR -type l | xargs rm -v -f # Unzip files find $DIR -name "*.bz2" | xargs bunzip2 -v -f find $DIR -name "*.gz" | xargs gunzip -v -f # Extract static libs for i in $(find $DIR -name "*.a" -not -name libieee.a -not -name libmcheck.a) do install -v -d $i.X || error "Could not create dir $i.X" pushd $i.X >/dev/null || error "Could not change to $i.X" ar x $i || error "Could not extract $i" rm -v -f $i popd >/dev/null done