#!/bin/sh

# called by uscan with '--upstream-version' <version> <file>
tar xzf $3
rm -rf Cbc-*/ThirdParty
rm -rf Cbc-*/CoinUtils/* Cbc-*/Vol/* Cbc-*/Osi/* Cbc-*/Cgl/*
( cd Cbc-*/Clp && find ./ -mindepth 1 ! -name 'CbcOrClpParam.cpp' -delete 2>/dev/null)
rm -f $3
tar czf $3 Cbc-*
rm -rf Cbc-*

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
  . .svn/deb-layout
  mv $3 $origDir
  echo "moved $3 to $origDir"
fi

exit 0
