#!/bin/bash

name=`readlink -fn $0`
BD=`dirname $name`
if [ x$1 != x ]; then
    DST=$1
    ZIP=`ls $BD/../../org-lsst-ccs-subsystem-power-main-*-dist.zip`
    REL=`basename $ZIP -dist.zip`
    rm -rf $DST/$REL
    unzip -d $DST $ZIP
else
    DST=$BD/../..
    REL=`basename \`dirname $BD\``
fi
mkdir -p $DST/etc
ln -sf $REL/bin/CCSbootstrap.sh $DST/
ln -sf $REL/bin/vstPowerAgilent.sh $DST/
ln -sf $REL/bin/vstPowerBk.sh $DST/
ln -sf $REL/bin/vstPowerHameg.sh $DST/
ln -sf $REL/bin/vstPowerSim.sh $DST/
ln -sf $REL/bin/rebPower.sh $DST/
