2008-02-12 14:32:03 +00:00
|
|
|
Summary: Metapackage for a common, default xCAT service node setup
|
|
|
|
Name: xCATsn
|
2009-01-28 15:42:14 +00:00
|
|
|
Version: %(cat Version)
|
2008-02-12 14:32:03 +00:00
|
|
|
Release: snap%(date +"%Y%m%d%H%M")
|
2008-06-26 18:42:36 +00:00
|
|
|
Epoch: 4
|
2008-02-12 14:32:03 +00:00
|
|
|
License: EPL
|
|
|
|
Group: Applications/System
|
|
|
|
Vendor: IBM Corp.
|
|
|
|
Packager: IBM Corp.
|
|
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
|
|
|
Prefix: /opt/xcat
|
|
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
|
|
|
#BuildArch: noarch
|
|
|
|
Source1: xcat.conf
|
2009-01-28 15:42:14 +00:00
|
|
|
Source2: license.tar.gz
|
2010-01-25 13:41:46 +00:00
|
|
|
Source3: xCATSN
|
2012-12-31 05:04:33 +00:00
|
|
|
Source5: templates.tar.gz
|
2014-05-29 09:52:35 +00:00
|
|
|
Source6: xcat.conf.apach24
|
2008-02-12 14:32:03 +00:00
|
|
|
Provides: xCATsn = %{version}
|
2012-10-25 09:12:25 +00:00
|
|
|
Requires: xCAT-server xCAT-client perl-DBD-SQLite
|
2010-02-08 19:48:57 +00:00
|
|
|
|
|
|
|
Conflicts: xCAT
|
2008-02-12 14:32:03 +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-02-12 14:32:03 +00:00
|
|
|
%ifos linux
|
2014-06-25 11:10:11 +00:00
|
|
|
# on RHEL7, need to specify it explicitly
|
|
|
|
Requires: net-tools
|
|
|
|
Requires: /usr/bin/killall
|
2009-03-26 22:38:47 +00:00
|
|
|
# yaboot-xcat is pulled in so any SN can manage ppc nodes
|
2012-10-25 09:12:25 +00:00
|
|
|
Requires: httpd nfs-utils nmap bind
|
|
|
|
# On RHEL this pulls in dhcp, on SLES it pulls in dhcp-server
|
|
|
|
Requires: /usr/sbin/dhcpd
|
|
|
|
# On RHEL this pulls in openssh-server, on SLES it pulls in openssh
|
|
|
|
Requires: /usr/bin/ssh
|
2012-10-22 17:18:39 +00:00
|
|
|
%ifnarch s390x
|
2011-11-30 09:37:44 +00:00
|
|
|
Requires: /etc/xinetd.d/tftp
|
2012-10-25 09:12:25 +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-03-26 22:38:47 +00:00
|
|
|
%endif
|
2008-02-12 14:32:03 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%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-29 14:41:29 +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-11-07 01:05:46 +00:00
|
|
|
%ifos linux
|
|
|
|
%ifarch ppc ppc64 ppc64le
|
|
|
|
Requires: xCAT-genesis-scripts-ppc64
|
|
|
|
Requires: ipmitool-xcat >= 1.8.9
|
|
|
|
%endif
|
|
|
|
%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-02-12 14:32:03 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
xCATsn is a service node management package intended for at-scale management,
|
2009-03-21 13:54:13 +00:00
|
|
|
including hardware management and software management.
|
2008-02-12 14:32:03 +00:00
|
|
|
|
|
|
|
|
|
|
|
%prep
|
2009-01-28 15:42:14 +00:00
|
|
|
%ifos linux
|
|
|
|
tar zxf %{SOURCE2}
|
|
|
|
%else
|
|
|
|
cp %{SOURCE2} /opt/freeware/src/packages/BUILD
|
|
|
|
gunzip -f license.tar.gz
|
|
|
|
tar -xf license.tar
|
|
|
|
%endif
|
2008-02-12 14:32:03 +00:00
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
%install
|
2010-02-08 19:48:57 +00:00
|
|
|
%ifos linux
|
2014-05-29 09:52:35 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/xcat/conf.orig
|
2009-01-28 15:42:14 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/apache2/conf.d
|
2008-02-12 14:32:03 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/httpd/conf.d/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
2009-01-28 15:42:14 +00:00
|
|
|
# cd -
|
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/apache2/conf.d/xcat.conf
|
2008-02-12 14:32:03 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/httpd/conf.d/xcat.conf
|
2010-01-25 13:41:46 +00:00
|
|
|
cp %{SOURCE3} $RPM_BUILD_ROOT/etc/xCATSN
|
2014-05-29 09:52:35 +00:00
|
|
|
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat.conf.apach22
|
|
|
|
cp %{SOURCE6} $RPM_BUILD_ROOT/etc/xcat/conf.orig/xcat.conf.apach24
|
2008-02-12 14:32:03 +00:00
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT
|
|
|
|
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT
|
2012-12-31 05:04:33 +00:00
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
|
|
|
cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
|
|
|
tar zxf %{SOURCE5}
|
|
|
|
|
2010-02-08 19:48:57 +00:00
|
|
|
%else
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/etc/
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/xcat/
|
|
|
|
cp %{SOURCE3} $RPM_BUILD_ROOT/etc/xCATSN
|
2012-12-31 05:04:33 +00:00
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
|
|
|
cd $RPM_BUILD_ROOT/%{prefix}/share/xcat/
|
|
|
|
cp %{SOURCE5} $RPM_BUILD_ROOT/%{prefix}/share/xcat
|
|
|
|
gunzip -f templates.tar.gz
|
|
|
|
tar -xf templates.tar
|
|
|
|
rm templates.tar
|
|
|
|
|
2010-02-08 19:48:57 +00:00
|
|
|
%endif
|
2008-02-12 14:32:03 +00:00
|
|
|
|
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
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2012-05-04 17:16:42 +00:00
|
|
|
%post
|
2014-05-29 09:52:35 +00:00
|
|
|
%ifos linux
|
|
|
|
#Apply the correct httpd/apache configuration file according to the httpd/apache version
|
|
|
|
if [ -n "$(httpd -v 2>&1 |grep -e '^Server version\s*:.*\/2.4')" ]
|
|
|
|
then
|
|
|
|
rm -rf /etc/httpd/conf.d/xcat.conf
|
|
|
|
cp /etc/xcat/conf.orig/xcat.conf.apach24 /etc/httpd/conf.d/xcat.conf
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$(apachectl -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
|
|
|
|
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
2012-12-04 09:22:48 +00:00
|
|
|
# create dir for the current pid and move the original ones from /tmp/xcat to /var/run/xcat
|
|
|
|
mkdir -p /var/run/xcat
|
|
|
|
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
|
2010-12-15 15:47:28 +00:00
|
|
|
|
2008-02-12 14:32:03 +00:00
|
|
|
if [ "$1" = "1" ]; then #Only if installing for the first time..
|
2010-12-15 15:47:28 +00:00
|
|
|
|
|
|
|
# setup sqlite if no other database
|
|
|
|
|
|
|
|
%ifos linux
|
|
|
|
if [ -f "/proc/cmdline" ]; then #check to make sure this is not image install
|
2010-12-15 16:13:32 +00:00
|
|
|
if [ ! -s /etc/xcat/cfgloc ]; then # database is sqlite
|
2010-12-15 15:47:28 +00:00
|
|
|
$RPM_INSTALL_PREFIX0/sbin/xcatconfig -d
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
2008-05-16 11:11:59 +00:00
|
|
|
# so conserver will start
|
|
|
|
mkdir -p /var/log/consoles
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2008-11-20 17:43:54 +00:00
|
|
|
# remove any management node file
|
2008-11-21 13:15:40 +00:00
|
|
|
if [ -f /etc/xCATMN ]; then
|
2008-11-20 17:43:54 +00:00
|
|
|
rm /etc/xCATMN
|
2008-11-21 13:15:40 +00:00
|
|
|
fi
|
2012-11-29 17:27:56 +00:00
|
|
|
fi
|
|
|
|
# for install or upgrade restart the daemon
|
2010-02-08 19:48:57 +00:00
|
|
|
%ifos linux
|
2010-04-01 08:16:00 +00:00
|
|
|
if [ -e "/etc/redhat-release" ]; then
|
|
|
|
apachedaemon='httpd'
|
2014-06-09 15:58:56 +00:00
|
|
|
apacheserviceunit='httpd.service'
|
2010-04-01 08:16:00 +00:00
|
|
|
else # SuSE
|
|
|
|
apachedaemon='apache2'
|
|
|
|
fi
|
2012-11-29 17:06:25 +00:00
|
|
|
# start xcatd on linux
|
2014-06-09 15:58:56 +00:00
|
|
|
[ -e "/etc/init.d/$apachedaemon" ] && chkconfig $apachedaemon on
|
|
|
|
[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl enable $apacheserviceunit
|
2012-08-16 14:58:41 +00:00
|
|
|
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
2014-06-09 15:58:56 +00:00
|
|
|
XCATROOT=$RPM_INSTALL_PREFIX0 /etc/init.d/xcatd restart
|
|
|
|
[ -e "/etc/init.d/$apachedaemon" ] && /etc/init.d/$apachedaemon reload
|
|
|
|
[ -e "/usr/lib/systemd/system/$apacheserviceunit" ] && systemctl reload $apacheserviceunit
|
2012-11-29 17:27:56 +00:00
|
|
|
fi
|
2008-02-12 14:32:03 +00:00
|
|
|
echo "xCATsn is now installed"
|
2012-11-29 17:06:25 +00:00
|
|
|
%else
|
|
|
|
# start xcatd on AIX
|
|
|
|
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd
|
2012-11-29 17:27:56 +00:00
|
|
|
echo "xCATsn is now installed"
|
2012-11-29 17:06:25 +00:00
|
|
|
|
2010-02-08 19:48:57 +00:00
|
|
|
%endif
|
2008-02-12 14:32:03 +00:00
|
|
|
|
2013-01-18 17:26:23 +00:00
|
|
|
# Run mknb if xCAT-genesis-scripts-x86_64 changed
|
|
|
|
%ifos linux
|
|
|
|
# prevent running it during install into chroot image and only run it if xCAT-genesis-scripts-x86_64
|
|
|
|
# was recently updated.
|
|
|
|
if [ -f "/proc/cmdline" -a -f "/etc/xcat/genesis-scripts-updated" ]; then
|
|
|
|
rm -f /etc/xcat/genesis-scripts-updated
|
|
|
|
# On the SN do not run mknb if we are sharing /tftpboot with the MN
|
|
|
|
SHAREDTFTP=`/opt/xcat/sbin/tabdump site | grep sharedtftp | cut -d'"' -f 4`
|
|
|
|
if [ "$SHAREDTFTP" != "1" ]; then
|
|
|
|
. /etc/profile.d/xcat.sh
|
2013-06-05 23:04:36 +00:00
|
|
|
echo Running '"'mknb `uname -m`'"', triggered by the installation/update of xCAT-genesis-scripts-x86_64 ...
|
|
|
|
mknb `uname -m`
|
2013-01-18 17:26:23 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
2008-02-12 14:32:03 +00:00
|
|
|
%clean
|
|
|
|
|
|
|
|
%files
|
|
|
|
%{prefix}
|
2009-01-28 15:42:14 +00:00
|
|
|
# one for sles, one for rhel. yes, it's ugly...
|
2010-02-08 19:48:57 +00:00
|
|
|
%ifos linux
|
2014-05-29 09:52:35 +00:00
|
|
|
/etc/xcat/conf.orig/xcat.conf.apach24
|
|
|
|
/etc/xcat/conf.orig/xcat.conf.apach22
|
2008-02-12 14:32:03 +00:00
|
|
|
/etc/httpd/conf.d/xcat.conf
|
2009-01-28 15:42:14 +00:00
|
|
|
/etc/apache2/conf.d/xcat.conf
|
2010-02-08 19:48:57 +00:00
|
|
|
%endif
|
2010-01-25 13:41:46 +00:00
|
|
|
/etc/xCATSN
|
2008-02-12 14:32:03 +00:00
|
|
|
%defattr(-,root,root)
|