#!/bin/bash

name=`readlink -fn $0`
TBASE=`dirname $name`
TLIB=$TBASE/../lib
TINC=$TBASE/../src/main/c
if [ "$2" == "" ]; then
  SBASE=/afs/slac/g/cci/releases/$1
else
  SBASE=$2/$1
fi
SLIB=$SBASE/lib/i386-linux-dbg
SINC=$SBASE/include

cp $SLIB/libCDI.so $TLIB/
cp $SLIB/libCSI.so $TLIB/
cp $SLIB/libDSL.so $TLIB/
cp $SLIB/libNET.so $TLIB/
cp $SLIB/libUDP.so $TLIB/
cp $SLIB/libconcurrency.so $TLIB/
cp $SLIB/libcontainer.so $TLIB/
cp $SLIB/libconversion.so $TLIB/
cp $SLIB/libdebug.so $TLIB/
cp $SLIB/libexception.so $TLIB/
cp $SLIB/libio.so $TLIB/
cp $SLIB/liblogger.so $TLIB/
cp $SLIB/libmemory.so $TLIB/
cp $SLIB/libnet.so $TLIB/libnet0.so
cp $SLIB/librri.so $TLIB/
cp $SLIB/libstring.so $TLIB/
cp $SLIB/libtime.so $TLIB/

cp $SINC/datCode.hh $TINC
chmod -R u+w $TINC/lsst
chmod -R u+w $TINC/tool
chmod -R u+w $TINC/oldPpi
cp -r $SINC/lsst $TINC
cp -r $SINC/tool $TINC
cp -r $SINC/oldPpi $TINC
