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
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
|
Name: openlmi-providers
Version: 0.0.22
Release: 1%{?dist}
Summary: Set of basic CIM providers
License: LGPLv2+
URL: http://fedorahosted.org/openlmi/
Source0: http://fedorahosted.org/released/openlmi-providers/%{name}-%{version}.tar.gz
# Upstream name has been changed from cura-providers to openlmi-providers
Provides: cura-providers%{?_isa} = %{version}-%{release}
Obsoletes: cura-providers < 0.0.10-1
BuildRequires: cmake
BuildRequires: konkretcmpi-devel >= 0.9.0-2
BuildRequires: sblim-cmpi-devel
BuildRequires: cim-schema
# For openlmi-power
BuildRequires: upower-devel
# For openlmi-fan
BuildRequires: lm_sensors-devel
# For openlmi-account
BuildRequires: libuser-devel
BuildRequires: python2-devel
# For openlmi-hardware
BuildRequires: pciutils-devel
# For openlmi-register-pegasus script
Requires: python2
# sblim-sfcb or tog-pegasus
# (required to be present during install/uninstall for registration)
Requires: cim-server
Requires(pre): cim-server
Requires(preun): cim-server
Requires(post): cim-server
# XXX
# Just because we have wired python's scripts
# Remove in future
BuildRequires: python-setuptools
%description
%{name} is set of (usually) small CMPI providers (agents) for basic
monitoring and management of host system using Common Information
Model (CIM).
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: cura-providers-devel%{?_isa} = %{version}-%{release}
Obsoletes: cura-providers-devel < 0.0.10-1
%description devel
%{summary}.
%package -n openlmi-fan
Summary: CIM provider for controlling fans
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: cura-fan%{?_isa} = %{version}-%{release}
Obsoletes: cura-fan < 0.0.10-1
%description -n openlmi-fan
%{summary}.
%package -n openlmi-powermanagement
Summary: Power management CIM provider
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: upower
# For Linux_ComputerSystem
Requires: sblim-cmpi-base
Provides: cura-powermanagement%{?_isa} = %{version}-%{release}
Obsoletes: cura-powermanagement < 0.0.10-1
%description -n openlmi-powermanagement
%{summary}.
%package -n openlmi-service
Summary: CIM provider for controlling system services
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: cura-service%{?_isa} = %{version}-%{release}
Obsoletes: cura-service < 0.0.10-1
%description -n openlmi-service
%{summary}.
%package -n openlmi-account
Summary: CIM provider for managing accounts on system
Requires: %{name}%{?_isa} = %{version}-%{release}
# For Linux_ComputerSystem
Requires: sblim-cmpi-base
Provides: cura-account%{?_isa} = %{version}-%{release}
Obsoletes: cura-account < 0.0.10-1
%description -n openlmi-account
%{summary}.
%package -n openlmi-hardware
Summary: CIM provider for hardware on system
Requires: %{name}%{?_isa} = %{version}-%{release}
# For Linux_ComputerSystem
Requires: sblim-cmpi-base
%description -n openlmi-hardware
%{summary}.
%package -n openlmi-python
Summary: Python namespace package for pywbem providers
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
Requires: python-setuptools
Requires: cmpi-bindings-pywbem
%description -n openlmi-python
The openlmi-python package contains python namespace package for
all openlmi python providers using cmpi-bindings-pywbem.
%package -n openlmi-software
Summary: CIM providers for software management
Requires: %{name} = %{version}-%{release}
Requires: openlmi-python = %{version}-%{release}
Provides: cura-software = %{version}-%{release}
Obsoletes: cura-software < 0.0.10-1
BuildArch: noarch
Requires: yum
# For Linux_ComputerSystem
Requires: sblim-cmpi-base
%description -n openlmi-software
The openlmi-software package contains CMPI providers for management of software
through yum package manager with Common Information Managemen (CIM) protocol.
The providers can be registered in any CMPI-aware CIMOM, both OpenPegasus and
SFCB were tested.
%package -n openlmi-logicalfile
Summary: CIM provider for reading files and directories
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: sblim-cmpi-base
%description -n openlmi-logicalfile
%{summary}.
%package -n openlmi-realmd
Summary: CIM provider for Realmd
Requires: %{name}%{?_isa} = %{version}-%{release}
# For Linux_ComputerSystem
Requires: sblim-cmpi-base
%description -n openlmi-realmd
The openlmi-realmd package contains CMPI providers for Realmd, which is an on
demand system DBus service, which allows callers to configure network
authentication and domain membership in a standard way.
%prep
%setup -q
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%{cmake} ..
popd
make %{?_smp_mflags} -C %{_target_platform}
pushd src/python
%{__python} setup.py build
popd # src/python
# for software providers
pushd src/software
%{__python} setup.py build
popd # src/software
%install
make install/fast DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
# XXX
# Remove pythonies
# Don't forget to remove this dirty hack in the future
rm -rf "$RPM_BUILD_ROOT"/usr/bin/*.py
rm -rf "$RPM_BUILD_ROOT"/usr/lib/python*
pushd src/python
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd # src/python
# for software providers
pushd src/software
%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
popd # src/software
cp mof/LMI_Software.reg $RPM_BUILD_ROOT/%{_datadir}/%{name}/
%files
%doc README COPYING
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/05_LMI_Qualifiers.mof
%{_datadir}/%{name}/30_LMI_Jobs.mof
%{_libdir}/libopenlmicommon.so.*
%attr(755, root, root) %{_bindir}/openlmi-mof-register
%attr(755, root, root) %{_libexecdir}/openlmi-register-pegasus
%attr(755, root, root) %{_libexecdir}/openlmi-cimmof
%files devel
%{_bindir}/openlmi-doc-class2rst
%{_bindir}/openlmi-doc-class2uml
%{_libdir}/libopenlmicommon.so
%{_libdir}/pkgconfig/openlmi.pc
%{_includedir}/openlmi/openlmi.h
%{_datadir}/cmake/Modules/OpenLMIMacros.cmake
%{_datadir}/cmake/Modules/FindOpenLMI.cmake
%{_datadir}/cmake/Modules/FindCMPI.cmake
%{_datadir}/cmake/Modules/FindKonkretCMPI.cmake
%files -n openlmi-fan
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_Fan.so
%{_datadir}/%{name}/60_LMI_Fan.mof
%{_datadir}/%{name}/60_LMI_Fan.reg
%files -n openlmi-powermanagement
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_PowerManagement.so
%{_datadir}/%{name}/60_LMI_PowerManagement.mof
%{_datadir}/%{name}/60_LMI_PowerManagement.reg
%files -n openlmi-service
%doc README COPYING
%attr(755, root, root) %{_libexecdir}/servicedisc.sh
%attr(755, root, root) %{_libexecdir}/serviceutil.sh
%{_libdir}/cmpi/libcmpiLMI_Service.so
%{_datadir}/%{name}/60_LMI_Service.mof
%{_datadir}/%{name}/60_LMI_Service.reg
%files -n openlmi-account
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_Account.so
%{_datadir}/%{name}/60_LMI_Account.mof
%{_datadir}/%{name}/60_LMI_Account.reg
%attr(755, root, root) %{_libexecdir}/pegasus/cmpiLMI_Account-cimprovagt
%files -n openlmi-hardware
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_Hardware.so
%{_datadir}/%{name}/60_LMI_Hardware.mof
%{_datadir}/%{name}/60_LMI_Hardware.reg
%files -n openlmi-python
%doc README COPYING
%dir %{python_sitelib}/openlmi
%{python_sitelib}/openlmi-*
%dir %{python_sitelib}/openlmi/common
%{python_sitelib}/openlmi/common/*.py
%{python_sitelib}/openlmi/common/*.py[co]
%files -n openlmi-software
%doc README COPYING
%dir %{python_sitelib}/openlmi/software
%{python_sitelib}/openlmi/software/*
%{python_sitelib}/openlmi_software-*
%{_datadir}/%{name}/60_LMI_Software.mof
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof
%{_datadir}/%{name}/LMI_Software.reg
%files -n openlmi-logicalfile
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_LogicalFile.so
%{_datadir}/%{name}/60_LMI_LogicalFile.mof
%{_datadir}/%{name}/60_LMI_LogicalFile.reg
%files -n openlmi-realmd
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_Realmd.so
%{_datadir}/%{name}/60_LMI_Realmd.mof
%{_datadir}/%{name}/60_LMI_Realmd.reg
%pre
# If upgrading, deregister old version
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register --just-mofs unregister \
%{_datadir}/%{name}/30_LMI_Jobs.mof \
> /dev/null 2>&1 || :;
fi
%post
/sbin/ldconfig
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register --just-mofs register \
%{_datadir}/%{name}/30_LMI_Jobs.mof \
> /dev/null 2>&1 || :;
fi
%preun
# Deregister only if not upgrading
if [ "$1" -eq 0 ]; then
%{_bindir}/openlmi-mof-register --just-mofs unregister \
%{_datadir}/%{name}/30_LMI_Jobs.mof \
> /dev/null 2>&1 || :;
fi
%postun -p /sbin/ldconfig
%pre -n openlmi-fan
# If upgrading, deregister old version
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Fan.mof \
%{_datadir}/%{name}/60_LMI_Fan.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-powermanagement
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_PowerManagement.mof \
%{_datadir}/%{name}/60_LMI_PowerManagement.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-service
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Service.mof \
%{_datadir}/%{name}/60_LMI_Service.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-account
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Account.mof \
%{_datadir}/%{name}/60_LMI_Account.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-software
if [ "$1" -gt 1 ]; then
# delete indication filters from sfcbd
%{_bindir}/openlmi-mof-register --just-mofs -n root/interop \
-c sfcbd unregister \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
# delete indication filters from tog-pegasus
%{_bindir}/openlmi-mof-register --just-mofs -n root/PG_InterOp \
-c tog-pegasus unregister \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Software.mof \
%{_datadir}/%{name}/LMI_Software.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-logicalfile
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_LogicalFile.mof \
%{_datadir}/%{name}/60_LMI_LogicalFile.reg \
> /dev/null 2>&1 || :;
fi
%pre -n openlmi-realmd
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Realmd.mof \
%{_datadir}/%{name}/60_LMI_Realmd.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-fan
# Register Schema and Provider
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_Fan.mof \
%{_datadir}/%{name}/60_LMI_Fan.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-powermanagement
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_PowerManagement.mof \
%{_datadir}/%{name}/60_LMI_PowerManagement.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-service
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_Service.mof \
%{_datadir}/%{name}/60_LMI_Service.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-account
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_Account.mof \
%{_datadir}/%{name}/60_LMI_Account.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-software
if [ "$1" -ge 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_Software.mof \
%{_datadir}/%{name}/LMI_Software.reg \
> /dev/null 2>&1 || :;
# install indication filters for sfcbd
%{_bindir}/openlmi-mof-register --just-mofs -n root/interop \
-c sfcbd register \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
# install indication filters for tog-pegasus
%{_bindir}/openlmi-mof-register --just-mofs -n root/PG_InterOp \
-c tog-pegasus register \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-logicalfile
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_LogicalFile.mof \
%{_datadir}/%{name}/60_LMI_LogicalFile.reg \
> /dev/null 2>&1 || :;
fi
%post -n openlmi-realmd
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register register \
%{_datadir}/%{name}/60_LMI_Realmd.mof \
%{_datadir}/%{name}/60_LMI_Realmd.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-fan
# Deregister only if not upgrading
if [ "$1" -eq 0 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Fan.mof \
%{_datadir}/%{name}/60_LMI_Fan.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-powermanagement
if [ "$1" -eq 0 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_PowerManagement.mof \
%{_datadir}/%{name}/60_LMI_PowerManagement.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-service
if [ "$1" -eq 0 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Service.mof \
%{_datadir}/%{name}/60_LMI_Service.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-account
if [ "$1" -eq 0 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Account.mof \
%{_datadir}/%{name}/60_LMI_Account.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-software
if [ "$1" -eq 0 ]; then
# delete indication filters from sfcbd
%{_bindir}/openlmi-mof-register --just-mofs -n root/interop \
-c sfcbd unregister \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
# delete indication filters from tog-pegasus
%{_bindir}/openlmi-mof-register --just-mofs -n root/PG_InterOp \
-c tog-pegasus unregister \
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof \
> /dev/null 2>&1 || :;
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Software.mof \
%{_datadir}/%{name}/LMI_Software.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-logicalfile
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_LogicalFile.mof \
%{_datadir}/%{name}/60_LMI_LogicalFile.reg \
> /dev/null 2>&1 || :;
fi
%preun -n openlmi-realmd
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
%{_datadir}/%{name}/60_LMI_Realmd.mof \
%{_datadir}/%{name}/60_LMI_Realmd.reg \
> /dev/null 2>&1 || :;
fi
%changelog
* Fri May 10 2013 Jan Safranek <jsafrane@redhat.com> 0.0.22-1
- Create the spec file.
|