2007-12-12 15:24:27 +00:00
|
|
|
#!/bin/sh
|
2008-01-17 20:29:37 +00:00
|
|
|
|
|
|
|
OSNAME=$(uname)
|
2009-01-28 15:42:14 +00:00
|
|
|
VER=`cat Version`
|
2008-01-17 20:29:37 +00:00
|
|
|
|
|
|
|
if [ "$OSNAME" = "AIX" ]
|
2007-12-12 15:24:27 +00:00
|
|
|
then
|
2008-01-17 20:29:37 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
cd `dirname $0`/xCAT
|
|
|
|
echo '.svn' > /tmp/xcat-excludes
|
|
|
|
echo 'upflag' >> /tmp/xcat-excludes
|
2008-01-23 18:02:17 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/postscripts.tar postscripts LICENSE.html
|
|
|
|
gzip -f /opt/freeware/src/packages/SOURCES/postscripts.tar
|
2008-01-23 18:02:17 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/templates.tar templates
|
|
|
|
gzip -f /opt/freeware/src/packages/SOURCES/templates.tar
|
2008-01-23 18:02:17 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
cp xcat.conf /opt/freeware/src/packages/SOURCES
|
|
|
|
cp xCATMN /opt/freeware/src/packages/SOURCES
|
2008-01-23 18:02:17 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rm -f /opt/freeware/src/packages/SRPMS/xCAT-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm
|
|
|
|
cd -
|
2008-01-23 18:02:17 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rpm -ba xCAT/xCAT.spec
|
|
|
|
#rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm
|
2008-01-17 20:29:37 +00:00
|
|
|
|
2007-12-12 15:24:27 +00:00
|
|
|
else
|
2007-10-29 19:36:20 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rpmbuild --version > /dev/null
|
|
|
|
if [ $? -gt 0 ]
|
2008-01-17 20:29:37 +00:00
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "Error: Is rpmbuild installed and working?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
RPMROOT=`rpmbuild --eval '%_topdir' xCATsn/xCATsn.spec`
|
|
|
|
if [ $? -gt 0 ]
|
|
|
|
then
|
|
|
|
echo "Could not determine rpmbuild's root"
|
|
|
|
exit 1
|
2008-01-17 20:29:37 +00:00
|
|
|
fi
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "The location for rpm building is ${RPMROOT}"
|
2008-01-17 20:29:37 +00:00
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
cd `dirname $0`/xCAT
|
2011-04-29 21:29:56 +00:00
|
|
|
tar --exclude .svn -czf $RPMROOT/SOURCES/postscripts.tar.gz postscripts LICENSE.html
|
|
|
|
tar --exclude .svn -czf $RPMROOT/SOURCES/prescripts.tar.gz prescripts
|
|
|
|
tar --exclude .svn -czf $RPMROOT/SOURCES/templates.tar.gz templates
|
|
|
|
cp xcat.conf $RPMROOT/SOURCES
|
|
|
|
cp xCATMN $RPMROOT/SOURCES
|
2009-01-28 15:42:14 +00:00
|
|
|
cd -
|
2011-04-29 21:29:56 +00:00
|
|
|
rm -f $RPMROOT/SRPMS/xCAT-$VER*rpm $RPMROOT/RPMS/*/xCAT-$VER*rpm
|
|
|
|
if [ ! -z "$1" ]; then
|
|
|
|
rpmbuild -ba xCAT/xCAT.spec --target $1
|
|
|
|
else
|
|
|
|
rpmbuild -ba xCAT/xCAT.spec
|
|
|
|
fi
|
|
|
|
|
2008-01-17 20:29:37 +00:00
|
|
|
fi
|