forked from open-hpi/openhpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openhpi.spec.in
494 lines (428 loc) · 12.7 KB
/
openhpi.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
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
%define _topdir @abs_top_srcdir@
%define _tmpdir /tmp
%define _rpmtopdir %{_topdir}/rpm
%define _builddir %{_rpmtopdir}/BUILD
%define _rpmdir %{_rpmtopdir}/RPMS
%define _sourcedir %{_topdir}
%define _specdir %{_topdir}
%define _srcrpmdir %{_rpmtopdir}/SRPMS
%define _docdir %{_datadir}/doc/%{name}
%if %{undefined suse_version}
# For systems where libuuid is provided in e2fsprogs rpm
%define uuid_provider e2fsprogs
%define uuid libuuid
%endif
%if %{defined suse_version}
# For systems where libuuid is provided in libuuid rpm
%define uuid_provider libuuid
%endif
%define with_openssl @WITH_OPENSSL@
%define with_ipmi @WITH_IPMI@
%if "x@IPMIDIRECT@" == "xipmidirect"
%define with_ipmidirect 1
%endif
%define with_bladecenter @WITH_SNMP_BC@
%if "x@SIMULATOR@" == "xsimulator"
%define with_simulator 1
%endif
%if "x@DYNAMIC_SIMULATOR@" == "xdynamic_simulator"
%define with_dynamic_simulator 1
%endif
%define with_rtas @WITH_RTAS@
%define with_sysfs @WITH_SYSFS@
%if "x@WATCHDOG@" == "xwatchdog"
%define with_watchdog 1
%endif
%define with_ilo2_ribcl @WITH_ILO2_RIBCL@
%define with_oa_soap @WITH_OA_SOAP@
%define with_ov_rest @WITH_OV_REST@
%if "x@SLAVE@" == "xslave"
%define with_slave 1
%endif
%if "x@TEST_AGENT@" == "xtest_agent"
%define with_test_agent 1
%endif
%if "x@HPICRYPT@" == "xhpicrypt"
%define with_gcrypt 1
%endif
Name: @HPI_PKG@
Version: @VERSION@
Release: 1
#
Summary: Open implementation of the SAF Hardware Platform Interface
#
License: BSD
Group: System/Monitoring
#
Vendor: OpenHPI Project
Packager: renier@openhpi.org
#
URL: http://www.openhpi.org
Source: http://prdownloads.sourceforge.net/openhpi/%{name}-%{version}.tar.gz
#
Buildroot: %{_rpmtopdir}/INSTALL
BuildRequires: pkgconfig automake autoconf libtool gcc-c++ glib2-devel libstdc++-devel
%if 0%{?with_openssl}
BuildRequires: openssl-devel
%endif
%if 0%{?with_gcrypt}
BuildRequires: libgcrypt-devel
%endif
#Requires: glib2 libstdc++
%if 0%{?with_openssl}
Requires: openssl
%endif
%if 0%{?with_gcrypt}
%if 0%{?suse_version}
Requires: libgcrypt20
%else
Requires: libgcrypt
%endif
%endif
%if %{undefined suse_version}
Requires: glib2 libstdc++
%endif
%if 0%{?suse_version} <= 1100
Requires: glib2 libstdc++
%define uuid libuuid
%endif
%if 0%{?suse_version} >= 1100 && 0%{?suse_version} <= 1140
Requires: glib2 libstdc++43
%define uuid libuuid1
%endif
%if 0%{?suse_version} >= 1200
Requires: glib2 libstdc++6
%define uuid libuuid1
%endif
%package devel
Summary: OpenHPI and SAF header files
Group: System/Monitoring
Requires: openhpi = %{version}
%package clients
Summary: OpenHPI command-line utilities
Group: System/Monitoring
%if 0%{?suse_version}
BuildRequires: popt-devel
%endif
Requires: openhpi = %{version} popt
%if 0%{?with_ipmi}
%package ipmi
Summary: OpenHPI plugin for OpenIPMI (deprecated)
Group: System/Monitoring
BuildRequires: OpenIPMI-devel
Requires: openhpi = %{version} OpenIPMI
%endif
%if 0%{?with_ipmidirect}
%package ipmidirect
Summary: OpenHPI plugin for IPMI-enabled systems
Group: System/Monitoring
Requires: openhpi = %{version}
%endif
%if 0%{?with_rtas}
%package rtas
Summary: OpenHPI plugin for IBM PPC systems
Group: System/Monitoring
BuildRequires: librtas-devel
Requires: openhpi = %{version} librtas
%endif
%if 0%{?with_simulator}
%package simulator
Summary: OpenHPI plugin for testing the core library
Group: System/Monitoring
Requires: openhpi = %{version}
%endif
%if 0%{?with_dynamic_simulator}
%package dynamic_simulator
Summary: OpenHPI plugin for testing the core library
Group: System/Monitoring
Requires: openhpi = %{version}
%endif
%if 0%{?with_bladecenter}
%package bladecenter
Summary: OpenHPI plugin for the IBM Blade Center
Group: System/Monitoring
BuildRequires: net-snmp-devel %{uuid_provider}-devel
Requires: openhpi = %{version} net-snmp > 5.0 %{uuid}
%endif
%if 0%{?with_sysfs}
%package sysfs
Summary: OpenHPI plugin for sysfs
Group: System/Monitoring
Requires: openhpi = %{version} libsysfs
%endif
%if 0%{?with_watchdog}
%package watchdog
Group: System/Monitoring
Summary: OpenHPI plugin for Linux software watchdog support
Requires: openhpi = %{version}
%endif
%if 0%{?with_ilo2_ribcl}
%package ilo2_ribcl
Summary: OpenHPI plugin for HP ProLiant Rack Mount Servers
Group: System/Monitoring
BuildRequires: libxml2-devel
Requires: openhpi = %{version} libxml2 openssl
%endif
%if 0%{?with_oa_soap}
%package oa_soap
Summary: OpenHPI plugin for HP BladeSystem c-Class
Group: System/Monitoring
BuildRequires: libxml2-devel
Requires: openhpi = %{version} libxml2 openssl
%endif
%if 0%{?with_ov_rest}
%package ov_rest
Summary: OpenHPI plugin for HP One View
Group: System/Monitoring
%if 0%{?suse_version}
BuildRequires: libcurl-devel libjson-c-devel
%else
BuildRequires: libcurl-devel json-c-devel librabbitmq-devel
%endif
%if 0%{?suse_version}
Requires: openhpi = %{version} libjson-c2 libcurl-devel
%else
Requires: openhpi = %{version} json-c libcurl-devel librabbitmq-devel
%endif
%endif
%if 0%{?with_slave}
%package slave
Summary: OpenHPI plugin for a slave OpenHPI daemon
Group: System/Monitoring
Requires: openhpi = %{version}
%endif
%if 0%{?with_test_agent}
%package test_agent
Summary: OpenHPI plugin for simulation with runtime configuration changes support
Group: System/Monitoring
Requires: openhpi = %{version}
%endif
%description
An open implementation of the Service Availability Forum (SAF)
Hardware Platform Interface (HPI). It includes support for multiple types of
hardware including: IPMI, IBM Blade Center (via SNMP), Linux Watchdog devices,
and Sysfs based systems.
%description devel
Contains header and other include files needed by developers
to build application that use the OpenHPI library.
%description clients
These command-line applications serve as HPI utilities that you can use
for looking at: sensor readings, vpd data, power machines on/off, etc.
They lso serve as examples to developers of HPI API usage.
%if 0%{?with_ipmi}
%description ipmi
This OpenHPI plugin uses OpenIPMI to connect to IPMI-enabled hardware
locally or over the network. Its focus is wide, created to support
any generic hardware topology that uses IPMI. This plugin is not maintained
any more; it is recommended to use ipmidirect plugin instead.
%endif
%if 0%{?with_ipmidirect}
%description ipmidirect
This OpenHPI plugin connects directly to IPMI-enabled hardware
locally or over the network. Its focus is to support ATCA-type chassis.
%endif
%if 0%{?with_rtas}
%description rtas
Run-Time Abstraction Services (RTAS) plug-in
%endif
%if 0%{?with_simulator}
%description simulator
OpenHPI plugin that reports fakes hardware used for
testing the core library.
%endif
%if 0%{?with_dynamic_simulator}
%description dynamic_simulator
OpenHPI plugin that reports fakes hardware defined in the file
simulation.data used for testing the core library.
%endif
%if 0%{?with_bladecenter}
%description bladecenter
OpenHPI plugin supporting the IBM BladeCenter. It also supports
RSA-enabled IBM systems, in addition to all types of BladeCenters.
This plugin uses snmp to connect to and gather information from all systems.
%endif
%if 0%{?with_sysfs}
%description sysfs
OpenHPI plugin that reads system information from sysfs.
%endif
%if 0%{?with_watchdog}
%description watchdog
OpenHPI plugin that uses the Linux software watchdog support
provided by the kernel.
%endif
%if 0%{?with_ilo2_ribcl}
%description ilo2_ribcl
OpenHPI plugin supporting HP ProLiant Rack Mount Servers. This plug-in connects
to iLO2 on HP ProLiant Rack Mount Server using a SSL connection and exchanges
information via Remote Insight Board Command Language (RIBCL).
%endif
%if 0%{?with_oa_soap}
%description oa_soap
OpenHPI plug-in supporting HP BladeSystems c-Class. This plug-in connects
to the OA of a c-Class chassis using an SSL connection and manages the system
using an XML-encoded SOAP interface.
%endif
%if 0%{?with_ov_rest}
%description ov_rest
OpenHPI plug-in supporting HP One View. This plug-in connects
to OneView using curl and processing the output using json-c
%endif
%if 0%{?with_slave}
%description slave
OpenHPI plug-in that allows to aggregate resources from different domains
(slave domains) and to provide aggregated resources as part of the one domain
(master domain).
%endif
%if 0%{?with_test_agent}
%description test_agent
OpenHPI plugin that reports fakes hardware and allows runtime configuration changes.
%endif
###################################################
%prep
###################################################
%setup
###################################################
%build
###################################################
%configure @ac_configure_args@ --prefix=/usr --with-varpath=/var/lib/%{name}
find . -type f -name "Makefile" | xargs -n1 sed -i -e 's/ -Wp,-D_FORTIFY_SOURCE=2//g;'
%{__make}
###################################################
%install
###################################################
make DESTDIR=%{buildroot} install
%{__install} -Dd -m 0755 %{buildroot}%{_sysconfdir}/%{name} %{buildroot}/var/lib/%{name}
%{__install} -m 0600 %{name}.conf.example %{buildroot}%{_sysconfdir}/%{name}/%{name}.conf
%post
###################################################
%files
###################################################
%defattr(-,root,root)
%{_docdir}/README*
%{_docdir}/COPYING
%{_docdir}/ChangeLog
%dir %{_sysconfdir}/%{name}/
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/%{name}/%{name}.conf
%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/%{name}/simulation.data
%dir %{_libdir}/%{name}
%dir /var/lib/%{name}
%{_libdir}/libopenhpi*.so.*
%{_mandir}/man7/%{name}.7*
%{_mandir}/man8/%{name}d.8*
%{_sbindir}/openhpid
%if "x@enable_systemd@" == "xyes"
/@unitdir@/openhpid.service
%else
%{_sysconfdir}/init.d/openhpid
%endif
###################################################
%files devel
###################################################
%defattr(-,root,root)
%{_includedir}/%{name}
%{_libdir}/pkgconfig/openhpi.pc
%{_libdir}/pkgconfig/openhpiutils.pc
%{_libdir}/libopenhpi*.so
%{_libdir}/libopenhpi*.la
%{_libdir}/*.a
###################################################
%files clients
###################################################
%defattr(-,root,root)
%{_bindir}/hpi*
%{_bindir}/ohhandler
%{_bindir}/ohparam
%{_bindir}/ohdomainlist
%{_mandir}/man1/*.1*
%{_sysconfdir}/openhpi/openhpiclient.conf
###################################################
%if 0%{?with_ipmi}
%files ipmi
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libipmi.*
%endif
###################################################
%if 0%{?with_ipmidirect}
%files ipmidirect
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libipmidirect.*
%endif
###################################################
%if 0%{?with_rtas}
%files rtas
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/librtas2hpi.*
%endif
###################################################
%if 0%{?with_simulator}
%files simulator
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libsimulator.*
%endif
###################################################
%if 0%{?with_dynamic_simulator}
%files dynamic_simulator
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libdyn_simulator.*
%endif
###################################################
%if 0%{?with_bladecenter}
%files bladecenter
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libsnmp_bc.*
%endif
###################################################
%if 0%{?with_sysfs}
%files sysfs
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libsysfs2hpi.*
%endif
###################################################
%if 0%{?with_watchdog}
%files watchdog
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libwatchdog.*
%endif
###################################################
%if 0%{?with_ilo2_ribcl}
%files ilo2_ribcl
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libilo2_ribcl.*
%endif
###################################################
%if 0%{?with_oa_soap}
%files oa_soap
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/liboa_soap.*
%endif
###################################################
%if 0%{?with_ov_rest}
%files ov_rest
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libov_rest.*
%endif
###################################################
%if 0%{?with_slave}
%files slave
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libslave.*
%endif
###################################################
%if 0%{?with_test_agent}
%files test_agent
###################################################
%defattr(-,root,root)
%{_libdir}/%{name}/libtest_agent.*
%endif