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
|
2008-01-17 20:33:12 +00:00
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
#echo '.svn' > /tmp/xcat-excludes
|
2011-04-29 21:29:56 +00:00
|
|
|
#tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-server-$VER.tar xCAT-server
|
|
|
|
#gzip -f /opt/freeware/src/packages/SOURCES/xCAT-server-$VER.tar
|
|
|
|
#cd ./xCAT-server
|
|
|
|
#rm -f /opt/freeware/src/packages/SRPMS/xCAT-server-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-server-$VER*rpm
|
|
|
|
#rpm -ba xCAT-server.spec
|
|
|
|
#rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-server-$VER*rpm
|
|
|
|
|
|
|
|
source=/opt/freeware/src/packages
|
2009-01-28 15:42:14 +00:00
|
|
|
echo '.svn' > /tmp/xcat-excludes
|
2011-04-29 21:29:56 +00:00
|
|
|
tar -X /tmp/xcat-excludes -cf $source/SOURCES/xCAT-server-$VER.tar xCAT-server
|
|
|
|
gzip -f $source/SOURCES/xCAT-server-$VER.tar
|
|
|
|
rm -f $source/SRPMS/xCAT-server-$VER*rpm $source/RPMS/ppc/xCAT-server-$VER*rpm
|
|
|
|
rpm -ba xCAT-server/xCAT-server.spec
|
|
|
|
#rpm -ta $source/SOURCES/xCAT-server-$VER.tar.gz
|
2009-01-28 15:42:14 +00:00
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
else
|
2008-06-06 21:41:09 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rpmbuild --version > /dev/null
|
|
|
|
if [ $? -gt 0 ]
|
|
|
|
then
|
|
|
|
echo "Error: Is rpmbuild installed and working?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
RPMROOT=`rpmbuild --eval '%_topdir' xCATsn/xCATsn.spec`
|
|
|
|
if [ $? -gt 0 ]
|
2007-10-26 22:44:33 +00:00
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "Could not determine rpmbuild's root"
|
|
|
|
exit 1
|
2007-10-26 22:44:33 +00:00
|
|
|
fi
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "The location for rpm building is ${RPMROOT}"
|
|
|
|
|
|
|
|
tar --exclude .svn -czf $RPMROOT/SOURCES/xCAT-server-$VER.tar.gz xCAT-server
|
|
|
|
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/xCAT-server-$VER*rpm
|
|
|
|
rpmbuild -ta $RPMROOT/SOURCES/xCAT-server-$VER.tar.gz
|
|
|
|
#rpm -Uvh $RPMROOT/RPMS/noarch/xCAT-server-$VER*rpm
|
2007-10-26 22:44:33 +00:00
|
|
|
|
|
|
|
fi
|