2007-10-26 22:44:33 +00:00
|
|
|
Summary: xCAT perl libraries
|
|
|
|
Name: perl-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")
|
2008-06-26 18:42:36 +00:00
|
|
|
Epoch: 4
|
2007-10-26 22:44:33 +00:00
|
|
|
License: EPL
|
|
|
|
Group: System Environment/Libraries
|
2009-01-28 15:42:14 +00:00
|
|
|
Source: perl-xCAT-%(cat Version).tar.gz
|
2007-10-26 22:44:33 +00:00
|
|
|
Packager: IBM Corp.
|
|
|
|
Vendor: IBM Corp.
|
|
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
2007-12-11 19:15:28 +00:00
|
|
|
Prefix: /opt/xcat
|
2007-10-26 22:44:33 +00:00
|
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
|
|
|
%ifos linux
|
|
|
|
BuildArch: noarch
|
2012-01-27 00:23:24 +00:00
|
|
|
# Do not need the SOAP rpm require, because rpm will generate it automatically if hpoa.pm is included
|
|
|
|
#Requires: perl-SOAP-Lite
|
2007-10-26 22:44:33 +00:00
|
|
|
%endif
|
|
|
|
|
2010-11-24 16:49:34 +00:00
|
|
|
Provides: perl-xCAT = %{epoch}:%{version}
|
2007-10-26 22:44:33 +00:00
|
|
|
|
|
|
|
%description
|
|
|
|
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
|
|
|
|
Includes xCAT::Table, xCAT::NodeRange, among others.
|
|
|
|
|
2012-01-27 00:23:24 +00:00
|
|
|
%define zvm %(if [ "$zvm" = "1" ];then echo 1; else echo 0; fi)
|
|
|
|
|
2008-08-04 14:25:15 +00:00
|
|
|
%prep
|
2009-01-28 15:42:14 +00:00
|
|
|
%setup -q -n perl-xCAT
|
2007-10-26 22:44:33 +00:00
|
|
|
%build
|
2008-02-27 19:52:07 +00:00
|
|
|
# This phase is done in (for RH): /usr/src/redhat/BUILD/perl-xCAT-2.0
|
|
|
|
# All of the tarball source has been unpacked there and is in the same file structure
|
|
|
|
# as it is in svn.
|
|
|
|
|
2009-01-28 15:42:14 +00:00
|
|
|
# Modify the Version() function in xCAT/Utils.pm to automatically have the correct version
|
2013-08-14 15:59:38 +00:00
|
|
|
./modifyUtils %{version}
|
2009-01-28 15:42:14 +00:00
|
|
|
|
2008-08-02 16:18:07 +00:00
|
|
|
# Build the pod version of the man pages for each DB table. It puts them in the man5 and man7 subdirs.
|
|
|
|
# Then convert the pods to man pages and html pages.
|
2008-02-27 19:52:07 +00:00
|
|
|
./db2man
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%install
|
2008-02-27 19:52:07 +00:00
|
|
|
# The install phase puts all of the files in the paths they should be in when the rpm is
|
|
|
|
# installed on a system. The RPM_BUILD_ROOT is a simulated root file system and usually
|
|
|
|
# has a value like: /var/tmp/perl-xCAT-2.0-snap200802270932-root
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
|
2008-02-27 19:52:07 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man5
|
2008-03-17 13:34:40 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man5
|
2008-08-02 16:18:07 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man7
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man7
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
cp -r xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
|
2009-02-02 14:50:09 +00:00
|
|
|
chmod 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data
|
2007-12-11 19:15:28 +00:00
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/data/*
|
|
|
|
|
2009-11-13 20:00:31 +00:00
|
|
|
|
2012-01-27 00:23:24 +00:00
|
|
|
# For now, don't ship these plugins on AIX, to avoid AIX dependency error.
|
2009-11-13 20:00:31 +00:00
|
|
|
%ifnos linux
|
2010-02-11 17:10:32 +00:00
|
|
|
rm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/hpoa.pm
|
2009-11-13 20:00:31 +00:00
|
|
|
%endif
|
|
|
|
|
2012-01-27 00:23:24 +00:00
|
|
|
# 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
|
2012-02-01 01:01:27 +00:00
|
|
|
# have to put PPCdb.pm back because it is needed by Postage.pm
|
|
|
|
cp xCAT/PPCdb.pm $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/PPCdb.pm
|
2012-01-27 00:23:24 +00:00
|
|
|
%endif
|
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/perl-xCAT/*
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2008-02-29 17:33:27 +00:00
|
|
|
cp README $RPM_BUILD_ROOT/%{prefix}
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/README
|
|
|
|
|
2008-02-27 19:52:07 +00:00
|
|
|
# These were built dynamically in the build phase
|
|
|
|
cp share/man/man5/* $RPM_BUILD_ROOT/%{prefix}/share/man/man5
|
2008-03-17 13:34:40 +00:00
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/man/man5/*
|
|
|
|
cp share/doc/man5/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man5
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man5/*
|
2008-08-02 16:18:07 +00:00
|
|
|
cp share/man/man7/* $RPM_BUILD_ROOT/%{prefix}/share/man/man7
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/man/man7/*
|
|
|
|
cp share/doc/man7/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man7
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man7/*
|
2008-02-27 19:52:07 +00:00
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%clean
|
2008-02-27 19:52:07 +00:00
|
|
|
# This step does not happen until *after* the %files packaging below
|
2007-12-11 19:15:28 +00:00
|
|
|
rm -rf $RPM_BUILD_ROOT
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
#find $RPM_BUILD_ROOT -type f | sed -e "s@$RPM_BUILD_ROOT@/@" > files.list
|
2007-10-29 18:01:11 +00:00
|
|
|
|
2007-12-11 19:15:28 +00:00
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
#%doc LICENSE.html
|
2008-02-27 19:52:07 +00:00
|
|
|
#%doc README
|
|
|
|
# Just package everything that has been copied into RPM_BUILD_ROOT
|
2007-12-11 19:15:28 +00:00
|
|
|
%{prefix}
|
2007-10-26 22:44:33 +00:00
|
|
|
|
2012-05-04 14:29:20 +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-04-25 17:21:55 +00:00
|
|
|
%post
|
2008-05-03 13:26:14 +00:00
|
|
|
%ifos linux
|
2008-04-25 17:21:55 +00:00
|
|
|
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
2008-05-21 20:33:25 +00:00
|
|
|
if [ -x /etc/init.d/xcatd ] && [ -f "/proc/cmdline" ]; then
|
2008-04-25 17:21:55 +00:00
|
|
|
. /etc/profile.d/xcat.sh
|
2009-10-02 19:19:26 +00:00
|
|
|
/etc/init.d/xcatd reload
|
2008-04-25 17:21:55 +00:00
|
|
|
fi
|
|
|
|
fi
|
2010-08-27 15:41:42 +00:00
|
|
|
%else
|
|
|
|
if [ "$1" -gt 1 ]; then #Ugrade only, restart daemon and migrate settings
|
2011-02-17 06:23:33 +00:00
|
|
|
if [ -n "$INUCLIENTS" ] && [ $INUCLIENTS -eq 1 ]; then
|
|
|
|
#Do nothing in not running system
|
2011-02-17 08:16:54 +00:00
|
|
|
echo "Do not restartxcatd in not running system"
|
2011-02-17 06:23:33 +00:00
|
|
|
else
|
|
|
|
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/restartxcatd -r
|
|
|
|
fi
|
2010-08-27 15:41:42 +00:00
|
|
|
fi
|
2008-05-03 13:26:14 +00:00
|
|
|
%endif
|
2010-12-20 02:56:35 +00:00
|
|
|
exit 0
|
|
|
|
|
2007-10-26 22:44:33 +00:00
|
|
|
%changelog
|
|
|
|
* Wed May 2 2007 - Norm Nott nott@us.ibm.com
|
|
|
|
- Made changes to make this work on AIX
|
|
|
|
|
|
|
|
* Wed Jan 24 2007 Jarrod Johnson <jbjohnso@us.ibm.com>
|
|
|
|
-It begins
|
|
|
|
|