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
|
2013-12-17 07:23:38 +00:00
|
|
|
Source6: winpostscripts.tar.gz
|
2009-08-03 13:12:08 +00:00
|
|
|
%endif
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2014-03-07 13:54:56 +00:00
|
|
|
Source7: xcat.conf.apach24
|
|
|
|
|
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
|
|
|
|
2012-11-08 21:47:50 +00:00
|
|
|
%define pcm %(if [ "$pcm" = "1" ];then echo 1; else echo 0; fi)
|
|
|
|
%define notpcm %(if [ "$pcm" = "1" ];then echo 0; else echo 1; fi)
|
|
|
|
|
2008-01-17 18:23:31 +00:00
|
|
|
%ifos linux
|
2012-10-25 09:12:25 +00:00
|
|
|
Requires: httpd nfs-utils nmap bind perl(CGI)
|
2014-03-07 13:54:56 +00:00
|
|
|
# on RHEL7, need to specify it explicitly
|
|
|
|
Requires: net-tools
|
|
|
|
Requires: /usr/bin/killall
|
2012-05-11 21:13:40 +00:00
|
|
|
# On RHEL this pulls in dhcp, on SLES it pulls in dhcp-server
|
|
|
|
Requires: /usr/sbin/dhcpd
|
2012-09-22 16:20:24 +00:00
|
|
|
# On RHEL this pulls in openssh-server, on SLES it pulls in openssh
|
|
|
|
Requires: /usr/bin/ssh
|
2012-07-12 17:58:10 +00:00
|
|
|
%ifnarch s390x
|
2012-06-19 15:21:18 +00:00
|
|
|
Requires: /etc/xinetd.d/tftp
|
2013-06-19 18:59:40 +00:00
|
|
|
Requires: xCAT-buildkit
|
2009-05-05 20:22:26 +00:00
|
|
|
# yaboot-xcat is pulled in so any MN can manage ppc nodes
|
2012-12-04 08:14:20 +00:00
|
|
|
#Requires: yaboot-xcat
|
2013-10-16 00:44:05 +00:00
|
|
|
# Stty is only needed for rcons on ppc64 nodes, but for mixed clusters require it on both x and p
|
2012-11-27 22:27:29 +00:00
|
|
|
Requires: perl-IO-Stty
|
|
|
|
%endif
|
2012-11-12 13:05:01 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
# The aix rpm cmd forces us to do this outside of ifos type stmts
|
2012-11-08 21:47:50 +00:00
|
|
|
%if %notpcm
|
2012-11-12 13:05:01 +00:00
|
|
|
%ifos linux
|
|
|
|
%ifnarch s390x
|
2012-11-08 21:47:50 +00:00
|
|
|
# PCM does not use or ship conserver
|
|
|
|
Requires: conserver-xcat
|
|
|
|
%endif
|
2009-05-05 20:22:26 +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
|
2013-01-18 17:26:23 +00:00
|
|
|
Requires: syslinux xCAT-genesis-scripts-x86_64 elilo-xcat
|
2011-11-08 17:43:22 +00:00
|
|
|
Requires: ipmitool-xcat >= 1.8.9
|
2012-11-08 21:47:50 +00:00
|
|
|
Requires: xnba-undi
|
2012-11-12 13:05:01 +00:00
|
|
|
%endif
|
2013-10-25 03:47:53 +00:00
|
|
|
%ifos linux
|
2013-11-07 01:05:46 +00:00
|
|
|
%ifarch ppc ppc64 ppc64le
|
2014-09-25 06:17:35 +00:00
|
|
|
Requires: xCAT-genesis-scripts-ppc64
|
2014-10-15 02:50:30 +00:00
|
|
|
Requires: ipmitool-xcat >= 1.8.9
|
2014-09-25 06:17:35 +00:00
|
|
|
%endif
|
2013-10-25 03:47:53 +00:00
|
|
|
%endif
|
2012-11-12 13:05:01 +00:00
|
|
|
|
2012-11-08 21:47:50 +00:00
|
|
|
%if %notpcm
|
2012-11-12 13:05:01 +00:00
|
|
|
%ifarch i386 i586 i686 x86 x86_64
|
2012-11-08 21:47:50 +00:00
|
|
|
# PCM does not need or ship syslinux-xcat
|
|
|
|
Requires: syslinux-xcat
|
|
|
|
%endif
|
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}
|
2013-12-17 07:23:38 +00:00
|
|
|
tar zxf %{SOURCE6}
|
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
|
2012-05-11 21:13:40 +00:00
|
|
|
# this is now handled by requiring /usr/sbin/dhcpd
|
|
|
|
#if [ -e "/etc/SuSE-release" ]; then
|
2011-01-17 09:01:37 +00:00
|
|
|
# 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.
|
2012-05-11 21:13:40 +00:00
|
|
|
#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
|
|
|
|
# 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
|
2011-01-17 09:01:37 +00:00
|
|
|
fi
|
2012-05-11 21:13:40 +00:00
|
|
|
%endif
|
2011-01-17 09:01:37 +00:00
|
|
|
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%install
|
2014-05-29 08:30:42 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/xcat/conf.orig
|
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}
|
2013-12-17 07:23:38 +00:00
|
|
|
tar zxf %{SOURCE6}
|
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 -
|
2014-05-29 08:30:42 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat.conf
|
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat.conf
|
|
|
|
cp %{SOURCE7} $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat.conf.apach24
|
2014-05-29 10:41:04 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat.conf.apach22
|
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
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%post
|
2014-04-21 10:20:55 +00:00
|
|
|
%ifos linux
|
2014-03-07 13:54:56 +00:00
|
|
|
#Apply the correct httpd/apache configuration file according to the httpd/apache version
|
2014-04-30 16:36:02 +00:00
|
|
|
if [ -n "$(httpd -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
|
2014-03-07 13:54:56 +00:00
|
|
|
then
|
2014-04-30 16:36:02 +00:00
|
|
|
rm -rf /etc/httpd/conf.d/xcat.conf
|
2014-05-29 08:30:42 +00:00
|
|
|
cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/httpd/conf.d/xcat.conf
|
|
|
|
fi
|
2014-04-30 16:36:02 +00:00
|
|
|
|
2014-05-29 08:30:42 +00:00
|
|
|
if [ -n "$(apachectl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
|
|
|
|
then
|
2014-04-30 16:36:02 +00:00
|
|
|
rm -rf /etc/apache2/conf.d/xcat.conf
|
2014-05-29 08:30:42 +00:00
|
|
|
cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf
|
2014-03-07 13:54:56 +00:00
|
|
|
fi
|
|
|
|
|
2014-10-31 09:48:33 +00:00
|
|
|
if [ -n "$(apache2ctl -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
|
|
|
|
then
|
|
|
|
rm -rf /etc/apache2/conf.d/xcat.conf
|
|
|
|
cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/apache2/conf.d/xcat.conf
|
|
|
|
fi
|
2014-03-07 13:54:56 +00:00
|
|
|
|
2014-04-21 10:20:55 +00:00
|
|
|
%endif
|
2014-03-07 13:54:56 +00:00
|
|
|
|
2012-09-20 14:30:14 +00:00
|
|
|
# create dir for the current pid
|
|
|
|
mkdir -p /var/run/xcat
|
|
|
|
|
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
|
2012-09-20 14:30:14 +00:00
|
|
|
if [ -r "/tmp/xcat/installservice.pid" ]; then
|
|
|
|
mv /tmp/xcat/installservice.pid /var/run/xcat/installservice.pid
|
|
|
|
fi
|
|
|
|
if [ -r "/tmp/xcat/udpservice.pid" ]; then
|
|
|
|
mv /tmp/xcat/udpservice.pid /var/run/xcat/udpservice.pid
|
|
|
|
fi
|
|
|
|
if [ -r "/tmp/xcat/mainservice.pid" ]; then
|
|
|
|
mv /tmp/xcat/mainservice.pid /var/run/xcat/mainservice.pid
|
|
|
|
fi
|
|
|
|
|
2009-07-31 14:57:18 +00:00
|
|
|
$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
|
|
|
|
|
2014-03-07 13:54:56 +00:00
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%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...
|
2014-05-29 08:30:42 +00:00
|
|
|
/etc/xcat/conf.orig/xcat.conf.apach24
|
2014-05-29 10:41:04 +00:00
|
|
|
/etc/xcat/conf.orig/xcat.conf.apach22
|
2014-05-29 08:30:42 +00:00
|
|
|
/etc/httpd/conf.d/xcat.conf
|
|
|
|
/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
|
2013-12-17 18:54:29 +00:00
|
|
|
%ifos linux
|
2013-12-17 07:23:38 +00:00
|
|
|
/install/winpostscripts
|
2013-12-17 18:54:29 +00:00
|
|
|
%endif
|
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
|
2014-03-07 13:54:56 +00:00
|
|
|
|
|
|
|
|
2010-04-19 09:24:37 +00:00
|
|
|
if [ "$1" = "0" ]; then
|
2014-03-07 13:54:56 +00:00
|
|
|
|
|
|
|
|
2010-04-19 09:24:37 +00:00
|
|
|
%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
|
|
|
|
|