# # kit-pvfs.spec # # Builds: # # kit-pvfs-%{version}-%{release}.noarch.rpm # component-pvfs-client-%{version}-%{release}.noarch.rpm # component-pvfs-ioserver-%{version}-%{release}.noarch.rpm # component-pvfs-metaserver-%{version}-%{release}.noarch.rpm # %define pvfsvers 2.7.1 Name: kit-pvfs Version: %{pvfsvers} Release: 2%{?dist} Summary: PVFS kit for Platform OCS Group: System Environment/Base License: GPLv2 URL: http://platform.com BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # BuildRequires: Requires: kusu-base-installer pvfs-config = %{pvfsvers} BuildArch: noarch Source0: genconfig-pvfs2fsconf.py Source1: genconfig-pvfs2tab.py Source2: init-pvfs-server.sh Source3: initpvfs.sh Source4: genconfig-compenabledng.py Source5: pvfshelper.py %package -n component-pvfs-client Summary: PVFS %{pvfsvers} client component for Platform OCS Group: System Environment/Base Requires: pvfs = %{pvfsvers} pvfs-kernel = %{pvfsvers} %package -n component-pvfs-ioserver Summary: PVFS %{pvfsvers} I/O server component for Platform OCS Group: System Environment/Base Requires: pvfs = %{pvfsvers} pvfs-server = %{pvfsvers} %package -n component-pvfs-metaserver Summary: PVFS %{pvfsvers} metaserver component for Platform OCS Group: System Environment/Base Requires: pvfs = %{pvfsvers} pvfs-server = %{pvfsvers} %description %description -n component-pvfs-client PVFS %{pvfsvers} client component for Platform OCS %description -n component-pvfs-ioserver PVFS %{pvfsvers} I/O server component for Platform OCS %description -n component-pvfs-metaserver PVFS %{pvfsvers} metaserver component for Platform OCS %install if [ "$RPM_BUILD_ROOT" != "/" ]; then rm -rf $RPM_BUILD_ROOT; fi install -d $RPM_BUILD_ROOT/opt/kusu/lib/plugins/genconfig install -m644 %{SOURCE0} $RPM_BUILD_ROOT/opt/kusu/lib/plugins/genconfig/pvfs2fsconf.py install -m644 %{SOURCE1} $RPM_BUILD_ROOT/opt/kusu/lib/plugins/genconfig/pvfs2tab.py install -m644 %{SOURCE4} $RPM_BUILD_ROOT/opt/kusu/lib/plugins/genconfig/compenabledng.py install -d $RPM_BUILD_ROOT/opt/kusu/sbin install -m755 %{SOURCE2} $RPM_BUILD_ROOT/opt/kusu/sbin/init-pvfs-server install -m755 %{SOURCE3} $RPM_BUILD_ROOT/opt/kusu/sbin/initpvfs install -d $RPM_BUILD_ROOT/opt/kusu/lib/python/kusu/pvfs install -m644 %{SOURCE5} $RPM_BUILD_ROOT/opt/kusu/lib/python/kusu/pvfs touch $RPM_BUILD_ROOT/opt/kusu/lib/python/kusu/pvfs/__init__.py %clean if [ "$RPM_BUILD_ROOT" != "/" ]; then rm -rf $RPM_BUILD_ROOT; fi %files %defattr(-,root,root,-) /opt/kusu/lib/plugins/genconfig/pvfs2fsconf.py* /opt/kusu/lib/plugins/genconfig/pvfs2tab.py* /opt/kusu/lib/plugins/genconfig/compenabledng.py* /opt/kusu/sbin/initpvfs %dir /opt/kusu/lib/python/kusu/pvfs /opt/kusu/lib/python/kusu/pvfs/* %post if [ -f /var/lock/subsys/kusu-installer ]; then exit 0; fi # Get the kit ID KID=`/opt/kusu/sbin/sqlrunner -q "SELECT kid FROM kits WHERE rname='pvfs' and version='%{pvfsvers}'"` if [ $? -ne 0 ]; then # Error: unable to determine kid for PVFS kit exit 0 fi # Remove the component entries automatically created by kitops /opt/kusu/sbin/sqlrunner -q "DELETE FROM components WHERE kid=$KID" # Create PVFS components (ioserver, metaserver, and client) /opt/kusu/sbin/sqlrunner -q "INSERT INTO components (cname, cdesc, kid, os) VALUES ('component-pvfs-ioserver', 'PVFS I/O Server', $KID, 'rhel-5-x86_64')" /opt/kusu/sbin/sqlrunner -q "INSERT INTO components (cname, cdesc, kid, os) VALUES ('component-pvfs-metaserver', 'PVFS Metadata Server', $KID, 'rhel-5-x86_64')" /opt/kusu/sbin/sqlrunner -q "INSERT INTO components (cname, cdesc, kid, os) VALUES ('component-pvfs-client', 'PVFS Client', $KID, 'rhel-5-x86_64')" %preun KID=`/opt/kusu/sbin/sqlrunner -q "SELECT kid FROM kits WHERE rname='pvfs' and version='%{pvfsvers}'"` if [ $? -ne 0 ]; then echo "Database is down. Unable to remove kit." exit 1 fi %postun KID=`/opt/kusu/sbin/sqlrunner -q "SELECT kid FROM kits WHERE rname='pvfs' and version='%{pvfsvers}'"` if [ "x$KID" != "x" ]; then /opt/kusu/sbin/sqlrunner -q "DELETE FROM ng_has_comp WHERE cid in (select cid from components where kid=$KID)" fi %files -n component-pvfs-metaserver %defattr(-,root,root,-) /opt/kusu/sbin/init-pvfs-server %post -n component-pvfs-metaserver if [ -f /var/lock/subsys/kusu-installer ]; then exit 0; fi if [ "$1" = "1" ]; then # This block is executed only when the package is being installed # for the first time. : fi %postun -n component-pvfs-metaserver if [ "$1" = "0" ]; then # Package is being removed cat </opt/kusu/lib/plugins/cfmclient/component-pvfs-metaserver.remove rpm -e pvfs pvfs-server rm -f /opt/kusu/lib/plugins/cfmclient/component-pvfs-metaserver.remove EOF fi %files -n component-pvfs-ioserver %defattr(-,root,root,-) /opt/kusu/sbin/init-pvfs-server %post -n component-pvfs-ioserver if [ -f /var/lock/subsys/kusu-installer ]; then exit 0; fi if [ "$1" = "1" ]; then # This block is executed only when the package is being installed # for the first time. : fi %postun -n component-pvfs-ioserver if [ "$1" = "0" ]; then # Package is being removed cat </opt/kusu/lib/plugins/cfmclient/component-pvfs-ioserver.remove rpm -e pvfs pvfs-server rm -f /opt/kusu/lib/plugins/cfmclient/component-pvfs-ioserver.remove EOF fi %files -n component-pvfs-client %defattr(-,root,root,-) %post -n component-pvfs-client if [ -f /var/lock/subsys/kusu-installer ]; then exit 0; fi if [ "$1" = "1" ]; then # This block is executed only when the package is being installed # for the first time. : fi %postun -n component-pvfs-client if [ "$1" = "0" ]; then # Package is being removed cat </opt/kusu/lib/plugins/cfmclient/component-pvfs-client.remove rpm -e pvfs pvfs-kernel rm -f /opt/kusu/lib/plugins/cfmclient/component-pvfs-client.remove EOF fi %changelog * Tue Feb 3 2009 Mike Frisch 2.7.1-1 - Initial release