From 88cc547659f9c3b83b7e9279c714f6c909ead7ec Mon Sep 17 00:00:00 2001 From: linggao Date: Tue, 3 Jun 2008 19:34:04 +0000 Subject: [PATCH] made changes to the make files to be able build rpms properly git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1573 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- makeclientrpm | 31 ++++++++++++++++++------------- makeperlxcatrpm | 25 +++++++++++++++++-------- makermcrpm | 4 ++-- makeserverrpm | 31 ++++++++++++++++++------------- makewebrpm | 0 xCAT/mkrpm | 7 ++++--- xCATsn/mkrpm | 7 ++++--- 7 files changed, 63 insertions(+), 42 deletions(-) mode change 100644 => 100755 makewebrpm diff --git a/makeclientrpm b/makeclientrpm index f9e732f35..4497017a1 100755 --- a/makeclientrpm +++ b/makeclientrpm @@ -1,30 +1,35 @@ #!/bin/sh OSNAME=$(uname) -VER=2.1 +VER="2.1" if [ "$OSNAME" = "AIX" ] then - echo '.svn' > /tmp/xcat-excludes - tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-client-$VER.tar xCAT-client - gzip -f /opt/freeware/src/packages/SOURCES/xCAT-client-$VER.tar - cd ./xCAT-client - rm -f /opt/freeware/src/packages/SRPMS/xCAT-client-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-client-$VER*rpm - rpm -ba xCAT-client.spec - #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-client-$VER*rpm - + source=$PWD + cd /opt/freeware/src/packages/SOURCES + rm -f xCAT-client-$VER; ln -s $source/xCAT-client xCAT-client-$VER + rm -f /opt/freeware/src/packages/SRPMS/xCAT-client*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-client*rpm + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cf xCAT-client-$VER.tar xCAT-client-$VER + gzip -f /opt/freeware/src/packages/SOURCES/xCAT-client-$VER.tar + cd $source/xCAT-client + rpm -ba xCAT-client.spec else - if [ -f /etc/redhat-release ] then pkg="redhat" else pkg="packages" fi + source=$PWD - tar --exclude .svn -czf /usr/src/$pkg/SOURCES/xCAT-client-$VER.tar.gz xCAT-client; + # Trying to avoid having the version on the xCAT-client dir name in svn + set -x + cd /usr/src/$pkg/SOURCES + rm -f xCAT-client-$VER; ln -s $source/xCAT-client xCAT-client-$VER # have to make tar think it is in xCAT-client-2.1 + rm -f xCAT-client-$VER.tar.gz + tar -czhf xCAT-client-$VER.tar.gz --exclude=.svn --exclude=.project xCAT-client-$VER rm -f /usr/src/$pkg/SRPMS/xCAT-client-$VER*rpm /usr/src/$pkg/RPMS/noarch/xCAT-client-$VER*rpm - rpmbuild -ta /usr/src/$pkg/SOURCES/xCAT-client-$VER.tar.gz ; - #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-client-$VER*rpm + rpmbuild -ta xCAT-client-$VER.tar.gz fi diff --git a/makeperlxcatrpm b/makeperlxcatrpm index d45b3f9f2..175c9a9c9 100755 --- a/makeperlxcatrpm +++ b/makeperlxcatrpm @@ -6,12 +6,15 @@ VER="2.1" if [ "$OSNAME" = "AIX" ] then - echo '.svn' > /tmp/xcat-excludes - tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/perl-xCAT-$VER.tar perl-xCAT - gzip -f /opt/freeware/src/packages/SOURCES/perl-xCAT-$VER.tar - cd ./perl-xCAT - rm -f /opt/freeware/src/packages/SRPMS/perl-xCAT-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/perl-xCAT-$VER*rpm - rpm -ba perl-xCAT.spec + source=$PWD + cd /opt/freeware/src/packages/SOURCES + rm -f perl-xCAT-$VER; ln -s $source/perl-xCAT perl-xCAT-$VER + rm -f /opt/freeware/src/packages/SRPMS/perl-xCAT*rpm /opt/freeware/src/packages/RPMS/ppc/perl-xCAT*rpm + echo '.svn' > /tmp/xcat-excludes + tar -X /tmp/xcat-excludes -cf perl-xCAT-$VER.tar perl-xCAT-$VER + gzip -f /opt/freeware/src/packages/SOURCES/perl-xCAT-$VER.tar + cd $source/perl-xCAT + rpm -ba perl-xCAT.spec else if [ -f /etc/redhat-release ] then @@ -19,8 +22,14 @@ else else pkg="packages" fi + source=$PWD - tar --exclude .svn -czf /usr/src/$pkg/SOURCES/perl-xCAT-$VER.tar.gz perl-xCAT/; + # Trying to avoid having the version on the perl-xCAT dir name in svn + set -x + cd /usr/src/$pkg/SOURCES + rm -f perl-xCAT-$VER; ln -s $source/perl-xCAT perl-xCAT-$VER # have to make tar think it is in perl-xCAT-2.1 + rm -f perl-xCAT-$VER.tar.gz + tar -czhf perl-xCAT-$VER.tar.gz --exclude=.svn --exclude=.project perl-xCAT-$VER rm -f /usr/src/$pkg/SRPMS/perl-xCAT-$VER*rpm /usr/src/$pkg/RPMS/noarch/perl-xCAT-$VER*rpm - rpmbuild -ta /usr/src/$pkg/SOURCES/perl-xCAT-$VER.tar.gz ; + rpmbuild -ta perl-xCAT-$VER.tar.gz fi diff --git a/makermcrpm b/makermcrpm index 34ce1ef3b..d88ec9d94 100755 --- a/makermcrpm +++ b/makermcrpm @@ -1,6 +1,6 @@ #!/bin/sh OSNAME=$(uname) -version='2.0' +version='2.1' if [ "$OSNAME" = "AIX" ] then @@ -24,7 +24,7 @@ else fi source=$PWD - # Trying to avoid having the version # (2.0) on the xCAT-rmc dir name in svn + # Trying to avoid having the version on the xCAT-rmc dir name in svn set -x cd /usr/src/$pkg/SOURCES rm -f xCAT-rmc-$version; ln -s $source/xCAT-rmc xCAT-rmc-$version # have to make tar think it is in xCAT-rmc-2.0 diff --git a/makeserverrpm b/makeserverrpm index 12c9bbab0..989a04c81 100755 --- a/makeserverrpm +++ b/makeserverrpm @@ -1,30 +1,35 @@ #!/bin/sh OSNAME=$(uname) -VER=2.1 +VER="2.1" if [ "$OSNAME" = "AIX" ] then - echo '.svn' > /tmp/xcat-excludes - tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/xCAT-server-$VER.tar xCAT-server - gzip -f /opt/freeware/src/packages/SOURCES/xCAT-server-$VER.tar - cd ./xCAT-server - rm -f /opt/freeware/src/packages/SRPMS/xCAT-server-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-server-$VER*rpm - rpm -ba xCAT-server.spec - #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-server-$VER*rpm - + 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 - tar --exclude .svn -czf /usr/src/$pkg/SOURCES/xCAT-server-$VER.tar.gz xCAT-server; + # 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 /usr/src/$pkg/SOURCES/xCAT-server-$VER.tar.gz ; - #rpm -Uvh /usr/src/$pkg/RPMS/noarch/xCAT-server-$VER*rpm + rpmbuild -ta xCAT-server-$VER.tar.gz fi diff --git a/makewebrpm b/makewebrpm old mode 100644 new mode 100755 diff --git a/xCAT/mkrpm b/xCAT/mkrpm index 711a09dee..af719c69d 100755 --- a/xCAT/mkrpm +++ b/xCAT/mkrpm @@ -1,6 +1,7 @@ #!/bin/sh OSNAME=$(uname) +VER=2.1 if [ "$OSNAME" = "AIX" ] then @@ -16,12 +17,12 @@ then cp xcat.conf /opt/freeware/src/packages/SOURCES - rm -f /opt/freeware/src/packages/SRPMS/xCAT-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-2.0*rpm + rm -f /opt/freeware/src/packages/SRPMS/xCAT-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm rpm -ba xCAT.spec # don't install - #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-2.0*rpm + #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCAT-$VER*rpm cd - else @@ -37,7 +38,7 @@ else tar --exclude .svn -czf /usr/src/$pkg/SOURCES/postscripts.tar.gz postscripts LICENSE.html tar --exclude .svn -czf /usr/src/$pkg/SOURCES/templates.tar.gz templates cp xcat.conf /usr/src/$pkg/SOURCES - rm -f /usr/src/$pkg/SRPMS/xCAT-2.0*rpm /usr/src/$pkg/RPMS/*/xCAT-2.0*rpm + rm -f /usr/src/$pkg/SRPMS/xCAT-$VER*rpm /usr/src/$pkg/RPMS/*/xCAT-$VER*rpm if [ ! -z "$1" ]; then rpmbuild -ba xCAT.spec --target $1 else diff --git a/xCATsn/mkrpm b/xCATsn/mkrpm index 5099afa8b..49e111aa3 100755 --- a/xCATsn/mkrpm +++ b/xCATsn/mkrpm @@ -1,6 +1,7 @@ #!/bin/sh OSNAME=$(uname) +VER=2.1 if [ "$OSNAME" = "AIX" ] then @@ -11,12 +12,12 @@ then gzip -f /opt/freeware/src/packages/SOURCES/license.tar cp xcat.conf /opt/freeware/src/packages/SOURCES - rm -f /opt/freeware/src/packages/SRPMS/xCATsn-2.0*rpm /opt/freeware/src/packages/RPMS/ppc/xCATsn-2.0*rpm + rm -f /opt/freeware/src/packages/SRPMS/xCATsn-$VER*rpm /opt/freeware/src/packages/RPMS/ppc/xCATsn-$VER*rpm rpm -ba xCATsn.spec # don't install - #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCATsn-2.0*rpm + #rpm -Uvh /opt/freeware/src/packages/RPMS/ppc/xCATsn-$VER*rpm cd - else @@ -31,7 +32,7 @@ else cd `dirname $0` tar --exclude .svn -czf /usr/src/$pkg/SOURCES/license.tar.gz LICENSE.html cp xcat.conf /usr/src/$pkg/SOURCES - rm -f /usr/src/$pkg/SRPMS/xCATsn-2.0*rpm /usr/src/$pkg/RPMS/*/xCATsn-2.0*rpm + rm -f /usr/src/$pkg/SRPMS/xCATsn-$VER*rpm /usr/src/$pkg/RPMS/*/xCATsn-$VER*rpm rpmbuild -ba xCATsn.spec cd - fi