Setting tag omf-5.3-11
[omf.git] / omf-resctl.spec
index 35c9907..8598705 100644 (file)
@@ -1,36 +1,30 @@
-#
-# $Id: madwifi.spec 16422 2010-01-04 11:33:08Z thierry $
-#
-%define url $URL: svn+ssh://thierry@svn.planet-lab.org/svn/madwifi/trunk/madwifi.spec $
-
-# Marc E. Fiuczynski <mef@cs.princeton.edu>
-# Copyright (C) 2006 The Trustees of Princeton University
+# Thierry Parmentelat - INRIA
+# Copyright (C) 2010 INRIA
 # License is GPL.
 
 %define name omf-resctl
 %define version 5.3
-%define release 1ubuntu2-2
-%define taglevel 1
+%define taglevel 11
 
-%define actual_name %{name}-%{version}-%{release}
+%define plc_name %{name}-%{version}-%{taglevel}
+%define resctl_actual_name omf-resctl-5.3-5.3.1-1
 
 Summary: OMF Resource Controller - for slivers
 Name: %{name}
 Version: %{version}
-Release: %{release}
+Release: %{taglevel}
 License: GPL
-Group: System Environment/Kernel
-Source0: %{actual_name}.noarch.rpm
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
+Group: System Environment/Base
+Source0: %{plc_name}.tar.bz2
+BuildRoot: %{_tmppath}/%{plc_name}-buildroot
 
 Vendor: NICTA
-Packager: PlanetLab <devel@planet-lab.eu>
-Distribution: PlanetLab %{plrelease}
-URL: %(echo %{url} | cut -d ' ' -f 2)
+Packager: OneLab <devel@planet-lab.org>
+Distribution: %{pldistro} %{plrelease}
+URL: %{SCMURL}
+
+BuildArch: noarch
 
-Requires: imagezip
-Requires: liblog4r-ruby1.8  
-Requires: libxmpp4r-ruby1.8  
 Requires: pciutils  
 Requires: ruby  
 Requires: wget  
@@ -38,31 +32,80 @@ Requires: wireless-tools
 Requires: rpmlib(CompressedFileNames) <= 3.0.4-1
 Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1
 
-Requires: omf-common-5.3  
+Requires: omf-common  
+Requires: liblog4r
+Requires: libxmpp4r
 
-%description The OMF Resource Controller (RC) is the experiment-side
-of the Experiment Eontroller (EC) that lets experimenter control their
+%description 
+The OMF Resource Controller (RC) is the experiment-side of the
+Experiment Controller (EC) that lets experimenter control their
 resources. It relies on an XMPP server for exchanging with its EC.
 
+####################
+%define common_actual_name omf-common-5.3-5.3.1-1
+
+%package -n omf-common
+Summary: OMF common utilities 
+Group: System Environment/Base
+%description -n omf-common
+Provides utilities common to various OMF components
+
+####################
+%define liblog4r_actual_name liblog4r-ruby1.8-1.2-1
+
+%package -n liblog4r
+Summary:  A logging library for Ruby
+Group: System Environment/Base
+%description -n liblog4r
+A logging library for Ruby, needed by OMF software
+
+####################
+%define libxmpp4r_actual_name libxmpp4r-ruby1.8-1.0-1
+
+%package -n libxmpp4r
+Summary:  XMPP/Jabber library for Ruby
+Group: System Environment/Base
+%description -n libxmpp4r
+An XMPP/Jabber library for Ruby, needed by OMF software
+
+####################
+
 %prep
-%setup -n %{actual_name}
+%setup -n %{plc_name}
 
 %build
 rm -rf $RPM_BUILD_ROOT
 
-make sources
 mkdir unwrap
-cd unwrap
-rpm2cpio ../omf-resctl*.rmp | cpio -diu
+
+make omf-resctl 
+(cd unwrap; rpm2cpio ../%{resctl_actual_name}.noarch.rpm | cpio -diu)
+make omf-common
+(cd unwrap ; rpm2cpio ../%{common_actual_name}.noarch.rpm | cpio -diu)
+make liblog4r 
+(cd unwrap; rpm2cpio ../%{liblog4r_actual_name}.noarch.rpm | cpio -diu)
+make libxmpp4r 
+(cd unwrap; rpm2cpio ../%{libxmpp4r_actual_name}.noarch.rpm | cpio -diu)
+
+# remove any default config if any
+rm -f unwrap/etc/omf-resctl-%{version}/omf-resctl.yaml
+
+# cleanup any svn sequels
+find unwrap -type d -name .svn -print0 | xargs -0 rm -rf
+find unwrap -type d -name .git -print0 | xargs -0 rm -rf
+
 
 %install
 rm -fr $RPM_BUILD_ROOT
 
-rsync -av unwrap/ $RPM_BUILD_ROOT
+rsync -a unwrap/ $RPM_BUILD_ROOT
+
+install -D -m 600 omf-resctl.yaml.in $RPM_BUILD_ROOT/etc/omf-resctl-%{version}/omf-resctl.yaml.in
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
+####################
 %files
 %defattr(-,root,root)
 /etc
@@ -70,8 +113,75 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/omf-resctl-%{version}
 /usr/share/doc
 
+#
 %post
-# tweak config in /etc/omf-resctl-5.3/
-mkdir /etc/omf-resctl-5.3/
+if [ -x /sbin/chkconfig ] ; then
+    /sbin/chkconfig --add omf-resctl-%{version}
+    /sbin/chkconfig omf-resctl-%{version} on
+    service omf-resctl-%{version} restart
+fi
+
+%preun
+# 0 = erase, 1 = upgrade
+if [ $1 -eq 0 ] ; then
+    service omf-resctl-%{version} stop
+    /sbin/chkconfig omf-resctl-%{version} off
+    /sbin/chkconfig --del omf-resctl-%{version}
+fi
+
+####################
+%files -n omf-common
+%defattr(-,root,root)
+/usr/share/omf-common-%{version}
+/usr/share/doc/omf-common-%{version}
+
+#
+%post -n omf-common
+ln -s /usr/bin/ruby /usr/bin/ruby1.8
+
+####################
+%files -n liblog4r
+%defattr(-,root,root)
+/usr/lib/ruby/1.8/log4r.rb
+/usr/lib/ruby/1.8/log4r
+/usr/share/doc/liblog4r-ruby1.8
 
+####################
+%files -n libxmpp4r
+%defattr(-,root,root)
+/usr/lib/ruby/1.8/xmpp4r.rb
+/usr/lib/ruby/1.8/xmpp4r
+/usr/share/doc/libxmpp4r-ruby1.8
+
+####################
 %changelog
+* Mon Aug 29 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-11
+- updated with latest from NICTA
+
+* Tue Feb 01 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-10
+- move to more recent releases of omf-resctl & related stuff
+
+* Mon Jan 24 2011 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-9
+- no semantic change - just fixed specfile for git URL
+
+* Mon Aug 30 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - omf-5.3-8
+- new packages from NICTA
+
+* Tue Jul 13 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - omf-5.3-7
+- fix omf-expctl build
+
+* Thu Jul 08 2010 Baris Metin <Talip-Baris.Metin@sophia.inria.fr> - omf-5.3-6
+- updated omf packages
+
+* Tue Jun 22 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-5
+- cleaned up specfile for smoother upgrades
+
+* Tue May 25 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-4
+- fix stupid typo in tag 5.3-3
+
+* Tue May 25 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-3
+- fetch from the tagged omf-5.3-federation-v1.1 - and turn SHA1SUM checking back on again
+
+* Fri Apr 02 2010 Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr> - omf-5.3-2
+- package the exp. controller as well for user convenience
+