#TYPE=$1

echo PKGNAME $PKGNAME
 
#$(PACKAGE)-$(VERSION)-$(RELEASE)-${host}.tar.gz
#host
#host es src para fuentes

#UPACKDROOT=$3

#UPACKDINFO=$4


testroot(){
      CANTSUMA=`ls -1 $UPACKDINFO|wc -l`
      if test x"$CANTSUMA" != x0 ; then
        mkdir -p $UPACKDROOT/.upackinfo
	cp -r $UPACKDINFO/* $UPACKDROOT/.upackinfo 
      fi
}

  case $TYPE  in
     tar.gz)
        # ifexists INFO
        testroot
	tar -C ${UPACKDROOT} -czf  ${PKGNAME} .
        ;;
     tar.bz2)
        testroot
	tar -C ${UPACKDROOT} -cjf  ${PKGNAME} .
        ;;
      tar.xz)
        testroot
	tar -C ${UPACKDROOT} -cJf  ${PKGNAME} .
        ;;
      *)  echo "no definido el $TYPE"
           ;;
   esac


#tar.gz -zcvf
#tar.lzma
#tar.xz
#zip
#tar.bz2
#shar.gz


#distrofiles: $(PACKAGE).summa pkgac.dat configure.ac 
#	if test "x${BUILD_ROOT}" != "x" -a "x${BUILD_ROOT}" != "x.." ; then\
#	   rm -rf /tmp/${BUILD_ROOT}/*; \
#	fi
#	make DESTDIR=/tmp/${BUILD_ROOT} install
#     pkginfo /tmp/${BUILD_ROOT}; 
