9cae895ef4
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@9438 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
59 lines
1.6 KiB
Bash
Executable File
59 lines
1.6 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
OSNAME=$(uname)
|
|
VER=`cat Version`
|
|
|
|
if [ "$OSNAME" = "AIX" ]
|
|
then
|
|
|
|
cd `dirname $0`/xCAT
|
|
echo '.svn' > /tmp/xcat-excludes
|
|
echo 'upflag' >> /tmp/xcat-excludes
|
|
|
|
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
|
|
|
|
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/templates.tar templates
|
|
gzip -f /opt/freeware/src/packages/SOURCES/templates.tar
|
|
|
|
cp xcat.conf /opt/freeware/src/packages/SOURCES
|
|
cp xCATMN /opt/freeware/src/packages/SOURCES
|
|
|
|
rm -f /opt/freeware/src/packages/SRPMS/xCAT-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm
|
|
cd -
|
|
|
|
rpm -ba xCAT/xCAT.spec
|
|
#rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm
|
|
|
|
else
|
|
|
|
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 ]
|
|
then
|
|
echo "Could not determine rpmbuild's root"
|
|
exit 1
|
|
fi
|
|
echo "The location for rpm building is ${RPMROOT}"
|
|
|
|
cd `dirname $0`/xCAT
|
|
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
|
|
cd -
|
|
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
|
|
|
|
fi
|