2008-02-22 21:54:44 +00:00
|
|
|
#!/bin/sh
|
2007-10-26 22:44:33 +00:00
|
|
|
|
|
|
|
OSNAME=$(uname)
|
2009-01-28 15:42:14 +00:00
|
|
|
VER=`cat Version`
|
2007-10-26 22:44:33 +00:00
|
|
|
|
|
|
|
if [ "$OSNAME" = "AIX" ]
|
|
|
|
then
|
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
#source=$PWD
|
|
|
|
#cd /opt/freeware/src/packages/SOURCES
|
|
|
|
#rm -f xCAT-client-$VER; ln -s $source/xCAT-client xCAT-client-$VER
|
|
|
|
#rm -f /opt/freeware/src/packages/SRPMS/xCAT-client*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-client*rpm
|
|
|
|
#echo '.svn' > /tmp/xcat-excludes
|
|
|
|
#tar -X /tmp/xcat-excludes -cf xCAT-client-$VER.tar xCAT-client-$VER
|
|
|
|
#gzip -f /opt/freeware/src/packages/SOURCES/xCAT-client-$VER.tar
|
|
|
|
#cd $source/xCAT-client
|
|
|
|
#rpm -ba xCAT-client.spec
|
|
|
|
|
|
|
|
source=/opt/freeware/src/packages
|
2008-06-03 19:34:04 +00:00
|
|
|
echo '.svn' > /tmp/xcat-excludes
|
2009-01-28 15:42:14 +00:00
|
|
|
tar -X /tmp/xcat-excludes -cf $source/SOURCES/xCAT-client-$VER.tar xCAT-client
|
|
|
|
gzip -f $source/SOURCES/xCAT-client-$VER.tar
|
|
|
|
rm -f $source/SRPMS/xCAT-client*rpm $source/RPMS/ppc/xCAT-client*rpm
|
|
|
|
rpm -ba xCAT-client/xCAT-client.spec
|
|
|
|
#rpm -ta $source/SOURCES/xCAT-client-$VER.tar.gz
|
2007-10-26 22:44:33 +00:00
|
|
|
else
|
2011-04-29 21:29:56 +00:00
|
|
|
rpmbuild --version > /dev/null
|
|
|
|
if [ $? -gt 0 ]
|
2007-10-26 22:44:33 +00:00
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "Error: Is rpmbuild installed and working?"
|
|
|
|
exit 1
|
2007-10-26 22:44:33 +00:00
|
|
|
fi
|
2011-04-29 21:29:56 +00:00
|
|
|
RPMROOT=`rpmbuild --eval '%_topdir' xCATsn/xCATsn.spec`
|
|
|
|
if [ $? -gt 0 ]
|
|
|
|
then
|
|
|
|
echo "Could not determine rpmbuild's root"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
echo "The location for rpm building is ${RPMROOT}"
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-06-03 19:34:04 +00:00
|
|
|
set -x
|
2011-04-29 21:29:56 +00:00
|
|
|
tar --exclude=.svn -czhf $RPMROOT/SOURCES/xCAT-client-$VER.tar.gz xCAT-client
|
|
|
|
rm -f $RPMROOT/SRPMS/xCAT-client-$VER*rpm $RPMROOT/RPMS/noarch/xCAT-client-$VER*rpm
|
|
|
|
rpmbuild -ta $RPMROOT/SOURCES/xCAT-client-$VER.tar.gz
|
2007-10-26 22:44:33 +00:00
|
|
|
fi
|