#~/bin/bash
#PROJECT_FILES="ABOUT-NLS COPYING INSTALL NEWS ChangeLog"
#for file in $PROJECT_FILES
#do
#  if [ ! -f $file ]; then
#    cp ../$file .
#  fi
#done
if [ ! -d "admin" ]; then
  echo "Please press enter directly for the next question about the password"
  cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/scim login 
  cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/scim co -P -d admin skim/admin
fi

if [ ! -d "admin" ]; then
  echo -e "ERROR: missing admin directory\n       please see README on how to bootstrap from CVS"
  exit
fi

gmake -f admin/Makefile.common cvs
#gmake -f Makefile.cvs
if test "$1" = "release"; then
  echo "Cleaning files"
  find . -name .cvsignore | xargs rm -fr
  rm templates/ -fr
  find -name \CVS | xargs rm -rf
  rm autom4te.cache scim_panel_kde.kdevelop stamp*.in -fr
fi
