-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexanodes.spec.in
781 lines (680 loc) · 21.8 KB
/
exanodes.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
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
#
# Copyright 2002, 2012 Seanodes Ltd http://www.seanodes.com. All rights
# reserved and protected by French, UK, U.S. and other countries' copyright laws.
# This file is part of Exanodes project and is subject to the terms
# and conditions defined in the LICENSE file which is present in the root
# directory of the project.
#
# Backport RPM4.4 conditional build stuff on old distros (CentOS4).
%if %{?with:0}%{!?with:1}
%define with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
%define without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
%define bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
%define bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
%endif
# Define (or not) with_xxx macros depending on the default value and the
# --with xxx and --without xxx options passed to rpmbuild.
# @Option: Compile cluster side (nodes) (default=yes)
%bcond_without nodes
# @Option: Compile the monitoring daemon (default=no)
%bcond_with monitoring
# @Option: Compile CLI (default=yes)
%bcond_without cli
# @Option: With test (default=yes)
%bcond_without test
# @Option: With tools (default=yes)
%bcond_without tools
# @Option: Set the FORTIFY_SOURCE=2 macro to add extra checks (default=yes)
%bcond_without fortify
# @Option: Stop compiling on warnings (default=yes)
%bcond_without werror
# @Option: Use dkms to compile kernel modules (default=yes)
%bcond_without dkms
# @Option: Compile SElinux policy (default=yes)
%bcond_without selinux
# @Option: Build and run unit tests (default=no)
%bcond_with ut
# @Option: Build and run unit tests that requires to be root (default=no)
%bcond_with ut_root
# @Option: Disable Linux block device (default=no)
%bcond_without bdev
# @Option: Enable performance instrumentation (default=no)
%bcond_with perf
# @Option: Compile exanodes with the debugging code (default=no)
%bcond_with debug
# @Option: Compile exanodes with the tracing code (default=no)
%bcond_with trace
# @Option: Enable userspace memory allocation checks (default=no)
%bcond_with memtrace
# @Option: Enable kernel space memory allocation checks (default=no)
%bcond_with kmemtrace
# @Option: Don't strip binairies and don't build the debug rpm (default=no)
%bcond_with symbols
# @Option: Enable code coverage analysis (default=no)
%bcond_with coverage
# @Option: Compile documentation - NOT SUPPORTED (default=no)
%bcond_with docs
# @Option: Enable filesystems (default=no)
%bcond_with filesystems
# @Option: Enable token manager (default=no)
%bcond_with tm
# @Option: Enable use of kernel module exa_common (default=yes)
%bcond_without kcommon
# @Option: Enable use of libaio instead of rdev kernel module (default=no)
%bcond_with libaio
# Disable auto-generation of the debug package
%define debug_package %{nil}
%define __os_install_post /usr/lib/rpm/brp-compress
# Detect the distribution
%define rheldistro 0
%define distro_release unknown
%if %(cat /etc/*release | sort -u | grep -E "CentOS release 5|Scientific Linux SL release 5" | wc -l) > 0
%define rheldistro 1
%define distro_release rhel5
%endif
%if %(cat /etc/*release | sort -u | grep -E "CentOS.* release 6" | wc -l) > 0
%define rheldistro 1
%define distro_release rhel6
%endif
%if %(cat /etc/*release | sort -u | grep -E "CentOS.* release 7" | wc -l) > 0
%define rheldistro 1
%define distro_release rhel7
%endif
# Detect the kernel version
%define linuxver %(uname -r)
%define name @CMAKE_PROJECT_NAME@
%define version @EXA_EDITION_TAG@.@EXA_VERSION@.@CURRENT_DATE@
%define release %distro_release
%define tarball_name @EXA_TARBALL_NAME@
Summary: Seanodes Exanodes @EXA_EDITION_STR@
Name: %name
Version: %version
Vendor: Seanodes
Packager: Seanodes
Release: %{release}
License: PROPRIETARY
Group: System
URL: http://www.seanodes.com
Source: %{tarball_name}.tar.gz
BuildRoot: %{_tmppath}/%{tarball_name}-buildroot
BuildRequires: pkgconfig
BuildRequires: cmake >= 2.6
BuildRequires: perl-String-CRC32 >= 1.4
%description
Exanodes virtualizes physical internal storage of cluster nodes
into a shared, performant, flexible and reliable storage space.
%if %with docs
%{error:Docs cannot be part of the RPMs generated by this spec file.}
%endif
%if %without symbols
%package debug
Summary: Debug information for package %{name}
Group: Development/Debug
AutoReqProv: 0
%description debug
This package provides debug information for package %{name}.
Debug information is useful when developing applications that use this
package or when debugging this package.
%endif
%if %with cli
%package cli
Summary: CLI (command line interface) for Exanodes
Group: System
Version: %{version}
BuildRequires: libxml2-devel >= 2.6
Requires: libxml2 >= 2.6
BuildRequires: boost-devel >= 1.33.1
BuildRequires: perl
Requires: %{name}-policy
# Workaround for Mandriva that don't autodetect .pm files that don't begin
# with an uppercase letter.
Provides: perl(constantes)
Provides: perl(exa_adm_protocol)
Provides: perl(exa_constants)
Provides: perl(exa_error)
Provides: perl(exa_names)
%description cli
CLI (command line interface) for Exanodes
%package tools-cli
Summary: Additional CLI commands for Exanodes
Group: System
Version: %{version}
BuildRequires: libxml2-devel >= 2.6
Requires: libxml2 >= 2.6
BuildRequires: boost-devel >= 1.33.1
BuildRequires: perl
Requires: %{name}-cli
%description tools-cli
Additional CLI commands for Exanodes
%package policy-empty
Summary: Empty Exanodes policy
Group: System
Version: %{version}
Provides: %{name}-policy = %{version}-%{release}
%description policy-empty
Empty Exanodes policy
%endif # cli
%if %with nodes
%if %rheldistro
%if %with selinux
%package selinux-policy
Summary: Exanodes policy file for SElinux
Group: System
Version: %{version}
BuildRequires: selinux-policy-devel
Requires: selinux-policy-targeted, selinux-policy, policycoreutils
%description selinux-policy
Exanodes policy file for Security-Enhanced Linux (use on nodes)
%endif #selinux-policy
%endif #rheldistro
%package admind
Summary: Exanodes exa_admind daemon (to use on nodes)
Group: System
Version: %{version}
BuildRequires: libxml2-devel >= 2.6
Requires: libxml2 >= 2.6
BuildRequires: openssl-devel
Requires: openssl
BuildRequires: wget >= 1.0
%description admind
Exanodes exa_admind daemon (to use on nodes)
%package nodes
Summary: Exanodes daemons (to use on nodes)
Group: System
Version: %{version}
Requires: %{name}-kernel = %{version}-%{release}
Requires(pre): %{name}-kernel = %{version}-%{release}
Requires(post): %{name}-kernel = %{version}-%{release}
Requires: %{name}-admind = %{version}-%{release}
Requires(pre): %{name}-admind = %{version}-%{release}
Requires(post): %{name}-admind = %{version}-%{release}
Requires: logrotate
Requires: procps, psmisc
%if %with libaio
BuildRequires: libaio-devel >= 0.3
Requires: libaio >= 0.3
%endif
%description nodes
Exanodes daemons (to use on nodes)
%if %with dkms
%package -n dkms-%{name}
Summary: Sources of Exanodes kernel modules to be build with dkms (to use on nodes)
Group: System
Version: %{version}
Requires: dkms, make, gcc
Requires(post): dkms, make, gcc
Requires(preun):dkms
Provides: %{name}-kernel = %{version}-%{release}
%description -n dkms-%{name}
Sources of Exanodes kernel modules to be build with dkms (to use on nodes)
%else
%package kernel-%{linuxver}
Summary: Exanodes kernel modules (to use on nodes)
Group: System
Version: %{version}
%if %without dkms
BuildRequires: kernel = %{linuxver}
BuildRequires: kernel-devel = %{linuxver}
Requires: kernel = %{linuxver}
%endif
Provides: %{name}-kernel = %{version}-%{release}
%description kernel-%{linuxver}
Exanodes kernel modules (to use on nodes)
%endif
%package test-nodes
Summary: Test utilities commands for Exanodes (to use on nodes)
Group: System
Version: %{version}
Requires: %{name}-nodes = %{version}-%{release}
Requires: bonnie++, blocktools, stress, netperf
%description test-nodes
Test utilities commands for Exanodes (to use on nodes)
%package tools-nodes
Summary: Tools for Exanodes (to use on nodes)
Group: System
Version: %{version}
Requires: %{name}-nodes = %{version}-%{release}
%description tools-nodes
Tools for Exanodes (to use on nodes)
%endif # nodes
%if %with monitoring
%package monitoring
Summary: Exanodes monitoring system
Group: System
Version: %{version}
Requires: %{name}-admind = %{version}-%{release}
Requires(pre): %{name}-admind = %{version}-%{release}
Requires(post): %{name}-admind = %{version}-%{release}
Requires: logrotate
Requires: net-snmp
BuildRequires: net-snmp-devel net-snmp-perl, net-snmp-utils, libsmi, lm_sensors-devel, openssl-devel
%description monitoring
Exanodes monitoring system
%endif # monitoring
%package token-manager
Summary: Token manager for Exanodes
Group: System
Version: %{version}
BuildRequires: libxml2-devel >= 2.6
Requires: libxml2 >= 2.6
BuildRequires: boost-devel >= 1.33.1
BuildRequires: perl
%description token-manager
Token manager for Exanodes, required for two-nodes clusters.
%prep
%setup -q -n %{tarball_name}
%build
echo -- Destination directories: ------
echo prefix: %{_prefix}
echo sbin dir: %{_sbindir}
echo bin dir: %{_bindir}
echo sysconf dir: %{_sysconfdir}
echo cache dir: %{cache_dir}
echo log dir: %{log_dir}
echo pid dir: %{pid_dir}
echo ----------------------------------
mkdir build
cd build
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=1 \
%{?with_symbols:-DCMAKE_BUILD_TYPE=RelWithDebInfo} \
%{?!with_symbols:-DCMAKE_BUILD_TYPE=Release} \
%{?!with_bdev:-DWITH_BDEV=FALSE} \
%{?!with_cli:-DWITH_CLI=FALSE} \
%{?!with_nodes:-DWITH_NODES=FALSE} \
%if %rheldistro
%{?with_selinux:-DWITH_SELINUX=TRUE} \
%endif
%{?with_monitoring:-DWITH_MONITORING=TRUE} \
%{?with_debug:-DCMAKE_BUILD_TYPE=Debug} \
%{?with_trace:-DWITH_TRACE=TRUE} \
%{?with_memtrace:-DWITH_MEMTRACE=TRUE} \
%{?with_kmemtrace:-DWITH_KMEMTRACE=TRUE} \
%{?!with_test:-DWITH_TEST=FALSE} \
%{?with_tools:-DWITH_TOOLS=TRUE} \
%{?!with_dkms:-DWITH_DKMS=FALSE} \
%{?with_filesystems:-DWITH_FS=TRUE} \
%{?with_coverage:-DCMAKE_BUILD_TYPE=Coverage} \
%{?with_docs:-DWITH_DOCS=TRUE} \
%{?with_perf:-DWITH_PERF=TRUE} \
%{?!with_ut:-DWITH_UT=FALSE} \
%{?!with_ut_root:-DWITH_UT_ROOT=FALSE} \
%{?!with_kcommon:-DWITH_EXA_COMMON_KMODULE=FALSE} \
%{?with_libaio:-DWITH_LIBAIO=TRUE} \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DSBIN_DIR=%{_sbindir} \
-DBIN_DIR=%{_bindir} \
-DSYSCONF_DIR=%{_sysconfdir} \
-DCACHE_DIR=%{cache_dir} \
-DDKMS_DIR=%{_usrsrc}/%{tarball_name} \
-DLINUXVER=%{linuxver}
make -j`/usr/bin/getconf _NPROCESSORS_ONLN`
%if %with ut
ctest -V
%endif
%install
rm -rf $RPM_BUILD_ROOT
cd build
make DESTDIR=$RPM_BUILD_ROOT install
%if %without symbols
##########################
#### Managing debug files
##########################
# Mainly inspired by find-debuginfo.sh
# Removing the devel files
debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
for f in `find $RPM_BUILD_ROOT -type f ! -regex "${RPM_BUILD_ROOT}/lib/modules/.*" -exec file {} \; | \
sed -n -e 's/^\(.*\):[ ]*ELF.*, not stripped/\1/p'`
do
dn=$(dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT##p")
bn=$(basename $f .debug).debug
debugdn="${debugdir}${dn}"
debugfn="${debugdn}/${bn}"
mkdir -p "${debugdn}"
objcopy --only-keep-debug "$f" "${debugfn}"
objcopy --strip-debug "$f"
objcopy --add-gnu-debuglink="${debugfn}" "$f"
done
find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > debugfiles.list
%files debug -f build/debugfiles.list
%defattr(-,root,root)
################################
### End of debug file management
################################
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%if %with cli
%files cli
%defattr(-,root,root,-)
%doc tools/exa_batch_init tools/exa_batch_cleanup
%{_bindir}/exa_cli
%{_bindir}/exa_clcreate
%{_bindir}/exa_cldelete
%{_bindir}/exa_cldiskadd
%{_bindir}/exa_cldiskdel
%{_bindir}/exa_clinfo
%if %with monitoring
%{_bindir}/exa_clmonitorstart
%{_bindir}/exa_clmonitorstop
%endif
%{_bindir}/exa_clnodeadd
%{_bindir}/exa_clnodedel
%{_bindir}/exa_clnoderecover
%{_bindir}/exa_clnodestart
%{_bindir}/exa_clnodestop
%{_bindir}/exa_clreconnect
%{_bindir}/exa_clstart
%{_bindir}/exa_clstats
%{_bindir}/exa_clstop
%{_bindir}/exa_cltrace
%{_bindir}/exa_cltune
%{_bindir}/exa_cllicense
%{_bindir}/exa_dgcreate
%{_bindir}/exa_dgdelete
%{_bindir}/exa_dgdiskrecover
%{_bindir}/exa_dgdiskadd
%{_bindir}/exa_dgstart
%{_bindir}/exa_dgstop
%{_bindir}/exa_vlcreate
%{_bindir}/exa_vldelete
%{_bindir}/exa_vlresize
%{_bindir}/exa_vlstart
%{_bindir}/exa_vlstop
%{_bindir}/exa_vltune
%if %with filesystems
%{_bindir}/exa_fscheck
%{_bindir}/exa_fscreate
%{_bindir}/exa_fsdelete
%{_bindir}/exa_fsresize
%{_bindir}/exa_fsstart
%{_bindir}/exa_fsstop
%{_bindir}/exa_fstune
%endif # filesystems
%{_bindir}/exa_expand
%{_bindir}/exa_unexpand
%{_bindir}/exa_install
%{_bindir}/exa_makeconfig
%{_bindir}/exa_gatherinfo
%{_mandir}/man1/exa_clcreate.1.*
%{_mandir}/man1/exa_cldelete.1.*
%{_mandir}/man1/exa_cldiskadd.1.*
%{_mandir}/man1/exa_cldiskdel.1.*
%{_mandir}/man1/exa_clinfo.1.*
%if %with monitoring
%{_mandir}/man1/exa_clmonitorstart.1.*
%{_mandir}/man1/exa_clmonitorstop.1.*
%endif
%{_mandir}/man1/exa_clnodeadd.1.*
%{_mandir}/man1/exa_clnodedel.1.*
%{_mandir}/man1/exa_clnoderecover.1.*
%{_mandir}/man1/exa_clnodestart.1.*
%{_mandir}/man1/exa_clnodestop.1.*
%{_mandir}/man1/exa_clreconnect.1.*
%{_mandir}/man1/exa_clstart.1.*
%{_mandir}/man1/exa_clstats.1.*
%{_mandir}/man1/exa_clstop.1.*
%{_mandir}/man1/exa_cltrace.1.*
%{_mandir}/man1/exa_cltune.1.*
%{_mandir}/man1/exa_cllicense.1.*
%{_mandir}/man1/exa_dgcreate.1.*
%{_mandir}/man1/exa_dgdelete.1.*
%{_mandir}/man1/exa_dgdiskrecover.1.*
%{_mandir}/man1/exa_dgdiskadd.1.*
%{_mandir}/man1/exa_dgstart.1.*
%{_mandir}/man1/exa_dgstop.1.*
%{_mandir}/man1/exa_vlcreate.1.*
%{_mandir}/man1/exa_vldelete.1.*
%{_mandir}/man1/exa_vlresize.1.*
%{_mandir}/man1/exa_vlstart.1.*
%{_mandir}/man1/exa_vlstop.1.*
%{_mandir}/man1/exa_vltune.1.*
%if %with filesystems
%{_mandir}/man1/exa_fscheck.1.*
%{_mandir}/man1/exa_fscreate.1.*
%{_mandir}/man1/exa_fsdelete.1.*
%{_mandir}/man1/exa_fsresize.1.*
%{_mandir}/man1/exa_fsstart.1.*
%{_mandir}/man1/exa_fsstop.1.*
%{_mandir}/man1/exa_fstune.1.*
%endif # filesystems
%{_mandir}/man1/exa_expand.1.*
%{_mandir}/man1/exa_unexpand.1.*
%{_mandir}/man1/exa_install.1.*
%{_mandir}/man1/exa_makeconfig.1.*
%{_mandir}/man1/exa_gatherinfo.1.*
%if %with tools
%files tools-cli
%{_bindir}/exa_clitools
%{_bindir}/exa_dgreset
%{_bindir}/exa_dgcheck
%{_mandir}/man1/exa_dgreset.1.*
%{_mandir}/man1/exa_dgcheck.1.*
%{_datadir}/%{name}/test/constantes.pm
%{_datadir}/%{name}/test/exa_*.pm
%endif # tools
%files policy-empty
%{_datadir}/%{name}/default_tunables.conf
%endif # cli
%if %with nodes
# !!! During an upgrade, the order is %pre(new), replace files, %post(new), %preun(old), %postun(old) !!!
# $1: 0=uninstall, 1=install, 2=upgrade
%pre nodes
if [ "$1" = "2" ]; then # upgrade
echo "--- Trying to stop Exanodes before the upgrade... ---"
/etc/init.d/%{name} try-stop > /dev/null 2>&1;
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to stop Exanodes. You should restart it manually after the upgrade. ---"
else
echo "--- Exanodes is stopped. ---"
fi
fi
%if %with dkms
%post -n dkms-%{name}
echo "--- Build and install kernel modules with dkms. ---"
dkms add -m %{name} -v @EXA_EDITION_TAG@-@EXA_VERSION@ --rpm_safe_upgrade &&
dkms build -m %{name} -v @EXA_EDITION_TAG@-@EXA_VERSION@ --rpm_safe_upgrade --no-clean-kernel &&
dkms install -m %{name} -v @EXA_EDITION_TAG@-@EXA_VERSION@ --rpm_safe_upgrade --force
true
%else
%post kernel-%{linuxver}
echo "--- Update kernel modules dependencies. ---"
/sbin/depmod -e %{linuxver}
%endif
%if %rheldistro
%if %with selinux
%post selinux-policy
echo "--- Insert SELinux exafsd module. ---"
/usr/sbin/semodule -i /usr/share/selinux/targeted/exa_fsd.pp
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to insert SELinux exafsd module. ---"
fi
%preun selinux-policy
/usr/sbin/semodule -l | grep -q exafsd
if [ $? -eq 0 ]; then
echo "--- Remove SELinux exafsd module. ---"
/usr/sbin/semodule -r exafsd
fi
%endif # %selinux
%endif # %rheldistro
%post nodes
echo "--- Add Exanodes as service. ---"
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add %{name} || :
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d %{name} defaults 98 33 || :
fi
echo "--- Starting Exanodes... ---"
/etc/init.d/%{name} start > /dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to start Exanodes. ---"
else
echo "--- Exanodes is started. ---"
fi
%preun nodes
if [ "$1" = "0" ]; then # uninstall
echo "--- Trying to stop Exanodes before the uninstall... ---"
/etc/init.d/%{name} try-stop >/dev/null 2>&1;
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to stop Exanodes. ---"
else
echo "--- Exanodes is stopped. ---"
fi
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del %{name} || :
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d -f %{name} remove || :
fi
fi
%if %with dkms
%preun -n dkms-%{name}
echo "--- Uninstall kernel modules with dkms. ---"
dkms remove -m %{name} -v @EXA_EDITION_TAG@-@EXA_VERSION@ --rpm_safe_upgrade --all
true
%endif
%post token-manager
echo "--- Add token manager as service. ---"
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add token_manager || :
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d token_manager defaults 97 34 || :
fi
echo "--- Starting Token manager... ---"
/etc/init.d/token_manager start > /dev/null 2>/dev/null
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to start token manager. ---"
else
echo "--- Token manager is started. ---"
fi
%preun token-manager
if [ "$1" = "0" ]; then # uninstall
echo "--- Trying to stop token manager before the uninstall... ---"
/etc/init.d/%{name} stop >/dev/null 2>&1;
if [ $? -ne 0 ]; then
echo "--- WARNING ! Failed to stop token manager. ---"
else
echo "--- Token manager is stopped. ---"
fi
if [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del token_manager || :
elif [ -x /usr/sbin/update-rc.d ]; then
/usr/sbin/update-rc.d -f token_manager remove || :
fi
fi
%files nodes
%defattr(-,root,root,-)
%{_sbindir}/exa_csupd
%if %with filesystems
%{_sbindir}/exa_fsd
%{_sbindir}/exa_fsscript
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/postmount.d/postmount.template
%config(noreplace) %{_sysconfdir}/%{name}/preumount.d/preumount.template
%endif
%{_sbindir}/exa_msgd
%{_sbindir}/exa_serverd
%{_sbindir}/exa_clientd
%if %with monitoring
%{_sbindir}/exa_md
%endif
%config(noreplace) /etc/logrotate.d/%{name}
/etc/init.d/%{name}
%config %{_sysconfdir}/udev/rules.d/40-%{name}.rules
%if %with perf
%config(noreplace) %{_sysconfdir}/%{name}/exaperf.conf
%endif
%files admind
%{_sbindir}/exa_admind
%if %with monitoring
%files monitoring
%{_sbindir}/exa_agentx
/usr/share/snmp/mibs/SEANODES.MIB
%config(noreplace) /etc/logrotate.d/exa_agentx
%endif
# test if any of the kernel modules is necessary to be built
# if not, no kernel module rpm is built
%if %{?with_kcommon:1}%{?!with_kcommon:0}%{?with_bdev:1}%{!?with_bdev:0}%{?!with_libaio:1}%{?!with_libaio:0}
%if %with dkms
%files -n dkms-%{name}
%defattr(-,root,root,-)
%dir %{_usrsrc}/%{tarball_name}
%{_usrsrc}/%{tarball_name}/Makefile.dkms
%{_usrsrc}/%{tarball_name}/dkms.conf
%{_usrsrc}/%{tarball_name}/copy_symvers
%{_usrsrc}/%{tarball_name}/os/include/os_inttypes.h
%{_usrsrc}/%{tarball_name}/os/include/os_assert.h
%{_usrsrc}/%{tarball_name}/common/include/exa_names.h
%{_usrsrc}/%{tarball_name}/common/include/exa_error.h
%{_usrsrc}/%{tarball_name}/common/include/exa_assert.h
%{_usrsrc}/%{tarball_name}/common/include/exa_constants.h
%{_usrsrc}/%{tarball_name}/common/include/exa_math.h
%if %with kcommon
%{_usrsrc}/%{tarball_name}/common/lib/Makefile
%{_usrsrc}/%{tarball_name}/common/lib/exa_common_kernel.[ch]
%{_usrsrc}/%{tarball_name}/common/lib/exa_select_kernel.[ch]
%{_usrsrc}/%{tarball_name}/common/lib/exa_socket_kernel.[ch]
%endif
%if %without libaio
%{_usrsrc}/%{tarball_name}/rdev/src/Makefile
%{_usrsrc}/%{tarball_name}/rdev/src/rdev_kmodule.c
%{_usrsrc}/%{tarball_name}/rdev/src/rdev_kmodule.h
%{_usrsrc}/%{tarball_name}/rdev/include/exa_rdev.h
%endif
%if %with bdev
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/Makefile
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/*.c
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/include/bd_user.h
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/bd_user_bd.h
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/bd_list.h
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/bd_user_fops.h
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/bd_user_kernel.h
%{_usrsrc}/%{tarball_name}/target/linux_bd_target/module/bd_log.h
%endif
%else
%files kernel-%{linuxver}
%defattr(-,root,root,-)
%dir /lib/modules/%{linuxver}/kernel/%{name}
%if %with kcommon
/lib/modules/%{linuxver}/kernel/%{name}/exa_common.ko
%endif
%if %with bdev
/lib/modules/%{linuxver}/kernel/%{name}/exa_bd.ko
%endif
/lib/modules/%{linuxver}/kernel/%{name}/exa_rdev.ko
%endif
%endif #%if %with kcommon || %with bdev || ! %with libaio
%if %with test
%files test-nodes
%defattr(-,root,root,-)
%{_sbindir}/exatest_get_md5
%{_sbindir}/exatest_mydd
%{_sbindir}/exatest_odirect
%{_sbindir}/exatest_gentree
%endif
%if %with tools
%files tools-nodes
%defattr(-,root,root,-)
%{_sbindir}/exa_gdb
%{_sbindir}/exa_enable_valgrind
%{_sbindir}/exatest_kill
%{_sbindir}/exa_rdev_sbtool
%{_sbindir}/exa_rdev_test
%{_sbindir}/exa_rdev_broken
%if %with filesystems
%{_sbindir}/exa_fstool
%endif
%endif
%if %rheldistro
%if %with selinux
%files selinux-policy
%{_datadir}/selinux/targeted/exa_fsd.pp
%endif
%endif
%endif # nodes
%files token-manager
%defattr(-,root,root,-)
/etc/init.d/token_manager
%config(noreplace) /etc/logrotate.d/token_manager.logrotate
%{_sbindir}/token_manager
%{_sbindir}/tm_tool
%changelog