#! /bin/bash
#*******************************************************************************
# E.S.O. - VLT project
#
# "@(#) $Id: vltMakePythonPackage,v 1.5 2004/10/01 13:00:35 mzampare Exp $" 
#
# who       when        what
# --------  ----------  ----------------------------------------------
# mzampare  2002-02-15  created
#

#************************************************************************
#   NAME
#   vltMakePythonPackage - create a python module
# 
#   SYNOPSIS
#
#   vltMakePythonPackage <modName> <objList>
# 
#   DESCRIPTION
#   Utility used by vltMakefile.all to copy a python scripts in 
#   package into the corresponding <module>lib/python/site-package/<package>
#   directory
#
#   <modName>     The name of the module. The output is named 
#                 ../lib/python/site-packages/<modName>
#
#   <objList>     the list of python scripts in the Package
#
#   FILES
#   $VLTROOT/include/vltMakefile.all   
#
#   ENVIRONMENT
#
#   RETURN VALUES
#
#   SEE ALSO 
#   vltMakefile, Makefile, (GNU) make
#
#   BUGS    
#
#----------------------------------------------------------------------

if [ $# -ne 2 ]
then
    echo "" >&2
    echo "vltMakePythonPackage <modName> <objList>" >&2
    echo "" >&2
    exit 1
fi

#
# set up more readable variables:
packName=$1
objList=$2

OUTPUT=../lib/python/site-packages/${packName}
if [ ! -e $OUTPUT ] 
then
    mkdir $OUTPUT
    chmod 755 $OUTPUT
elif [ ! -d $OUTPUT ]
then
    echo "$OUTPUT is not a directory!!"
    exit 1
fi
# dirty trick of making a cd to avoid a for loop
#cd $packName
tar cf -  $objList | (cd  $OUTPUT/..; tar xf - )

#
# ___oOo___
