xcat-core/buildcore20.sh
jbjohnso 4763d577e8 -update build scripts
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2655 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
2009-01-26 14:25:00 +00:00

113 lines
3.2 KiB
Bash
Executable File

#!/bin/sh
cd `dirname $0`
GREP=grep
export BDIR=`pwd`
export BDIR=`pwd`
export DESTDIR=`pwd`/2.0-tmp/core-snap
export SRCDIR=`pwd`/2.0-tmp/core-snap-srpms
mkdir -p 2.0-tmp
UPLOAD=0
if [ "$1" == "UPLOAD" ]; then
UPLOAD=1
fi
if [ -f /etc/redhat-release ]
then
pkg="redhat"
else
pkg="packages"
fi
#rm -rf $DESTDIR
#rm -rf $SRCDIR
mkdir -p $DESTDIR
mkdir -p $SRCDIR
cd 2.0/xcat-core
svn up > ../coresvnup
if $GREP xCAT-client ../coresvnup; then
UPLOAD=1
./makeclientrpm
rm -f $DESTDIR/xCAT-client*rpm
rm -f $SRCDIR/xCAT-client*rpm
mv /usr/src/$pkg/RPMS/noarch/xCAT-client-2.0*rpm $DESTDIR/
mv /usr/src/$pkg/SRPMS/xCAT-client-2.0*rpm $SRCDIR/
fi
if true; then #$GREP perl-xCAT ../coresvnup; then
UPLOAD=1
./makeperlxcatrpm
rm -f $DESTDIR/perl-xCAT*rpm
rm -f $SRCDIR/perl-xCAT*rpm
mv /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.0*rpm $DESTDIR/
mv /usr/src/$pkg/SRPMS/perl-xCAT-2.0*rpm $SRCDIR/
fi
if $GREP xCAT-server ../coresvnup; then
UPLOAD=1
./makeserverrpm
rm -f $DESTDIR/xCAT-server*rpm
rm -f $SRCDIR/xCAT-server*rpm
mv /usr/src/$pkg/RPMS/noarch/xCAT-server-2.0*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCAT-server-2.0*rpm $SRCDIR
fi
if $GREP xCAT-nbroot ../coresvnup; then
UPLOAD=1
cd xCAT-nbroot
./mkrpm x86_64
./mkrpm ppc64
./mkrpm x86
rm -f $DESTDIR/xCAT-nbroot-core*rpm
rm -f $SRCDIR/xCAT-nbroot-core*rpm
mv /usr/src/$pkg/RPMS/noarch/xCAT-nbroot-core-*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCAT-nbroot-core-*rpm $SRCDIR
cd ..
fi
if $GREP "U xCATsn/" ../coresvnup || $GREP "A xCATsn/" ../coresvnup; then
UPLOAD=1
cd xCATsn
rm -f $DESTDIR/xCATsn-2.0*rpm
rm -f $SRCDIR/xCATsn-2.0*rpm
./mkrpm x86_64
mv /usr/src/$pkg/RPMS/*/xCATsn-2*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCATsn-2*rpm $SRCDIR
./mkrpm ppc64
mv /usr/src/$pkg/RPMS/*/xCATsn-2*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCATsn-2*rpm $SRCDIR
./mkrpm i386
mv /usr/src/$pkg/RPMS/*/xCATsn-2*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCATsn-2*rpm $SRCDIR
cd ..
fi
if $GREP "U xCAT/" ../coresvnup || $GREP "A xCAT/" ../coresvnup; then
UPLOAD=1
cd xCAT
rm -f $DESTDIR/xCAT-2.0*rpm
rm -f $SRCDIR/xCAT-2.0*rpm
./mkrpm x86_64
mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR
mv /usr/src/$pkg/SRPMS/xCAT-2*rpm $SRCDIR
./mkrpm ppc64
mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR
./mkrpm i386
mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR
cd ..
fi
if [ $UPLOAD == 0 ]; then
echo "Nothing new detected"
exit 0;
fi
$BDIR/sign.exp $DESTDIR/*rpm
$BDIR/sign.exp $SRCDIR/*rpm
createrepo $DESTDIR
rm $SRCDIR/repodata/repomd.xml.asc
rm $DESTDIR/repodata/repomd.xml.asc
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
createrepo $SRCDIR
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
cd $DESTDIR/..
export CFNAME=core-rpms-snap.tar.bz2
export DFNAME=dep-rpms-snap.tar.bz2
#tar jcvf $DFNAME dep-snap
tar jcvf $CFNAME core-snap
scp $CFNAME jbjohnso@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/2.0/
rsync -av --delete core-snap jbjohnso@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/2.0/
#ssh jbjohnso@shell2.sf.net "cd /home/groups/x/xc/xcat/htdocs/yum; tar jcvf $CFNAME core-snap"
#ssh jbjohnso@shell1.sf.net "cd /home/groups/x/xc/xcat/htdocs/yum/; rm -rf core-snap; tar jxvf $CFNAME"