xcat-core/makeserverrpm
2008-06-03 19:34:04 +00:00

36 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
OSNAME=$(uname)
VER="2.1"
if [ "$OSNAME" = "AIX" ]
then
source=$PWD
cd /opt/freeware/src/packages/SOURCES
rm -f xCAT-server-$VER; ln -s $source/xCAT-server xCAT-server-$VER
rm -f /opt/freeware/src/packages/SRPMS/xCAT-server*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-server*rpm
echo '.svn' > /tmp/xcat-excludes
tar -X /tmp/xcat-excludes -cf xCAT-server-$VER.tar xCAT-server-$VER
gzip -f /opt/freeware/src/packages/SOURCES/xCAT-server-$VER.tar
cd $source/xCAT-server
rpm -ba xCAT-server.spec
else
if [ -f /etc/redhat-release ]
then
pkg="redhat"
else
pkg="packages"
fi
source=$PWD
# Trying to avoid having the version on the xCAT-server dir name in svn
set -x
cd /usr/src/$pkg/SOURCES
rm -f xCAT-server-$VER; ln -s $source/xCAT-server xCAT-server-$VER # have to make tar think it is in xCAT-server-2.1
rm -f xCAT-server-$VER.tar.gz
tar -czhf xCAT-server-$VER.tar.gz --exclude=.svn --exclude=.project xCAT-server-$VER
rm -f /usr/src/$pkg/SRPMS/xCAT-server-$VER*rpm /usr/src/$pkg/RPMS/noarch/xCAT-server-$VER*rpm
rpmbuild -ta xCAT-server-$VER.tar.gz
fi