2008-02-08 17:59:49 +00:00
|
|
|
Summary: RMC monitoring plug-in for xCAT
|
|
|
|
Name: xCAT-rmc
|
2009-01-28 15:42:14 +00:00
|
|
|
Version: %(cat Version)
|
2008-02-08 17:59:49 +00:00
|
|
|
Release: snap%(date +"%Y%m%d%H%M")
|
2008-06-26 18:42:36 +00:00
|
|
|
Epoch: 4
|
2008-02-08 17:59:49 +00:00
|
|
|
License: EPL
|
|
|
|
Group: System Environment/Libraries
|
2009-01-28 15:42:14 +00:00
|
|
|
Source: xCAT-rmc-%(cat Version).tar.gz
|
2008-02-08 17:59:49 +00:00
|
|
|
Packager: IBM Corp.
|
|
|
|
Vendor: IBM Corp.
|
|
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
|
|
|
Prefix: /opt/xcat
|
|
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
|
|
|
%ifos linux
|
|
|
|
BuildArch: noarch
|
|
|
|
%endif
|
|
|
|
|
2009-06-25 19:21:30 +00:00
|
|
|
Requires: perl-xCAT >= %{epoch}:%(cat Version|cut -d. -f 1,2)
|
|
|
|
Requires: xCAT-server >= %{epoch}:%(cat Version|cut -d. -f 1,2)
|
2008-02-16 01:25:59 +00:00
|
|
|
|
2008-02-08 17:59:49 +00:00
|
|
|
Provides: xCAT-rmc = %{version}
|
|
|
|
|
|
|
|
%description
|
2008-06-19 16:50:18 +00:00
|
|
|
Provides RMC monitoring plug-in module for xCAT, configuration scripts, predefined conditions, responses and sensors.
|
2008-02-08 17:59:49 +00:00
|
|
|
|
|
|
|
%prep
|
2009-01-28 15:42:14 +00:00
|
|
|
%setup -q -n xCAT-rmc
|
2008-02-08 17:59:49 +00:00
|
|
|
%build
|
|
|
|
%install
|
|
|
|
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/rmc
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon
|
2010-11-12 14:51:51 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
|
2008-02-08 17:59:49 +00:00
|
|
|
|
|
|
|
cp plugin/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring
|
|
|
|
cp -r resources $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_monitoring/rmc
|
|
|
|
|
2008-06-20 17:51:55 +00:00
|
|
|
cp scripts/* $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon
|
2008-02-08 17:59:49 +00:00
|
|
|
chmod 755 $RPM_BUILD_ROOT/%{prefix}/sbin/rmcmon/*
|
2010-11-12 14:51:51 +00:00
|
|
|
|
|
|
|
cp lib/perl/TEAL/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/TEAL
|
2008-02-08 17:59:49 +00:00
|
|
|
|
2009-06-01 20:39:29 +00:00
|
|
|
|
2008-02-08 17:59:49 +00:00
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
#find $RPM_BUILD_ROOT -type f | sed -e "s@$RPM_BUILD_ROOT@/@" > files.list
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
%{prefix}
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
2008-10-01 16:08:51 +00:00
|
|
|
%post
|
2011-11-08 15:46:31 +00:00
|
|
|
needCopyFiles=0
|
|
|
|
if [ -f /etc/xCATMN ]; then
|
|
|
|
#on MN
|
|
|
|
needCopyFiles=1;
|
|
|
|
else
|
|
|
|
#om SN
|
|
|
|
mounted=0
|
|
|
|
result=`mount |grep /install`
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
mounted=1
|
|
|
|
fi
|
|
|
|
if [ $mounted -eq 0 ]; then
|
|
|
|
needCopyFiles=1;
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $needCopyFiles -eq 1 ]; then
|
|
|
|
echo "Copying files to /install/postscripts directory..."
|
|
|
|
mkdir -p /install/postscripts
|
|
|
|
mkdir -p /install/postscripts/rmcmon/resources/node
|
|
|
|
mkdir -p /install/postscripts/rmcmon/scripts
|
|
|
|
cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/configrmcnode /install/postscripts
|
|
|
|
chmod 755 /install/postscripts/configrmcnode
|
|
|
|
|
|
|
|
FILES_TO_COPY=`cat $RPM_INSTALL_PREFIX0/sbin/rmcmon/scripts_to_node|tr '\n' ' '`
|
|
|
|
for file in $FILES_TO_COPY
|
|
|
|
do
|
|
|
|
#echo "file=$file"
|
|
|
|
cp $RPM_INSTALL_PREFIX0/sbin/rmcmon/$file /install/postscripts/rmcmon/scripts
|
|
|
|
done
|
|
|
|
chmod 755 /install/postscripts/rmcmon/scripts/*
|
|
|
|
|
|
|
|
cp -r $RPM_INSTALL_PREFIX0/lib/perl/xCAT_monitoring/rmc/resources/node/* /install/postscripts/rmcmon/resources/node
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2008-10-01 16:08:51 +00:00
|
|
|
%ifos linux
|
|
|
|
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
|
2008-12-11 16:08:45 +00:00
|
|
|
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
|
2009-10-02 19:19:26 +00:00
|
|
|
/etc/init.d/xcatd reload
|
2008-11-09 00:15:30 +00:00
|
|
|
fi
|
2008-10-01 16:08:51 +00:00
|
|
|
fi
|
|
|
|
%else
|
2008-11-09 00:15:30 +00:00
|
|
|
#restart the xcatd on if xCAT or xCATsn is installed already
|
2008-12-11 16:08:45 +00:00
|
|
|
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
|
2011-02-17 08:33:15 +00:00
|
|
|
if [ -n "$INUCLIENTS" ] && [ $INUCLIENTS -eq 1 ]; then
|
|
|
|
#Do nothing in not running system
|
|
|
|
echo "Do not restartxcatd in not running system"
|
|
|
|
else
|
|
|
|
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
|
|
|
|
fi
|
2008-11-09 00:15:30 +00:00
|
|
|
fi
|
2008-10-01 16:08:51 +00:00
|
|
|
%endif
|
2010-08-29 11:55:39 +00:00
|
|
|
exit 0
|
2008-02-08 17:59:49 +00:00
|
|
|
|
2008-10-31 12:56:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|