From 4763d577e8e2ce442afb668df3840fe6b7df9e96 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 26 Jan 2009 14:25:00 +0000 Subject: [PATCH] -update build scripts git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2655 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- buildcore.sh | 61 +++++++++++++++++------ buildcore20.sh | 32 +++++++++--- buildcore21.sh | 133 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 202 insertions(+), 24 deletions(-) create mode 100755 buildcore21.sh diff --git a/buildcore.sh b/buildcore.sh index 9f2b7e6ad..e873112f6 100755 --- a/buildcore.sh +++ b/buildcore.sh @@ -1,5 +1,6 @@ #!/bin/sh cd `dirname $0` +export BDIR=`pwd` GREP=grep export DESTDIR=`pwd`/core-snap export SRCDIR=`pwd`/core-snap-srpms @@ -20,29 +21,45 @@ mkdir -p $DESTDIR mkdir -p $SRCDIR cd xcat-core svn up > ../coresvnup +if [ `wc -l ../coresvnup|awk '{print $1}'` != 1 ] && ! grep "^At revision" ../coresvnup; then + SVNREF=r`svn info|grep Revision|awk '{print $2}'` + BUILDDATE=`date` + VERADD=". ' (svn $SVNREF\/built $BUILDDATE)'" + sed -i s/#XCATSVNBUILDSUBHERE/"$VERADD"/ perl-xCAT/xCAT/Utils.pm + echo perl-xCAT >> ../coresvnup +fi 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.1*rpm $DESTDIR/ - mv /usr/src/$pkg/SRPMS/xCAT-client-2.1*rpm $SRCDIR/ + mv /usr/src/$pkg/RPMS/noarch/xCAT-client-2.2*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/xCAT-client-2.2*rpm $SRCDIR/ fi if $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.1*rpm $DESTDIR/ - mv /usr/src/$pkg/SRPMS/perl-xCAT-2.1*rpm $SRCDIR/ + mv /usr/src/$pkg/RPMS/noarch/perl-xCAT-2.2*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/perl-xCAT-2.2*rpm $SRCDIR/ +fi +svn revert perl-xCAT/xCAT/Utils.pm +if $GREP xCAT-web ../coresvnup; then + UPLOAD=1 + rm -f $DESTDIR/xCAT-web* + rm -f $SRCDIR/xCAT-web* + ./makewebrpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-web-2.2*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-web-2.2*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.1*rpm $DESTDIR - mv /usr/src/$pkg/SRPMS/xCAT-server-2.1*rpm $SRCDIR + mv /usr/src/$pkg/RPMS/noarch/xCAT-server-2.2*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-server-2.2*rpm $SRCDIR fi if $GREP xCAT-nbroot ../coresvnup; then UPLOAD=1 @@ -59,9 +76,15 @@ fi if $GREP "U xCATsn/" ../coresvnup || $GREP "A xCATsn/" ../coresvnup; then UPLOAD=1 cd xCATsn - ./mkrpm - rm -f $DESTDIR/xCATsn-2.1*rpm - rm -f $SRCDIR/xCATsn-2.1*rpm + rm -f $DESTDIR/xCATsn-2.2*rpm + rm -f $SRCDIR/xCATsn-2.2*rpm + ./mkrpm x86_64 + 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 + ./mkrpm ppc64 mv /usr/src/$pkg/RPMS/*/xCATsn-2*rpm $DESTDIR mv /usr/src/$pkg/SRPMS/xCATsn-2*rpm $SRCDIR cd .. @@ -69,9 +92,9 @@ fi if $GREP "U xCAT/" ../coresvnup || $GREP "A xCAT/" ../coresvnup; then UPLOAD=1 cd xCAT - rm -f $DESTDIR/xCAT-2.1*rpm - rm -f $SRCDIR/xCAT-2.1*rpm - ./mkrpm + rm -f $DESTDIR/xCAT-2.2*rpm + rm -f $SRCDIR/xCAT-2.2*rpm + ./mkrpm x86_64 mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR mv /usr/src/$pkg/SRPMS/xCAT-2*rpm $SRCDIR ./mkrpm ppc64 @@ -84,13 +107,19 @@ if [ $UPLOAD == 0 ]; then echo "Nothing new detected" exit 0; fi +$BDIR/sign.exp $DESTDIR/*rpm +$BDIR/sign.exp $SRCDIR/*rpm createrepo $DESTDIR createrepo $SRCDIR +rm $SRCDIR/repodata/repomd.xml.asc +rm $DESTDIR/repodata/repomd.xml.asc +gpg -a --detach-sign $DESTDIR/repodata/repomd.xml +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 -#scp $CFNAME jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ -rsync -av --delete core-snap jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ -ssh jbjohnso@shell1.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" +tar jcvf $CFNAME core-snap +scp $CFNAME jbjohnso@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/devel/ +rsync -av --delete core-snap jbjohnso@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/devel/ +#ssh jbjohnso@shell2.sourceforge.net "cd /home/groups/x/xc/xcat/htdocs/yum/devel; tar jcvf $CFNAME core-snap" diff --git a/buildcore20.sh b/buildcore20.sh index 8cacefb88..446bf0609 100755 --- a/buildcore20.sh +++ b/buildcore20.sh @@ -1,8 +1,11 @@ #!/bin/sh cd `dirname $0` GREP=grep -export DESTDIR=`pwd`/core-snap-20 -export SRCDIR=`pwd`/core-snap-srpms-20 +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 @@ -28,7 +31,7 @@ if $GREP xCAT-client ../coresvnup; then 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 $GREP perl-xCAT ../coresvnup; then +if true; then #$GREP perl-xCAT ../coresvnup; then UPLOAD=1 ./makeperlxcatrpm rm -f $DESTDIR/perl-xCAT*rpm @@ -59,9 +62,15 @@ fi if $GREP "U xCATsn/" ../coresvnup || $GREP "A xCATsn/" ../coresvnup; then UPLOAD=1 cd xCATsn - ./mkrpm 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 .. @@ -71,7 +80,7 @@ if $GREP "U xCAT/" ../coresvnup || $GREP "A xCAT/" ../coresvnup; then cd xCAT rm -f $DESTDIR/xCAT-2.0*rpm rm -f $SRCDIR/xCAT-2.0*rpm - ./mkrpm + ./mkrpm x86_64 mv /usr/src/$pkg/RPMS/*/xCAT-2*rpm $DESTDIR mv /usr/src/$pkg/SRPMS/xCAT-2*rpm $SRCDIR ./mkrpm ppc64 @@ -84,13 +93,20 @@ 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 -#scp $CFNAME jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ -echo rsync -av --delete core-snap jbjohnso@shell1.sf.net:/home/groups/x/xc/xcat/htdocs/yum/ -echo ssh jbjohnso@shell1.sf.net "cd /home/groups/x/xc/xcat/htdocs/yum; tar jcvf $CFNAME core-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" diff --git a/buildcore21.sh b/buildcore21.sh new file mode 100755 index 000000000..9e7a24744 --- /dev/null +++ b/buildcore21.sh @@ -0,0 +1,133 @@ +#!/bin/sh +cd `dirname $0` +export BDIR=`pwd` +GREP=grep +export DESTDIR=`pwd`/2.1-tmp/core-snap +export SRCDIR=`pwd`/2.1-tmp/core-snap-srpms +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.1/xcat-core +svn up > ../coresvnup +if [ `wc -l ../coresvnup|awk '{print $1}'` != 1 ] && ! grep "^At revision" ../coresvnup; then + SVNREF=r`svn info|grep Revision|awk '{print $2}'` + BUILDDATE=`date` + VERADD=". ' (svn $SVNREF\/built $BUILDDATE)'" + sed -i s/#XCATSVNBUILDSUBHERE/"$VERADD"/ perl-xCAT/xCAT/Utils.pm + echo perl-xCAT >> ../coresvnup +fi +if $GREP xCAT-rmc ../coresvnup; then + UPLOAD=1 + ./makermcrpm + rm -f $DESTDIR/xCAT-rmc*rpm + rm -f $SRCDIR/xCAT-rmc*rpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-rmc-2.1*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/xCAT-rmc-2.1*rpm $SRCDIR/ +fi +if true; then #$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.1*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/xCAT-client-2.1*rpm $SRCDIR/ +fi +if $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.1*rpm $DESTDIR/ + mv /usr/src/$pkg/SRPMS/perl-xCAT-2.1*rpm $SRCDIR/ +fi +svn revert perl-xCAT/xCAT/Utils.pm +if $GREP xCAT-web ../coresvnup; then + UPLOAD=1 + rm -f $DESTDIR/xCAT-web* + rm -f $SRCDIR/xCAT-web* + ./makewebrpm + mv /usr/src/$pkg/RPMS/noarch/xCAT-web-2.1*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-web-2.1*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.1*rpm $DESTDIR + mv /usr/src/$pkg/SRPMS/xCAT-server-2.1*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.1*rpm + rm -f $SRCDIR/xCATsn-2.1*rpm + ./mkrpm x86_64 + 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 + ./mkrpm ppc64 + 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.1*rpm + rm -f $SRCDIR/xCAT-2.1*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 +createrepo $SRCDIR +rm $SRCDIR/repodata/repomd.xml.asc +rm $DESTDIR/repodata/repomd.xml.asc +gpg -a --detach-sign $DESTDIR/repodata/repomd.xml +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,xcat@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/2.1/ +rsync -av --delete core-snap jbjohnso,xcat@web.sourceforge.net:/home/groups/x/xc/xcat/htdocs/yum/2.1/ +#ssh jbjohnso@shell2.sourceforge.net "cd /home/groups/x/xc/xcat/htdocs/yum/devel; tar jcvf $CFNAME core-snap"