2012-11-01 17:22:53 +00:00
|
|
|
Summary: xCAT buildkit tools and sample kit
|
|
|
|
Name: xCAT-buildkit
|
|
|
|
Version: %(cat Version)
|
|
|
|
Release: snap%(date +"%Y%m%d%H%M")
|
|
|
|
Epoch: 4
|
|
|
|
License: EPL
|
|
|
|
Group: Applications/System
|
|
|
|
Source: xCAT-buildkit-%(cat Version).tar.gz
|
|
|
|
Packager: IBM Corp.
|
|
|
|
Vendor: IBM Corp.
|
|
|
|
Distribution: %{?_distribution:%{_distribution}}%{!?_distribution:%{_vendor}}
|
|
|
|
Prefix: /opt/xcat
|
|
|
|
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root
|
|
|
|
|
|
|
|
#%ifnos linux
|
|
|
|
AutoReqProv: no
|
|
|
|
#%endif
|
|
|
|
|
|
|
|
# AIX will build with an arch of "ppc"
|
|
|
|
# also need to fix Requires for AIX
|
|
|
|
%ifos linux
|
|
|
|
BuildArch: noarch
|
|
|
|
#Requires:
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# No dependencies on any other xCAT rpms
|
|
|
|
# so that this rpm can be installed in a separate build server
|
|
|
|
Requires: rpm-build
|
|
|
|
|
|
|
|
Provides: xCAT-buildkit = %{epoch}:%{version}
|
|
|
|
|
|
|
|
%description
|
|
|
|
xCAT-buildkit provides the buildkit tool and sample kit files to build an xCAT kit.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n xCAT-buildkit
|
|
|
|
%build
|
2012-11-14 13:17:34 +00:00
|
|
|
# Convert pods to man pages and html pages
|
|
|
|
mkdir -p share/man/man1
|
|
|
|
mkdir -p share/doc/man1
|
|
|
|
pod2man pods/man1/buildkit.1.pod > share/man/man1/buildkit.1
|
|
|
|
pod2html pods/man1/buildkit.1.pod > share/doc/man1/buildkit.1.html
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-11-01 17:22:53 +00:00
|
|
|
%install
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT
|
2012-11-14 13:17:34 +00:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
|
|
|
|
|
|
|
# These were built dynamically in the build phase
|
|
|
|
cp share/man/man1/* $RPM_BUILD_ROOT/%{prefix}/share/man/man1
|
|
|
|
chmod 444 $RPM_BUILD_ROOT/%{prefix}/share/man/man1/*
|
|
|
|
cp share/doc/man1/* $RPM_BUILD_ROOT/%{prefix}/share/doc/man1
|
|
|
|
chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/man1/*
|
|
|
|
|
2012-11-01 17:22:53 +00:00
|
|
|
|
|
|
|
%ifos linux
|
|
|
|
cp -aR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/
|
2012-11-02 14:19:47 +00:00
|
|
|
#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/*
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type d -exec chmod 755 {} \;
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits -type f -exec chmod 644 {} \;
|
2012-11-01 17:22:53 +00:00
|
|
|
cp -a lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT
|
2012-11-02 14:19:47 +00:00
|
|
|
#chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type d -exec chmod 755 {} \;
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT -type f -exec chmod 644 {} \;
|
2012-11-01 17:22:53 +00:00
|
|
|
cp -a bin/* $RPM_BUILD_ROOT/%{prefix}/bin/
|
|
|
|
chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
|
|
|
|
%else
|
|
|
|
cp -hpR share/xcat/kits/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/
|
|
|
|
chmod -R 644 $RPM_BUILD_ROOT/%{prefix}/share/xcat/kits/*
|
|
|
|
cp -hpR lib/perl/xCAT/* $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/
|
|
|
|
chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT/*
|
|
|
|
cp -hpR bin/* $RPM_BUILD_ROOT/%{prefix}/bin/
|
|
|
|
chmod -R 755 $RPM_BUILD_ROOT/%{prefix}/bin/*
|
|
|
|
%endif
|
|
|
|
|
|
|
|
mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit
|
|
|
|
cp LICENSE.html $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit
|
2012-11-02 14:19:47 +00:00
|
|
|
#chmod 644 $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit/*
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit -type d -exec chmod 755 {} \;
|
|
|
|
find $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-buildkit -type f -exec chmod 644 {} \;
|
|
|
|
#echo $RPM_BUILD_ROOT %{prefix}
|
2012-11-01 17:22:53 +00:00
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
#%doc LICENSE.html
|
|
|
|
%{prefix}
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
%post
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|