-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlibvirt-cim.spec.in
390 lines (361 loc) · 16.1 KB
/
libvirt-cim.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# -*- rpm-spec -*-
Summary: A CIM provider for libvirt
Name: libvirt-cim
Version: @PACKAGE_VERSION@
Release: 1%{?dist}%{?extra_release}
License: LGPLv2+
Group: Development/Libraries
Source: ftp://libvirt.org/libvirt-cim/libvirt-cim-%{version}.tar.xz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
URL: http://libvirt.org/CIM/
Requires: libxml2 >= 2.6.0
Requires: libvirt >= 0.9.0
Requires: unzip
# either tog-pegasus or sblim-sfcb should provide cim-server
Requires: cim-server
BuildRequires: libcmpiutil >= 0.5.4
BuildRequires: tog-pegasus-devel
BuildRequires: libvirt-devel >= 0.9.0
# In RHEL5 uuid-devel is provided by e2fsprogs
%if 0%{?el5}
BuildRequires: e2fsprogs-devel
%else
BuildRequires: libuuid-devel
BuildRequires: libconfig-devel
%endif
BuildRequires: libxml2-devel
BuildRequires: libcmpiutil-devel
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
BuildRequires: systemd-units
%endif
BuildConflicts: sblim-cmpi-devel
%description
Libvirt-cim is a CMPI CIM provider that implements the DMTF SVPC
virtualization model. The goal is to support most of the features
exported by libvirt itself, enabling management of multiple
platforms with a single provider.
%prep
%setup -q
%build
%configure --disable-werror
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%install
rm -fr $RPM_BUILD_ROOT
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.la
rm -f $RPM_BUILD_ROOT%{_libdir}/cmpi/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so
mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d
echo %{_libdir}/cmpi > $RPM_BUILD_ROOT/etc/ld.so.conf.d/libvirt-cim.%{_arch}.conf
mkdir -p $RPM_BUILD_ROOT@INFO_STORE@
mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-cim-%{version} libvirt-cim-docs
%clean
rm -fr $RPM_BUILD_ROOT
%define REGISTRATION %{_datadir}/%{name}/ComputerSystem.registration \\\
%{_datadir}/%{name}/LogicalDisk.registration \\\
%{_datadir}/%{name}/NetworkPort.registration \\\
%{_datadir}/%{name}/Memory.registration \\\
%{_datadir}/%{name}/Processor.registration \\\
%{_datadir}/%{name}/SystemDevice.registration \\\
%{_datadir}/%{name}/VSSD.registration \\\
%{_datadir}/%{name}/HostSystem.registration \\\
%{_datadir}/%{name}/HostedDependency.registration \\\
%{_datadir}/%{name}/VirtualSystemManagementService.registration \\\
%{_datadir}/%{name}/VirtualSystemManagementCapabilities.registration \\\
%{_datadir}/%{name}/EnabledLogicalElementCapabilities.registration \\\
%{_datadir}/%{name}/AllocationCapabilities.registration \\\
%{_datadir}/%{name}/SettingsDefineCapabilities.registration \\\
%{_datadir}/%{name}/MemoryPool.registration \\\
%{_datadir}/%{name}/ElementCapabilities.registration \\\
%{_datadir}/%{name}/ProcessorPool.registration \\\
%{_datadir}/%{name}/DiskPool.registration \\\
%{_datadir}/%{name}/HostedResourcePool.registration \\\
%{_datadir}/%{name}/ComputerSystemIndication.registration \\\
%{_datadir}/%{name}/ResourceAllocationSettingDataIndication.registration \\\
%{_datadir}/%{name}/SwitchService.registration \\\
%{_datadir}/%{name}/ComputerSystemMigrationIndication.registration \\\
%{_datadir}/%{name}/ResourceAllocationSettingData.registration \\\
%{_datadir}/%{name}/ResourcePoolConfigurationService.registration \\\
%{_datadir}/%{name}/ResourcePoolConfigurationCapabilities.registration \\\
%{_datadir}/%{name}/VSSDComponent.registration \\\
%{_datadir}/%{name}/SettingsDefineState.registration \\\
%{_datadir}/%{name}/NetPool.registration \\\
%{_datadir}/%{name}/ResourceAllocationFromPool.registration \\\
%{_datadir}/%{name}/ElementAllocatedFromPool.registration \\\
%{_datadir}/%{name}/HostedService.registration \\\
%{_datadir}/%{name}/ElementSettingData.registration \\\
%{_datadir}/%{name}/VSMigrationCapabilities.registration \\\
%{_datadir}/%{name}/VSMigrationService.registration \\\
%{_datadir}/%{name}/ElementConformsToProfile.registration \\\
%{_datadir}/%{name}/VSMigrationSettingData.registration \\\
%{_datadir}/%{name}/VirtualSystemSnapshotService.registration \\\
%{_datadir}/%{name}/VirtualSystemSnapshotServiceCapabilities.registration \\\
%{_datadir}/%{name}/ConcreteComponent.registration \\\
%{_datadir}/%{name}/ConsoleRedirectionService.registration \\\
%{_datadir}/%{name}/ConsoleRedirectionServiceCapabilities.registration \\\
%{_datadir}/%{name}/ServiceAffectsElement.registration \\\
%{_datadir}/%{name}/KVMRedirectionSAP.registration \\\
%{_datadir}/%{name}/DisplayController.registration \\\
%{_datadir}/%{name}/Controller.registration \\\
%{_datadir}/%{name}/PointingDevice.registration \\\
%{_datadir}/%{name}/GraphicsPool.registration \\\
%{_datadir}/%{name}/InputPool.registration \\\
%{_datadir}/%{name}/ControllerPool.registration \\\
%{_datadir}/%{name}/HostedAccessPoint.registration \\\
%{_datadir}/%{name}/ServiceAccessBySAP.registration \\\
%{_datadir}/%{name}/SAPAvailableForElement.registration \\\
%{_datadir}/%{name}/FilterEntry.registration \\\
%{_datadir}/%{name}/FilterList.registration \\\
%{_datadir}/%{name}/EntriesInFilterList.registration \\\
%{_datadir}/%{name}/NestedFilterList.registration \\\
%{_datadir}/%{name}/AppliedFilterList.registration \\\
%{_datadir}/%{name}/HostedFilterList.registration
%define SCHEMA %{_datadir}/%{name}/ComputerSystem.mof \\\
%{_datadir}/%{name}/LogicalDisk.mof \\\
%{_datadir}/%{name}/NetworkPort.mof \\\
%{_datadir}/%{name}/Memory.mof \\\
%{_datadir}/%{name}/Processor.mof \\\
%{_datadir}/%{name}/SystemDevice.mof \\\
%{_datadir}/%{name}/Virt_VSSD.mof \\\
%{_datadir}/%{name}/VSSD.mof \\\
%{_datadir}/%{name}/HostSystem.mof \\\
%{_datadir}/%{name}/HostedDependency.mof \\\
%{_datadir}/%{name}/VirtualSystemManagementService.mof \\\
%{_datadir}/%{name}/VirtualSystemManagementCapabilities.mof \\\
%{_datadir}/%{name}/EnabledLogicalElementCapabilities.mof \\\
%{_datadir}/%{name}/AllocationCapabilities.mof \\\
%{_datadir}/%{name}/SettingsDefineCapabilities.mof \\\
%{_datadir}/%{name}/MemoryPool.mof \\\
%{_datadir}/%{name}/ElementCapabilities.mof \\\
%{_datadir}/%{name}/ProcessorPool.mof \\\
%{_datadir}/%{name}/DiskPool.mof \\\
%{_datadir}/%{name}/HostedResourcePool.mof \\\
%{_datadir}/%{name}/RegisteredProfile.mof \\\
%{_datadir}/%{name}/ElementConformsToProfile.mof \\\
%{_datadir}/%{name}/ComputerSystemIndication.mof \\\
%{_datadir}/%{name}/ResourceAllocationSettingDataIndication.mof \\\
%{_datadir}/%{name}/SwitchService.mof \\\
%{_datadir}/%{name}/ComputerSystemMigrationIndication.mof \\\
%{_datadir}/%{name}/Virt_ResourceAllocationSettingData.mof \\\
%{_datadir}/%{name}/ResourceAllocationSettingData.mof \\\
%{_datadir}/%{name}/ResourcePoolConfigurationService.mof \\\
%{_datadir}/%{name}/ResourcePoolConfigurationCapabilities.mof \\\
%{_datadir}/%{name}/VSSDComponent.mof \\\
%{_datadir}/%{name}/SettingsDefineState.mof \\\
%{_datadir}/%{name}/NetPool.mof \\\
%{_datadir}/%{name}/ResourceAllocationFromPool.mof \\\
%{_datadir}/%{name}/ElementAllocatedFromPool.mof \\\
%{_datadir}/%{name}/HostedService.mof \\\
%{_datadir}/%{name}/ElementSettingData.mof \\\
%{_datadir}/%{name}/VSMigrationCapabilities.mof \\\
%{_datadir}/%{name}/VSMigrationService.mof \\\
%{_datadir}/%{name}/VSMigrationSettingData.mof \\\
%{_datadir}/%{name}/VirtualSystemSnapshotService.mof \\\
%{_datadir}/%{name}/VirtualSystemSnapshotServiceCapabilities.mof \\\
%{_datadir}/%{name}/ConcreteComponent.mof \\\
%{_datadir}/%{name}/ConsoleRedirectionService.mof \\\
%{_datadir}/%{name}/ConsoleRedirectionServiceCapabilities.mof \\\
%{_datadir}/%{name}/ServiceAffectsElement.mof \\\
%{_datadir}/%{name}/KVMRedirectionSAP.mof \\\
%{_datadir}/%{name}/DisplayController.mof \\\
%{_datadir}/%{name}/Controller.mof \\\
%{_datadir}/%{name}/PointingDevice.mof \\\
%{_datadir}/%{name}/GraphicsPool.mof \\\
%{_datadir}/%{name}/InputPool.mof \\\
%{_datadir}/%{name}/ControllerPool.mof \\\
%{_datadir}/%{name}/HostedAccessPoint.mof \\\
%{_datadir}/%{name}/ServiceAccessBySAP.mof \\\
%{_datadir}/%{name}/SAPAvailableForElement.mof \\\
%{_datadir}/%{name}/FilterEntry.mof \\\
%{_datadir}/%{name}/FilterList.mof \\\
%{_datadir}/%{name}/EntriesInFilterList.mof \\\
%{_datadir}/%{name}/NestedFilterList.mof \\\
%{_datadir}/%{name}/AppliedFilterList.mof \\\
%{_datadir}/%{name}/HostedFilterList.mof
%define INTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\
%{_datadir}/%{name}/ElementConformsToProfile.registration \\\
%{_datadir}/%{name}/ReferencedProfile.registration
%define INTEROP_MOF %{_datadir}/%{name}/ComputerSystem.mof \\\
%{_datadir}/%{name}/HostSystem.mof \\\
%{_datadir}/%{name}/RegisteredProfile.mof \\\
%{_datadir}/%{name}/DiskPool.mof \\\
%{_datadir}/%{name}/MemoryPool.mof \\\
%{_datadir}/%{name}/NetPool.mof \\\
%{_datadir}/%{name}/ProcessorPool.mof \\\
%{_datadir}/%{name}/VSMigrationService.mof \\\
%{_datadir}/%{name}/ElementConformsToProfile.mof \\\
%{_datadir}/%{name}/ReferencedProfile.mof \\\
%{_datadir}/%{name}/AllocationCapabilities.mof
# NOTE: As of Pegasus 2.12.1-5, using root/PG_InterOp will no longer be
# valid. All mofs can just compile into root/interop. However, we
# need to keep these here for 'historical purposes'.
#
%define PGINTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\
%{_datadir}/%{name}/ElementConformsToProfile.registration \\\
%{_datadir}/%{name}/ReferencedProfile.registration
%define PGINTEROP_MOF %{_datadir}/%{name}/RegisteredProfile.mof \\\
%{_datadir}/%{name}/ElementConformsToProfile.mof \\\
%{_datadir}/%{name}/ReferencedProfile.mof
%define CIMV2_REG %{_datadir}/%{name}/HostedResourcePool.registration \\\
%{_datadir}/%{name}/ElementCapabilities.registration \\\
%{_datadir}/%{name}/HostedService.registration \\\
%{_datadir}/%{name}/HostedDependency.registration \\\
%{_datadir}/%{name}/ElementConformsToProfile.registration \\\
%{_datadir}/%{name}/HostedAccessPoint.registration
%define CIMV2_MOF %{_datadir}/%{name}/HostedResourcePool.mof \\\
%{_datadir}/%{name}/ElementCapabilities.mof \\\
%{_datadir}/%{name}/HostedService.mof \\\
%{_datadir}/%{name}/HostedDependency.mof \\\
%{_datadir}/%{name}/RegisteredProfile.mof \\\
%{_datadir}/%{name}/ComputerSystem.mof \\\
%{_datadir}/%{name}/ElementConformsToProfile.mof \\\
%{_datadir}/%{name}/HostedAccessPoint.mof
%pre
# _If_ there is already a version of this installed, we must deregister
# the classes we plan to install in post, otherwise we may corrupt
# the pegasus repository. This is convention in other provider packages
if [ $1 -gt 1 ]
then
if [ -x /usr/sbin/cimserver ]
then
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n @CIM_VIRT_NS@ \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/PG_InterOp \
-r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/cimv2\
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
fi
# Remove open-pegasus-specific providers installed in sfcb repository
# by older libvirt-cim packages
if [ -x /usr/sbin/sfcbd ]
then
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
-n root/PG_InterOp \
-r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true
fi
fi
%post
/sbin/ldconfig
if [ $1 -eq 1 ]
then
# Install the CIM base schema if this is the initial install
%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name}
fi
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
if [ "`systemctl is-active tog-pegasus.service 2> /dev/null`" = "active" ]
then
systemctl restart tog-pegasus.service > /dev/null 2>&1
fi
if [ "`systemctl is-active sblim-sfcb.service 2> /dev/null`" = "active" ]
then
systemctl restart sblim-sfcb.service > /dev/null 2>&1
fi
%else
/etc/init.d/tog-pegasus condrestart
%endif
if [ -x /usr/sbin/cimserver ]
then
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n @CIM_VIRT_NS@ \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
#
# We need to check the version - if we're not yet at 2.12.1, then
# we'll register at root/PG_InterOp; otherwise, using just the above
# registration should be sufficient. The actual cutoff root/PG_InterOp
# not being valid was 2.12.1-5; however, --version doesn't give us that
# level of detail. The Pegasus docs imply that usage of root/interop was
# valid as of 2.12.0.
#
CIMVER=`/usr/sbin/cimserver --version | \
awk -F. '{printf("%02d%02d%02d\n", $1,$2,$3); }'`
if [ $CIMVER -lt 021201 ]
then
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/PG_InterOp \
-r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true
fi
%{_datadir}/%{name}/provider-register.sh -t pegasus \
-n root/cimv2\
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
fi
if [ -x /usr/sbin/sfcbd ]
then
%{_datadir}/%{name}/provider-register.sh -t sfcb \
-n root/virt \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -t sfcb \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -t sfcb \
-n root/cimv2\
-r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true
fi
%preun
# The uninstall scriptlets are called after the install scriptlets
# in the upgrade case. Therefore we must only deregister the providers
# when $1 == 0 (final remove).
if [ $1 -eq 0 ]
then
if [ -x /usr/sbin/cimserver ]
then
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/virt \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/PG_InterOp \
-r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t pegasus \
-n root/cimv2 \
-r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
fi
if [ -x /usr/sbin/sfcbd ]
then
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
-n root/virt \
-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
-n root/interop \
-r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true
%{_datadir}/%{name}/provider-register.sh -d -t sfcb \
-n root/cimv2 \
-r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true
fi
fi
%postun -p /sbin/ldconfig
%files
%defattr(-, root, root)
%{_sysconfdir}/libvirt/cim
%doc README COPYING doc/CodingStyle doc/SubmittingPatches libvirt-cim-docs/*
%doc base_schema/README.DMTF
%{_libdir}/lib*.so*
%{_libdir}/cmpi/lib*.so*
%{_datadir}/libvirt-cim
%{_datadir}/libvirt-cim/*.sh
%{_datadir}/libvirt-cim/*.mof
%{_datadir}/libvirt-cim/cimv*-interop_mof
%{_datadir}/libvirt-cim/cimv*-cimv2_mof
%{_datadir}/libvirt-cim/*.registration
%{_datadir}/libvirt-cim/cim_schema_*-MOFs.zip
%{_sysconfdir}/ld.so.conf.d/libvirt-cim.%{_arch}.conf
%config(noreplace) %{_sysconfdir}/libvirt-cim.conf
%changelog
* Wed Oct 28 2009 Richard Maciel <[email protected]> - 0.1-1
- Added profile classes to the PG_InterOp namespace
* Fri Oct 26 2007 Daniel Veillard <[email protected]> - 0.1-1
- created