#!/bin/sh
if [ "$1" != "" ]; then
  pkg=`basename $1`
  if [ -d $pkg ]; then
    tar cvf - $pkg | gzip > $pkg.tgz
    if [ "$?" = "0" ]; then
      rm -r $pkg
    fi
  fi
fi
