2008-02-12 14:32:03 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
OSNAME=$(uname)
|
2009-01-28 15:42:14 +00:00
|
|
|
VER=`cat Version`
|
2008-02-12 14:32:03 +00:00
|
|
|
|
|
|
|
if [ "$OSNAME" = "AIX" ]
|
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
|
|
|
|
cd `dirname $0`/xCATsn
|
|
|
|
echo '.svn' > /tmp/xcat-excludes
|
2010-02-08 19:48:57 +00:00
|
|
|
echo 'upflag' >> /tmp/xcat-excludes
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/license.tar LICENSE.html
|
|
|
|
gzip -f /opt/freeware/src/packages/SOURCES/license.tar
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
#cp xcat.conf /opt/freeware/src/packages/SOURCES
|
|
|
|
#cp xCATSN /usr/src/$pkg/SOURCES
|
2010-02-08 19:48:57 +00:00
|
|
|
|
|
|
|
cp xCATSN /opt/freeware/src/packages/SOURCES
|
2011-04-29 21:29:56 +00:00
|
|
|
rm -f /opt/freeware/src/packages/SRPMS/xCATsn-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCATsn-$VER*rpm
|
|
|
|
cd -
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rpm -ba xCATsn/xCATsn.spec
|
|
|
|
#rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCATsn-$VER*rpm
|
2008-02-12 14:32:03 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
|
2011-04-29 21:29:56 +00:00
|
|
|
rpmbuild --version > /dev/null
|
|
|
|
if [ $? -gt 0 ]
|
2008-02-12 14:32:03 +00:00
|
|
|
then
|
2011-04-29 21:29:56 +00:00
|
|
|
echo "Error: Is rpmbuild installed and working?"
|
|
|
|
exit 1
|
2008-02-12 14:32:03 +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}"
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
cd `dirname $0`/xCATsn
|
2011-04-29 21:29:56 +00:00
|
|
|
tar --exclude .svn -czf $RPMROOT/SOURCES/license.tar.gz LICENSE.html
|
|
|
|
cp xcat.conf $RPMROOT/SOURCES
|
|
|
|
cp xCATSN $RPMROOT/SOURCES
|
|
|
|
rm -f $RPMROOT/SRPMS/xCATsn-$VER*rpm $RPMROOT/RPMS/*/xCATsn-$VER*rpm
|
2009-01-28 15:42:14 +00:00
|
|
|
cd -
|
2011-04-29 21:29:56 +00:00
|
|
|
if [ ! -z "$1" ]; then
|
|
|
|
rpmbuild -ba xCATsn/xCATsn.spec --target $1
|
|
|
|
else
|
|
|
|
rpmbuild -ba xCATsn/xCATsn.spec
|
|
|
|
fi
|
|
|
|
|
2008-02-12 14:32:03 +00:00
|
|
|
fi
|