4 rpms
[omf.git] / omf-resctl.spec
1 #
2 # $Id$
3 #
4 %define url $URL$
5
6 # Marc E. Fiuczynski <mef@cs.princeton.edu>
7 # Copyright (C) 2006 The Trustees of Princeton University
8 # License is GPL.
9
10 %define name omf-resctl
11 %define version 5.3
12 %define taglevel 1
13
14 %define plc_name %{name}-%{version}-%{taglevel}
15 %define actual_name omf-resctl-5.3-1ubuntu2-2
16
17 Summary: OMF Resource Controller - for slivers
18 Name: %{name}
19 Version: %{version}
20 Release: %{taglevel}
21 License: GPL
22 Group: System Environment/Base
23 Source0: %{plc_name}.tar.bz2
24 BuildRoot: %{_tmppath}/%{plc_name}-buildroot
25
26 Vendor: NICTA
27 Packager: PlanetLab <devel@planet-lab.org>
28 Distribution: %{pldistro} %{plrelease}
29 URL: %(echo %{url} | cut -d ' ' -f 2)
30 BuildArch: noarch
31
32 Requires: imagezip
33 Requires: pciutils  
34 Requires: ruby  
35 Requires: wget  
36 Requires: wireless-tools  
37 Requires: rpmlib(CompressedFileNames) <= 3.0.4-1
38 Requires: rpmlib(PayloadFilesHavePrefix) <= 4.0-1
39
40 Requires: omf-common  
41 Requires: liblog4r
42 Requires: libxmpp4r
43
44 %description 
45 The OMF Resource Controller (RC) is the experiment-side of the
46 Experiment Eontroller (EC) that lets experimenter control their
47 resources. It relies on an XMPP server for exchanging with its EC.
48
49 ####################
50 %define common_actual_name omf-common-5.3-1ubuntu3-2
51
52 %package -n omf-common
53 Summary: OMF common utilities 
54 Group: System Environment/Base
55 %description -n omf-common
56 Provides utilities common to various OMF components
57
58 ####################
59 %define liblog4r_actual_name liblog4r-ruby1.8-1.2-1
60
61 %package -n liblog4r
62 Summary:  A logging library for Ruby
63 Group: System Environment/Base
64 %description -n liblog4r
65 A logging library for Ruby, needed by OMF software
66
67 ####################
68 %define libxmpp4r_actual_name libxmpp4r-ruby1.8-1.0-1
69
70 %package -n libxmpp4r
71 Summary:  XMPP/Jabber library for Ruby
72 Group: System Environment/Base
73 %description -n libxmpp4r
74 An XMPP/Jabber library for Ruby, needed by OMF software
75
76 ####################
77
78 %prep
79 %setup -n %{plc_name}
80
81 %build
82 rm -rf $RPM_BUILD_ROOT
83
84 mkdir unwrap
85
86 make omf-resctl 
87 (cd unwrap; rpm2cpio ../%{actual_name}.noarch.rpm | cpio -diu)
88 make omf-common
89 (cd unwrap ; rpm2cpio ../%{common_actual_name}.noarch.rpm | cpio -diu)
90 make liblog4r 
91 (cd unwrap; rpm2cpio ../%{liblog4r_actual_name}.noarch.rpm | cpio -diu)
92 make libxmpp4r 
93 (cd unwrap; rpm2cpio ../%{libxmpp4r_actual_name}.noarch.rpm | cpio -diu)
94
95 # cleanup svn sequels
96 find unwrap -type d -name .svn -print0 | xargs -0 rm -rf
97
98 %install
99 rm -fr $RPM_BUILD_ROOT
100
101 rsync -a unwrap/ $RPM_BUILD_ROOT
102
103 %clean
104 rm -rf $RPM_BUILD_ROOT
105
106 ####################
107 %files
108 %defattr(-,root,root)
109 /etc
110 /usr/sbin
111 /usr/share/omf-resctl-%{version}
112 /usr/share/doc
113
114 #
115 %post
116 mkdir /etc/omf-resctl-5.3/
117 # xxx tweak config in /etc/omf-resctl-5.3/
118 /sbin/chkconfig --add omf-resctl-5.3
119 service omf-resctl-5.3 restart
120
121 ####################
122 %files -n omf-common
123 %defattr(-,root,root)
124 /usr/share/omf-common-%{version}
125 /usr/share/doc/omf-common-%{version}
126
127 #
128 %post -n omf-common
129 ln -s /usr/bin/ruby /usr/bin/ruby1.8
130
131 ####################
132 %files -n liblog4r
133 %defattr(-,root,root)
134 /usr/lib/ruby/1.8/log4r.rb
135 /usr/lib/ruby/1.8/log4r
136 /usr/share/doc/liblog4r-ruby1.8
137
138 ####################
139 %files -n libxmpp4r
140 %defattr(-,root,root)
141 /usr/lib/ruby/1.8/xmpp4r.rb
142 /usr/lib/ruby/1.8/xmpp4r
143 /usr/share/doc/libxmpp4r-ruby1.8
144
145 ####################
146 %changelog