build changes to enable bldg a minimal xcat for imbedded environments

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11420 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
bp-sawyers 2012-01-27 00:23:24 +00:00
parent 0282e90cf0
commit d6b6d2e722
3 changed files with 79 additions and 15 deletions

41
makerpm
View File

@ -1,9 +1,12 @@
# The shell is commented out so that it will run in bash on linux and ksh on aix
# !/bin/bash
# IBM(c) 2007 EPL license http://www.eclipse.org/legal/epl-v10.html
# Common script to make any one the xcat rpms. To build locally, run in the top dir of local svn repository, for example:
# ./makerpm xCAT-server
# ./makerpm xCAT x86_64
# If you want verbose output: export VERBOSE=1
# set -x
@ -15,11 +18,11 @@ function makenoarch {
tar -X /tmp/xcat-excludes -cf $RPMROOT/SOURCES/$RPMNAME-$VER.tar $RPMNAME
gzip -f $RPMROOT/SOURCES/$RPMNAME-$VER.tar
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/ppc/$RPMNAME-$VER*rpm
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm ..."
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm $IMBEDTXT..."
rpm $QUIET -ba $RPMNAME/$RPMNAME.spec
RC=$?
else # linux
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $IMBEDTXT..."
tar --exclude .svn -czf $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz $RPMNAME
rm -f $RPMROOT/SRPMS/xCAT-server-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
rpmbuild $QUIET -ta $RPMROOT/SOURCES/$RPMNAME-$VER.tar.gz
@ -32,7 +35,7 @@ function makenoarch {
# Make one of the following rpms: xCAT, xCATsn
function makexcat {
if [ "$OSNAME" != "AIX" -a -z "$2" ]; then
echo 'Usage: makerpm <RPMname> <arch>'
echo 'Usage: makerpm <RPMname> <arch> [<imbedded-system>]'
exit 1
fi
@ -60,7 +63,7 @@ function makexcat {
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/ppc/$RPMNAME-$VER*rpm
cd - >/dev/null
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm ..."
echo "Building $RPMROOT/RPMS/ppc/$RPMNAME-$VER-snap*.ppc.rpm $IMBEDTXT..."
rpm $QUIET -ba $RPMNAME/$RPMNAME.spec
RC=$?
else # linux
@ -81,7 +84,7 @@ function makexcat {
cd - >/dev/null
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER*rpm
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm ..."
echo "Building $RPMROOT/RPMS/$ARCH/$RPMNAME-$VER-snap*.$ARCH.rpm $IMBEDTXT..."
rpmbuild $QUIET -ba $RPMNAME/$RPMNAME.spec --target $ARCH
RC=$?
fi
@ -92,7 +95,7 @@ function makexcat {
# Make the xCAT-nbroot-core rpm
function makenbroot {
if [ -z "$2" ]; then
echo 'Usage: makerpm xCAT-nbroot-core <arch>'
echo 'Usage: makerpm xCAT-nbroot-core <arch> [<imbedded-system>]'
exit 1
fi
@ -106,7 +109,7 @@ function makenbroot {
cp $SPEC.spec $RPMROOT/SOURCES
cd - >/dev/null
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $IMBEDTXT..."
rpmbuild $QUIET -ba $DIR/$SPEC.spec --target $ARCH
}
@ -122,16 +125,26 @@ function makegenesis {
cp $RPMNAME.spec $RPMROOT/SOURCES
cd - >/dev/null
rm -f $RPMROOT/SRPMS/$RPMNAME-$VER*rpm $RPMROOT/RPMS/noarch/$RPMNAME-$VER*rpm
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm ..."
echo "Building $RPMROOT/RPMS/noarch/$RPMNAME-$VER-snap*.noarch.rpm $IMBEDTXT..."
rpmbuild $QUIET -ba $DIR/$RPMNAME.spec
}
# Export the name of the imbedded system we are building for
function exportImbed {
if [ -n "$1" ]; then
export "$1=1"
IMBEDTXT="for $1 "
else
IMBEDTXT=""
fi
}
# Main code....
if [ -z "$1" ]; then
echo 'Usage: makerpm <RPMname> [<arch>]'
echo 'Usage: makerpm <RPMname> [<arch>] [<imbedded-system>]'
exit 1
fi
@ -160,13 +173,17 @@ fi
if [ "$1" = "xCAT" -o "$1" = "xCATsn" ]; then
makexcat $*
exportImbed $3
makexcat $1 $2
elif [ "$1" = "xCAT-nbroot" -o "$1" = "xCAT-nbroot-core" ]; then
exportImbed $3
makenbroot xCAT-nbroot-core $2
elif [ "$1" = "xCAT-genesis-builder" ]; then
makegenesis $*
exportImbed $3
makegenesis $1 $2
else # must be one of the noarch rpms
makenoarch $*
exportImbed $2
makenoarch $1
fi
exit $RC

View File

@ -13,7 +13,8 @@ Prefix: /opt/xcat
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
%ifos linux
BuildArch: noarch
Requires: perl-SOAP-Lite
# Do not need the SOAP rpm require, because rpm will generate it automatically if hpoa.pm is included
#Requires: perl-SOAP-Lite
%endif
Provides: perl-xCAT = %{epoch}:%{version}
@ -22,6 +23,8 @@ Provides: perl-xCAT = %{epoch}:%{version}
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
Includes xCAT::Table, xCAT::NodeRange, among others.
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
%prep
%setup -q -n perl-xCAT
%build
@ -56,11 +59,19 @@ chmod 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data/*
# For now, don't ship these plugins - to avoid AIX dependency error.
# For now, don't ship these plugins on AIX, to avoid AIX dependency error.
%ifnos linux
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/hpoa.pm
%endif
# Don't ship these on zVM, to reduce dependencies
%if %zvm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/hpoa.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/vboxService.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/FSP*.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPC*.pm
%endif
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT/*

View File

@ -32,6 +32,8 @@ Provides: xCAT-server = %{epoch}:%{version}
%description
xCAT-server provides the core server and configuration management components of xCAT. This package should be installed on your management server
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
# %define VERBOSE %(if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then echo 1; else echo 0; fi)
# %define NOVERBOSE %(if [ "$VERBOSE" = "1" -o "$VERBOSE" = "yes" ];then echo 0; else echo 1; fi)
# %define NOVERBOSE %{?VERBOSE:1}%{!?VERBOSE:0}
@ -118,7 +120,7 @@ chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/netboot/sles/*.postinstall
# For now, don't ship these plugins - to avoid AIX dependency.
# For now, don't ship these plugins on AIX to avoid AIX dependency.
%ifnos linux
rm $RPM_BUILD_ROOT/%{prefix}/sbin/stopstartxcatd
#rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/blade.pm
@ -133,6 +135,40 @@ rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/vbox.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/activedirectory.pm
%endif
# Don't ship these on zVM, to reduce dependencies
%if %zvm
rm $RPM_BUILD_ROOT/%{prefix}/sbin/stopstartxcatd
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/blade.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/hpblade.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/hpilo.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/ipmi.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/ipmi.pm.legacy
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/nodediscover.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/switch.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/xen.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/kvm.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/vbox.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/activedirectory.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/aixinstall.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/bmcconfig.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/bpa.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/esx.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/FIP.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/fsp.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/hmc.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/ivm.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/lsslp.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/pxe.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/toolscenter.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/windows.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/xcat2nim.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin/xnba.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/ADUtils.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/IPMI.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/MellanoxIB.pm
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPC.pm
%endif
cp lib/xcat/dsh/Context/* $RPM_BUILD_ROOT/%{prefix}/xdsh/Context
chmod 644 $RPM_BUILD_ROOT/%{prefix}/xdsh/Context/*