2009-01-28 15:42:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
VER=`cat Version`
|
2011-04-29 21:29:56 +00:00
|
|
|
rpmbuild --version > /dev/null
|
|
|
|
if [ $? -gt 0 ]
|
2009-01-28 15:42:14 +00:00
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "Error: Is rpmbuild installed and working?"
|
|
|
|
exit 1
|
2009-01-28 15:42:14 +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}"
|
2009-01-28 15:42:14 +00:00
|
|
|
cd `dirname $0`/xCAT-nbroot
|
2011-04-29 21:29:56 +00:00
|
|
|
tar --exclude .svn -czvf $RPMROOT/SOURCES/xcat-nbrootoverlay.tar.gz -C overlay/ .
|
|
|
|
#mv -f *.gz $RPMROOT/SOURCES
|
|
|
|
cp LICENSE.html $RPMROOT/BUILD
|
|
|
|
cp xcat-core-nbroot.spec $RPMROOT/SOURCES
|
2009-01-28 15:42:14 +00:00
|
|
|
cd -
|
2011-04-29 21:29:56 +00:00
|
|
|
rm -f $RPMROOT/SRPMS/xCAT-nbroot-$VER*rpm $RPMROOT/RPMS/*/xCAT-nbroot-$VER*rpm
|
2009-01-28 15:42:14 +00:00
|
|
|
rpmbuild -ba xCAT-nbroot/xcat-core-nbroot.spec --target $1
|