2009-04-13 16:10:39 +00:00
|
|
|
Summary: Meta-package for a common, default xCAT setup
|
2007-10-26 22:44:33 +00:00
|
|
|
Name: xCAT
|
2009-01-28 15:42:14 +00:00
|
|
|
Version: %(cat Version)
|
2007-10-26 22:44:33 +00:00
|
|
|
Release: snap%(date +"%Y%m%d%H%M")
|
|
|
|
License: EPL
|
|
|
|
Group: Applications/System
|
|
|
|
Vendor: IBM Corp.
|
|
|
|
Packager: IBM Corp.
|
|
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
2007-12-13 22:12:47 +00:00
|
|
|
Prefix: /opt/xcat
|
2007-10-26 22:44:33 +00:00
|
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
2008-01-17 18:23:31 +00:00
|
|
|
#BuildArch: noarch
|
2007-10-26 22:44:33 +00:00
|
|
|
Source1: xcat.conf
|
|
|
|
Source2: postscripts.tar.gz
|
|
|
|
Source3: templates.tar.gz
|
2010-01-25 13:41:46 +00:00
|
|
|
Source5: xCATMN
|
2009-08-03 13:12:08 +00:00
|
|
|
|
|
|
|
%ifos linux
|
2009-08-03 02:00:13 +00:00
|
|
|
Source4: prescripts.tar.gz
|
2009-08-03 13:12:08 +00:00
|
|
|
%endif
|
2007-10-26 22:44:33 +00:00
|
|
|
|
|
|
|
Provides: xCAT = %{version}
|
2010-01-22 13:36:22 +00:00
|
|
|
Conflicts: xCATsn
|
2012-04-30 16:09:28 +00:00
|
|
|
Requires: xCAT-server xCAT-client perl-DBD-SQLite
|
2008-01-23 18:00:13 +00:00
|
|
|
|
2008-01-17 18:23:31 +00:00
|
|
|
%ifos linux
|
2012-05-10 00:33:22 +00:00
|
|
|
Requires: dhcp httpd nfs-utils nmap fping bind perl-XML-Parser perl(CGI)
|
2012-02-08 01:39:24 +00:00
|
|
|
Requires: /etc/xinetd.d/tftp
|
2009-03-26 22:38:47 +00:00
|
|
|
%ifarch s390x
|
|
|
|
# No additional requires for zLinux right now
|
|
|
|
%else
|
2009-05-05 20:22:26 +00:00
|
|
|
# yaboot-xcat is pulled in so any MN can manage ppc nodes
|
2011-11-30 09:37:44 +00:00
|
|
|
Requires: conserver-xcat yaboot-xcat perl-Net-Telnet
|
2009-05-05 20:22:26 +00:00
|
|
|
%endif
|
2009-04-07 06:44:15 +00:00
|
|
|
%ifarch ppc64
|
|
|
|
Requires: perl-IO-Stty
|
|
|
|
%endif
|
2010-04-13 06:11:00 +00:00
|
|
|
%ifarch ppc64 x86_64
|
2012-01-12 03:01:59 +00:00
|
|
|
Requires: openslp-xcat
|
2010-04-13 06:11:00 +00:00
|
|
|
%endif
|
2009-03-26 22:38:47 +00:00
|
|
|
%endif
|
2008-01-23 18:00:13 +00:00
|
|
|
|
2008-01-17 18:23:31 +00:00
|
|
|
%ifarch i386 i586 i686 x86 x86_64
|
2009-03-26 22:38:47 +00:00
|
|
|
# All versions of the nb rpms are pulled in so an x86 MN can manage nodes of any arch.
|
|
|
|
# The nb rpms are used for dhcp-based discovery, and flashing, so for now we do not need them on a ppc MN.
|
2012-04-30 16:09:28 +00:00
|
|
|
Requires: syslinux xCAT-genesis-x86_64 elilo-xcat
|
2011-11-08 17:43:22 +00:00
|
|
|
Requires: ipmitool-xcat >= 1.8.9
|
2009-09-03 15:17:18 +00:00
|
|
|
Requires: xnba-undi syslinux-xcat
|
2008-01-17 18:23:31 +00:00
|
|
|
%endif
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%description
|
|
|
|
xCAT is a server management package intended for at-scale management, including
|
|
|
|
hardware management and software management.
|
|
|
|
|
|
|
|
%prep
|
2008-01-23 18:00:13 +00:00
|
|
|
%ifos linux
|
2008-04-05 14:53:35 +00:00
|
|
|
tar zxf %{SOURCE2}
|
2009-08-03 02:00:13 +00:00
|
|
|
tar zxf %{SOURCE4}
|
2008-01-23 18:00:13 +00:00
|
|
|
%else
|
|
|
|
rm -rf postscripts
|
|
|
|
cp %{SOURCE2} /opt/freeware/src/packages/BUILD
|
2008-04-05 14:53:35 +00:00
|
|
|
gunzip -f postscripts.tar.gz
|
|
|
|
tar -xf postscripts.tar
|
2008-01-23 18:00:13 +00:00
|
|
|
%endif
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%build
|
2008-01-23 18:00:13 +00:00
|
|
|
|
2011-01-17 09:01:37 +00:00
|
|
|
%pre
|
|
|
|
if [ -e "/etc/SuSE-release" ]; then
|
|
|
|
# In SuSE, dhcp-server provides the dhcp server, which is different from the RedHat.
|
|
|
|
# When building the package, we cannot add "dhcp-server" into the "Requires", because RedHat doesn't
|
|
|
|
# have such one package.
|
|
|
|
# so there's only one solution, Yes, it looks ugly.
|
|
|
|
rpm -q dhcp-server >/dev/null
|
|
|
|
if [ $? != 0 ]; then
|
|
|
|
echo ""
|
|
|
|
echo "!! On SuSE, the dhcp-server package should be installed before installing xCAT !!"
|
|
|
|
exit -1;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%install
|
2008-07-07 21:14:14 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d
|
2007-10-26 22:44:33 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/install/postscripts
|
2009-08-03 02:00:13 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/install/prescripts
|
2011-04-20 08:56:12 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/install/kdump
|
2007-12-13 22:12:47 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
|
|
|
cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
2008-01-23 18:00:13 +00:00
|
|
|
|
|
|
|
%ifos linux
|
2008-04-05 14:53:35 +00:00
|
|
|
tar zxf %{SOURCE3}
|
2008-01-23 18:00:13 +00:00
|
|
|
%else
|
|
|
|
cp %{SOURCE3} $RPM_BUILD_ROOT/%{prefix}/share/xcat
|
2008-04-05 14:53:35 +00:00
|
|
|
gunzip -f templates.tar.gz
|
|
|
|
tar -xf templates.tar
|
2008-01-23 18:00:13 +00:00
|
|
|
rm templates.tar
|
|
|
|
%endif
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
cd -
|
|
|
|
cd $RPM_BUILD_ROOT/install
|
2008-01-23 18:00:13 +00:00
|
|
|
|
|
|
|
%ifos linux
|
2008-04-05 14:53:35 +00:00
|
|
|
tar zxf %{SOURCE2}
|
2009-08-03 02:00:13 +00:00
|
|
|
tar zxf %{SOURCE4}
|
2008-01-23 18:00:13 +00:00
|
|
|
%else
|
|
|
|
cp %{SOURCE2} $RPM_BUILD_ROOT/install
|
2008-04-05 14:53:35 +00:00
|
|
|
gunzip -f postscripts.tar.gz
|
|
|
|
tar -xf postscripts.tar
|
2008-01-23 18:00:13 +00:00
|
|
|
rm postscripts.tar
|
|
|
|
%endif
|
|
|
|
|
2010-03-22 05:32:54 +00:00
|
|
|
chmod 755 $RPM_BUILD_ROOT/install/postscripts/*
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
rm LICENSE.html
|
|
|
|
mkdir -p postscripts/hostkeys
|
|
|
|
cd -
|
2008-07-07 21:14:14 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat.conf
|
2007-10-26 22:44:33 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat.conf
|
2010-01-25 13:41:46 +00:00
|
|
|
cp %{SOURCE5} $RPM_BUILD_ROOT/etc/xCATMN
|
2007-12-13 22:12:47 +00:00
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT
|
|
|
|
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT
|
|
|
|
|
2012-05-04 17:16:42 +00:00
|
|
|
%pre
|
|
|
|
# only need to check on AIX
|
|
|
|
%ifnos linux
|
|
|
|
if [ -x /usr/sbin/emgr ]; then # Check for emgr cmd
|
|
|
|
/usr/sbin/emgr -l 2>&1 | grep -i xCAT # Test for any xcat ifixes - msg and exit if found
|
|
|
|
if [ $? = 0 ]; then
|
|
|
|
echo "Error: One or more xCAT emgr ifixes are installed. You must use the /usr/sbin/emgr command to uninstall each xCAT emgr ifix prior to RPM installation."
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%post
|
2008-01-23 18:00:13 +00:00
|
|
|
%ifnos linux
|
2008-03-04 14:15:38 +00:00
|
|
|
. /etc/profile
|
2008-01-23 18:00:13 +00:00
|
|
|
%else
|
2011-11-01 06:16:15 +00:00
|
|
|
cp -f $RPM_INSTALL_PREFIX0/share/xcat/scripts/xHRM /install/postscripts/
|
2008-03-04 14:15:38 +00:00
|
|
|
. /etc/profile.d/xcat.sh
|
2008-03-26 02:39:36 +00:00
|
|
|
%endif
|
2009-07-31 14:57:18 +00:00
|
|
|
if [ "$1" = "1" ]; then #Only if installing for the first time..
|
|
|
|
$RPM_INSTALL_PREFIX0/sbin/xcatconfig -i
|
|
|
|
else
|
|
|
|
$RPM_INSTALL_PREFIX0/sbin/xcatconfig -u
|
2007-10-26 22:44:33 +00:00
|
|
|
fi
|
2010-12-20 02:56:35 +00:00
|
|
|
exit 0
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%clean
|
|
|
|
|
|
|
|
%files
|
2007-12-13 22:12:47 +00:00
|
|
|
%{prefix}
|
2008-07-09 14:10:24 +00:00
|
|
|
# one for sles, one for rhel. yes, it's ugly...
|
2007-10-26 22:44:33 +00:00
|
|
|
/etc/httpd/conf.d/xcat.conf
|
2008-07-07 21:14:14 +00:00
|
|
|
/etc/apache2/conf.d/xcat.conf
|
2010-01-25 13:41:46 +00:00
|
|
|
/etc/xCATMN
|
2007-10-26 22:44:33 +00:00
|
|
|
/install/postscripts
|
2009-08-03 02:00:13 +00:00
|
|
|
/install/prescripts
|
2007-10-26 22:44:33 +00:00
|
|
|
%defattr(-,root,root)
|
2010-02-04 11:09:35 +00:00
|
|
|
|
2010-04-19 09:24:37 +00:00
|
|
|
%postun
|
|
|
|
if [ "$1" = "0" ]; then
|
|
|
|
%ifnos linux
|
|
|
|
if grep "^xcatd" /etc/inittab >/dev/null
|
|
|
|
then
|
|
|
|
/usr/sbin/rmitab xcatd >/dev/null
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
true # so on aix we do not end up with an empty if stmt
|
|
|
|
fi
|
|
|
|
|