#!/bin/sh
#           cpw - copy the latest files to the telcoserv web page
#                 telcoserv:/home/httpd/html/ras/ipmiutil 
ver=2.1.2
dfrom=/mnt/pub/cress/ipmiutil/src
dto=/mnt/pub/cress/ipmiutil
hto=/mnt/w/html/ras/ipmiutil
# pkgdir=/usr/src/redhat
march=`rpmbuild --showrc |grep " _target_cpu" | head -n1 |awk '{print $3}'`
pkgd3=`rpmbuild --showrc |grep " _topdir" |tail -n1 |awk '{print $3}' |cut -f2 -d'/'`
pkgdir=/usr/src/$pkgd3

echo "Copying rpms to $dto ..."
# copy the rpm files to the common /home/public directory
cp -f $pkgdir/SRPMS/ipmiutil-${ver}*.rpm             $dto
cp -f $pkgdir/RPMS/$march/ipmiutil-${ver}*.rpm         $dto
cp -f $pkgdir/SOURCES/ipmiutil-${ver}*.tar.gz     $dto/tar
if [ -d $hto ]
then
  echo "Copying files to $hto ..."
  # copy the right files to the web directory
  cp -f $dfrom/doc/UserGuide               $hto
fi
