# Copyright (C) 2007 Platform Computing Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # %define _name rhel-ofed %define subversion 2 Summary: RHEL OFED Kit Name: kit-%{_name} Version: 1.3 Release: 3 License: GPL/BSD Group: System Environment/Base Vendor: Platform Computing Corporation BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot Source: kit-%{_name}-%{version}.%{subversion}.tar.gz URL: http://www.openfabrics.org/ BuildArch: noarch %define comp1 component-RHEL-OFED %define comp2 component-RHEL-OFED-devel %define SQLRUNNER /opt/kusu/sbin/sqlrunner %description This package is destined for the installer node and serves as an information container for the database. %prep %setup -q -n %{_name} %build %install rm -rf $RPM_BUILD_ROOT docdir=$RPM_BUILD_ROOT/depot/www/kits/%{_name}/%{version} /usr/bin/install -d $docdir/kit_ofed_doc_source /usr/bin/install -m 444 docs/*.html $docdir /usr/bin/install -m 444 docs/kit_ofed_doc_source/* -t $docdir/kit_ofed_doc_source %clean rm -rf $RPM_BUILD_ROOT %files # documentation /depot/www/kits/%{_name}/%{version}/index.html /depot/www/kits/%{_name}/%{version}/kit_ofed_doc_source #/depot/www/kits/%{_name}/%{version}/readme.html #/depot/www/kits/%{_name}/%{version}/LICENSE %post if [ $1 -eq 2 ]; then # This is an upgrade. Nothing to do exit 0 fi logfile=/var/log/kusu/%{_name}.log # include Node group creation and component association echo "POST Start" > $logfile KID=`%{SQLRUNNER} -q "SELECT kid FROM kits WHERE rname='%{_name}'"` echo "KID = $KID" >> $logfile # Setup the kit if [ -z "$KID" ] ; then # DO NOT SET THE KIT ARCH. There is a bug echo "Adding kit entries to database" >> $logfile %{SQLRUNNER} -q "INSERT INTO kits SET rname='%{_name}', rdesc='%{summary}', version='%{version}', isOS=0, removeable=1" 2>/dev/null KID=`%{SQLRUNNER} -q "SELECT kid FROM kits WHERE rname='%{_name}'"` echo "KID = $KID" >> $logfile else echo "Updating kit entries in database" >> $logfile %{SQLRUNNER} -q "UPDATE kits SET rdesc='%{summary}', version='%{version}', isOS=0, removeable=1 WHERE kid=$KID" 2>/dev/null fi # Setup the first component cid_imaged=`%{SQLRUNNER} -q "SELECT cid FROM components WHERE cname = '%{comp2}'"` echo "cid_imaged = $cid_imaged" >> $logfile if [ -z "$cid_imaged" ]; then echo "%{comp2} does not exist! creating.." >> $logfile %{SQLRUNNER} -q "INSERT INTO components SET cname='%{comp2}', cdesc='RHEL OFED development packages', os='rhel-5-x86_64', kid=$KID" else echo "Updating component %{comp2}" >> $logfile %{SQLRUNNER} -q "UPDATE components SET os='rhel-5-x86_64' WHERE cname='%{comp2}' AND kid=$KID" >> $logfile fi # Setup the second component cid_full=`%{SQLRUNNER} -q "SELECT cid FROM components WHERE cname='%{comp1}'"` >> $logfile echo "cid_full = $cid_full" >> $logfile if [ -z "$cid_full" ]; then echo "%{comp1} does not exist! creating.." >> $logfile %{SQLRUNNER} -q "INSERT INTO components SET cname='%{comp1}', cdesc='RHEL OFED packages', os='rhel-5-x86_64', kid=$KID" >> $logfile else echo "Updating component %{comp2}" >> $logfile %{SQLRUNNER} -q "UPDATE components SET os='rhel-5-x86_64' WHERE cname='%{comp1}' AND kid=$KID" >> $logfile fi echo "Stop post" >> $logfile exit 0 %postun # ------------------ POST UNINSTALL ------------------------- # Components and driverpacks are deleted by kitops. exit 0 %changelog * Tue Sep 11 2008 Mehdi Bozzo-Rey 1.3-3 - Update (components) * Thu Aug 28 2008 Mehdi Bozzo-Rey 1.3-2 - Updates for RHEL 5.2 rpm names * Thu Aug 21 2008 Mark Black 1.3-1 - Updates for RHEL 5.2 version * Tue Jul 29 2008 Mike Frisch 1.2.5-4 - Relocate installation log to /var/log/kusu/rhel-ofed.log (#112897) * Mon Jun 9 2008 Mark Black 1.2.5-3 - When upgrading rpm do not change db. * Thu Mar 27 2008 Mike Frisch 1.2.5-2 - Removed AutoReq tag at the request of Red Hat